-
Notifications
You must be signed in to change notification settings - Fork 586
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
Adding version to UnmarshalPacketData interface #6988
Adding version to UnmarshalPacketData interface #6988
Conversation
@@ -353,11 +353,17 @@ func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) | |||
// UnmarshalPacketData attempts to unmarshal the provided packet data bytes | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is some linter complaining about name, name type
pattern?
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.
no it's required to fetch the app version below
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -889,7 +889,7 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { | |||
unmarshalerStack, ok := transferStack.(porttypes.PacketDataUnmarshaler) | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should assert the version?
Can do using the if statement below?
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.
yes good call, will add 👍
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.
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
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.
thanks for picking this up!
…nterface-to-return-version
lets not forget to slap backport label |
Quality Gate passed for 'ibc-go'Issues Measures |
* 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/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.