Adding version to UnmarshalPacketData interface#6988
Conversation
| // into an InterchainAccountPacketData. This function implements the optional | ||
| // PacketDataUnmarshaler interface required for ADR 008 support. | ||
| func (IBCMiddleware) UnmarshalPacketData(_ sdk.Context, _, _ string, bz []byte) (interface{}, error) { | ||
| func (im IBCMiddleware) UnmarshalPacketData(ctx sdk.Context, portID string, channelID string, bz []byte) (interface{}, string, error) { |
There was a problem hiding this comment.
is some linter complaining about name, name type pattern?
There was a problem hiding this comment.
no it's required to fetch the app version below
There was a problem hiding this comment.
ah, meant if a linter was complaining for having these as portID, channelID string as opposed to portID string, channelID string
There was a problem hiding this comment.
nothing was shouting at me about it I don't think 🤔
|
I seem to have broken some transfer E2Es (also failing locally) looking into it now |
|
test fixed by #6993 |
| suite.Require().True(ok) | ||
|
|
||
| packetData, err := unmarshalerStack.UnmarshalPacketData(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, data) | ||
| packetData, _, err := unmarshalerStack.UnmarshalPacketData(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, data) |
There was a problem hiding this comment.
we should assert the version?
Can do using the if statement below?
There was a problem hiding this comment.
yes good call, will add 👍
colin-axner
left a comment
There was a problem hiding this comment.
Nice one! Thank you @chatton 🙏 The changes LGTM. Only thing I noticed was that in transfer we could do an assertion on the returned version
DimitrisJim
left a comment
There was a problem hiding this comment.
thanks for picking this up!
…nterface-to-return-version
|
lets not forget to slap backport label |
|
* chore: adding version to UnmarshalPacketData interface * chore: addressing PR feedback (cherry picked from commit 75ec6e9)
|
We forgot to update docs on this as well |



Description
closes: #6976
This PR updates the UnmarshalPacketData to return the underlying application version.
Note: in a few tests, we needed to make them stateful since we are fetching the version via the ics20Wrapper
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/).godoccomments.Files changedin the GitHub PR explorer.SonarCloud Reportin the comment section below once CI passes.