-
Notifications
You must be signed in to change notification settings - Fork 624
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
feat: implementing SubmitTx gRPC endpoint #2147
Conversation
42a7a1c
to
09c053a
Compare
Shall I add an e2e for this test in a follow up PR? |
28a487c
to
743001a
Compare
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.
Great work. Nice changelog entry. See suggestions. Approving as I think any changes to the MsgSubmitTx fields should be done in a followup (if we go that direction)
channelID, found := k.GetActiveChannelID(ctx, msg.ConnectionId, portID) | ||
if !found { | ||
return nil, sdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID) | ||
} |
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.
Should we be taking in the channelID as the message argument? What's the UX benefit here? I'm thinking about a future where we remove the active channel mapping
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 suppose we could, but i think in that future we will break APIs anyway. So not sure its worth optimizing for that now
}{ | ||
{ | ||
"success", func() { | ||
owner = TestOwnerAddress |
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.
set to TestOwnerAddress
as default before tc.malleate()
Memo: "memo", | ||
} | ||
|
||
timeoutTimestamp := suite.chainA.GetContext().BlockTime().Add(time.Minute).UnixNano() |
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.
There's a suite.chainA.GetTimeoutHeight() function I think
|
||
tc.malleate() // malleate mutates test data | ||
|
||
msg := types.NewMsgSubmitTx(owner, connectionID, clienttypes.NewHeight(0, 0), uint64(timeoutTimestamp), packetData) |
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.
use clienttypes.ZeroHeight() instead
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 more or less good to go, left some nits on tests and we should return sequence in the msg response afaik!
Nice work!
return nil, sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") | ||
} | ||
|
||
_, err = k.SendTx(ctx, chanCap, msg.ConnectionId, portID, msg.PacketData, msg.TimeoutTimestamp) |
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 can include the sequence in the MsgSubmitTxResponse
, right?
|
||
icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" | ||
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" | ||
icacontrollertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" |
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.
nit: I think we normally alias this as just controllertypes
var ( | ||
path *ibctesting.Path | ||
owner string | ||
connectionID 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.
do we need to expose this var to mutate, or can we just use path.EndpointA.ConnectionID
and mutate the path in malleate()
?
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 think it's fine to leave as is 🤝
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.
You're right actually, I updated it. Thanks
|
||
tc.malleate() // malleate mutates test data | ||
|
||
msg := types.NewMsgSubmitTx(owner, connectionID, clienttypes.NewHeight(0, 0), uint64(timeoutTimestamp), packetData) |
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 could expose the msg
as test func level var and mutate the fields - owner, connection, packetData..etc in malleate()
it would remove the need for 3 test func level vars I think
* feat: implementing SubmitTx gRPC endpoint * test: adding failure cases * add capability test * chore: comment * chore: cleanup * chore: changelog * import & sequence * nits * refactor: clean up tests (cherry picked from commit 9019adf) # Conflicts: # modules/apps/27-interchain-accounts/controller/keeper/msg_server.go
* feat: implementing SubmitTx gRPC endpoint (#2147) * feat: implementing SubmitTx gRPC endpoint * test: adding failure cases * add capability test * chore: comment * chore: cleanup * chore: changelog * import & sequence * nits * refactor: clean up tests (cherry picked from commit 9019adf) # Conflicts: # modules/apps/27-interchain-accounts/controller/keeper/msg_server.go * resolving conflicts Co-authored-by: Sean King <[email protected]> Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]>
Description
closes: #2056
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/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes