-
Notifications
You must be signed in to change notification settings - Fork 956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Murisi/borsh ibc msg transfer #3527
Conversation
…s. The corresponding Transfers now match these.
…ated for IBC transfer.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3527 +/- ##
==========================================
- Coverage 53.48% 53.08% -0.40%
==========================================
Files 320 320
Lines 110000 110794 +794
==========================================
- Hits 58832 58815 -17
- Misses 51168 51979 +811 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you! I left comments for minor stuff.
let mut data = vec![]; | ||
prost::Message::encode(&msg.to_any(), &mut data).unwrap(); | ||
let data = IbcMessage::Envelope(Box::new( | ||
MsgEnvelope::from(ConnectionMsg::from(msg)).into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK. MsgEnvelope::Connection(msg.into())
can be simple because we don't need to import ConnectionMsg
explicitly ?
@@ -104,11 +105,16 @@ where | |||
let tx_data = | |||
batched_tx.tx.data(batched_tx.cmt).ok_or(Error::NoTxData)?; | |||
|
|||
// Message body must be an IbcMessage | |||
let tx_data = IbcMessage::try_from_slice(&tx_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer using message
instead of tx_data
for the following functions.
let tx_data = IbcMessage::try_from_slice(&tx_data) | |
let message = IbcMessage::try_from_slice(&tx_data) |
@@ -184,7 +190,7 @@ where | |||
Ok(()) | |||
} | |||
|
|||
fn validate_with_msg(&self, tx_data: &[u8]) -> VpResult<()> { | |||
fn validate_with_msg(&self, tx_data: IbcMessage) -> VpResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn validate_with_msg(&self, tx_data: IbcMessage) -> VpResult<()> { | |
fn validate_with_msg(&self, message: IbcMessage) -> VpResult<()> { |
474fb23
to
3c2ad18
Compare
Closed in favour of the rebase in #3560 . |
Describe your changes
Attempt to close #3501 and hence simplify the (de)serialization of IBC transactions for third parties. More specifically, the following changes have been made:
IbcMessage
enumeration instead of being an untagged serialization of aMsgTransfer
,MsgNftTransfer
orAny
structure.Tx
are serialized using Borsh, and will ease schema generation.Indicate on which release or other PRs this topic is based on
Namada 0.40.0
Checklist before merging to
draft