-
Notifications
You must be signed in to change notification settings - Fork 579
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
imp: add UnmarshalPacketData interface function #3353
Changes from 12 commits
bf93c0e
8c16e8d
3500d06
89f608c
b77cfe6
1db4626
32b74ec
f8298da
f826ddd
ca33576
6bf400e
19ab301
1a1a082
07cc36a
9d9e33a
882dc95
bfb359d
27f2447
d80eb6f
16a8e84
c4987af
d4bae04
9919cb1
06916c5
bec5a03
6781f20
1f04b6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,3 +300,14 @@ func (im IBCModule) OnTimeoutPacket( | |
|
||
return nil | ||
} | ||
|
||
// UnmarshalPacketData attempts to unmarshal the provided packet data bytes | ||
// into a FungibleTokenPacketData. | ||
func (im IBCModule) UnmarshalPacketData(bz []byte) (interface{}, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have a e.g. something like type PacketData interface {
GetBytes() []byte
ValidateBasic() error
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do this, but it wouldn't provide any functional benefits, would just clean up the API slightly. It would be an API breaking change to add which is why we have avoided it for now. I believe the interface would likely become unnecessary in the existence of a flat map packet data |
||
var packetData types.FungibleTokenPacketData | ||
if err := types.ModuleCdc.UnmarshalJSON(bz, &packetData); err != nil { | ||
return nil, err | ||
} | ||
|
||
return packetData, nil | ||
} |
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.
this is only necessary if the ADR 8 implementation is higher than ICS 29, which should not be the case. I added the function anyways so we could discuss here whether to keep it or not
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.
hmm, I guess its best to keep it?
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.
Agree that it should be kept. Let's remove ordering requirements from our stack whenever possible