-
Notifications
You must be signed in to change notification settings - Fork 629
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
refactor: replace ack interface with result type for OnRecvPacket #7093
Conversation
…event func arg to use concrete type
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.
small bit of restructuring to the code here
suite.SetupTest() // reset | ||
path = ibctesting.NewPath(suite.chainA, suite.chainB) | ||
|
||
tc.malleate() | ||
|
||
err := suite.chainB.App.GetIBCKeeper().ChannelKeeper.WriteAcknowledgement(suite.chainB.GetContext(), packet, ack) | ||
|
||
if tc.expPass { | ||
expPass := tc.expError == 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.
epic test refactor
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.
Woo!! Fantastic work my friend! Just as I expected 🙂 Everything LGTM. As mentioned we can tackle the WriteAcknowledgement
another day. Only thing I noticed is docs on RecvPacketResult
would be great!
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.
Squeaky clean PR, really nice job, just a few mega nits but happy to get this merged 💪
modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go
Outdated
Show resolved
Hide resolved
|
||
// String implements the fmt.Stringer interface. | ||
func (r RecvPacketStatus) String() string { | ||
return [...]string{"Success", "Failure", "Async"}[r] |
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.
do we need the [...]
? Can this just be a return []string{"Success", "Failure", "Async"}[r]
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 don't think its needed but I think its an optimisation(?).
Using the ...
is essentially the same as having [3]string{"Success", "Failure", "Async"}[r]
which makes an array with fixed size rather than a slice 🤷🏻♂️
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.
ACK doc updates :)
// Success instructs that the IBC application state should be persisted. | ||
Success RecvPacketStatus = iota | ||
// Failure instructs that the IBC application state should be discarded. | ||
Failure | ||
// Async instructs that the IBC application state should be persisted | ||
// and acknowledgement data will be written later asynchronously. | ||
Async |
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.
Note for follow up, we might want these as RecvStatusSuccess
, RecvStatusFailure
or something like that..
Quality Gate passed for 'ibc-go'Issues Measures |
Description
Removes the
exported.Acknowledgement
interface and introduces a new concreteRecvPacketResult
type.closes: #7042
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.