Skip to content

Commit

Permalink
Rename Order to Ordering for MsgRegisterInterchainAccount. (#5674)
Browse files Browse the repository at this point in the history
* nit: Rename Order to Ordering for MsgRegisterInterchainAccount.

To align with name used in channel proto types w.r.t order.

* update docs

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
  • Loading branch information
DimitrisJim and crodriguezvega authored Jan 22, 2024
1 parent 0ad8ab4 commit 61e3eb5
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion docs/docs/02-apps/02-interchain-accounts/05-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type MsgRegisterInterchainAccount struct {
Owner string
ConnectionID string
Version string
Order channeltypes.Order
Ordering channeltypes.Order
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ the associated capability.`),
return err
}

order, err := parseOrder(cmd)
order, err := parseOrdering(cmd)
if err != nil {
return err
}
Expand Down Expand Up @@ -118,8 +118,8 @@ appropriate relative timeoutTimestamp must be provided with flag {relative-packe
return cmd
}

// parseOrder gets the channel ordering from the flags.
func parseOrder(cmd *cobra.Command) (channeltypes.Order, error) {
// parseOrdering gets the channel ordering from the flags.
func parseOrdering(cmd *cobra.Command) (channeltypes.Order, error) {
orderString, err := cmd.Flags().GetString(flagOrdering)
if err != nil {
return channeltypes.NONE, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, connectionID, owner,

// registerInterchainAccount registers an interchain account, returning the channel id of the MsgChannelOpenInitResponse
// and an error if one occurred.
func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID, version string, order channeltypes.Order) (string, error) {
func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID, version string, ordering channeltypes.Order) (string, error) {
// if there is an active channel for this portID / connectionID return an error
activeChannelID, found := k.GetOpenActiveChannel(ctx, connectionID, portID)
if found {
Expand All @@ -69,7 +69,7 @@ func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID,
}
}

msg := channeltypes.NewMsgChannelOpenInit(portID, version, order, []string{connectionID}, icatypes.HostPortID, authtypes.NewModuleAddress(icatypes.ModuleName).String())
msg := channeltypes.NewMsgChannelOpenInit(portID, version, ordering, []string{connectionID}, icatypes.HostPortID, authtypes.NewModuleAddress(icatypes.ModuleName).String())
handler := k.msgRouter.Handler(msg)
res, err := handler(ctx, msg)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s msgServer) RegisterInterchainAccount(goCtx context.Context, msg *types.M

s.SetMiddlewareDisabled(ctx, portID, msg.ConnectionId)

channelID, err := s.registerInterchainAccount(ctx, msg.ConnectionId, portID, msg.Version, msg.Order)
channelID, err := s.registerInterchainAccount(ctx, msg.ConnectionId, portID, msg.Version, msg.Ordering)
if err != nil {
s.Logger(ctx).Error("error registering interchain account", "error", err.Error())
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/27-interchain-accounts/controller/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ var (
)

// NewMsgRegisterInterchainAccount creates a new instance of MsgRegisterInterchainAccount
func NewMsgRegisterInterchainAccount(connectionID, owner, version string, order channeltypes.Order) *MsgRegisterInterchainAccount {
func NewMsgRegisterInterchainAccount(connectionID, owner, version string, ordering channeltypes.Order) *MsgRegisterInterchainAccount {
return &MsgRegisterInterchainAccount{
ConnectionId: connectionID,
Owner: owner,
Version: version,
Order: order,
Ordering: ordering,
}
}

Expand Down
102 changes: 51 additions & 51 deletions modules/apps/27-interchain-accounts/controller/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ message MsgRegisterInterchainAccount {
string owner = 1;
string connection_id = 2;
string version = 3;
ibc.core.channel.v1.Order order = 4;
ibc.core.channel.v1.Order ordering = 4;
}

// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount
Expand Down

0 comments on commit 61e3eb5

Please sign in to comment.