-
Notifications
You must be signed in to change notification settings - Fork 597
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
chore: rename SubmitTx
to SendTx
#2255
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a8f0607
updating naming of submit tx to send tx
damiannolan 6208d38
use struct embedding
damiannolan accb860
Merge branch 'main' into damian/2231-update-submit-tx-to-sendtx
damiannolan a76b552
Merge branch 'main' into damian/2231-update-submit-tx-to-sendtx
damiannolan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import ( | |
var _ types.MsgServer = msgServer{} | ||
|
||
type msgServer struct { | ||
*Keeper | ||
Keeper *Keeper | ||
} | ||
|
||
// NewMsgServerImpl returns an implementation of the ICS27 MsgServer interface | ||
|
@@ -25,15 +25,15 @@ func NewMsgServerImpl(keeper *Keeper) types.MsgServer { | |
} | ||
|
||
// RegisterAccount defines a rpc handler for MsgRegisterAccount | ||
func (k msgServer) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) { | ||
func (s msgServer) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, 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. Ah, nice I see that you're renaming it here now... So forget about my comment here. |
||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
|
||
portID, err := icatypes.NewControllerPortID(msg.Owner) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
channelID, err := k.registerInterchainAccount(ctx, msg.ConnectionId, portID, msg.Version) | ||
channelID, err := s.Keeper.registerInterchainAccount(ctx, msg.ConnectionId, portID, msg.Version) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
@@ -43,29 +43,29 @@ func (k msgServer) RegisterAccount(goCtx context.Context, msg *types.MsgRegister | |
}, nil | ||
} | ||
|
||
// SubmitTx defines a rpc handler for MsgSubmitTx | ||
func (k msgServer) SubmitTx(goCtx context.Context, msg *types.MsgSubmitTx) (*types.MsgSubmitTxResponse, error) { | ||
// SendTx defines a rpc handler for MsgSendTx | ||
func (s msgServer) SendTx(goCtx context.Context, msg *types.MsgSendTx) (*types.MsgSendTxResponse, error) { | ||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
|
||
portID, err := icatypes.NewControllerPortID(msg.Owner) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
channelID, found := k.GetActiveChannelID(ctx, msg.ConnectionId, portID) | ||
channelID, found := s.Keeper.GetActiveChannelID(ctx, msg.ConnectionId, portID) | ||
if !found { | ||
return nil, sdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID) | ||
} | ||
|
||
chanCap, found := k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, channelID)) | ||
chanCap, found := s.Keeper.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, channelID)) | ||
if !found { | ||
return nil, sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") | ||
} | ||
|
||
seq, err := k.SendTx(ctx, chanCap, msg.ConnectionId, portID, msg.PacketData, msg.TimeoutTimestamp) | ||
seq, err := s.Keeper.SendTx(ctx, chanCap, msg.ConnectionId, portID, msg.PacketData, msg.TimeoutTimestamp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &types.MsgSubmitTxResponse{Sequence: seq}, nil | ||
return &types.MsgSendTxResponse{Sequence: seq}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry, this is probably a bit nitpicking, but I was just thinking that what we send to the host chain is a message, right? Or is message and transaction something that mean the same thing? For me I thought that a transaction was the execution of the message, but maybe I am just mistaken... Saying this because maybe this could be renamed to
SendMsg
...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 we should just stick with the naming used in the spec. I see your reasoning but the
InterchainAccountPacketData
type may be composed of one or manysdk.Msg
s encoded into the[]byte
field.