Skip to content

Commit

Permalink
rename order to ordering (backport #5674)
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega committed Apr 26, 2024
1 parent a7d082d commit f395900
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ the associated capability.`),
return err
}

order, err := parseOrder(cmd)
ordering, err := parseOrdering(cmd)
if err != nil {
return err
}

msg := types.NewMsgRegisterInterchainAccountWithOrdering(connectionID, owner, version, order)
msg := types.NewMsgRegisterInterchainAccountWithOrdering(connectionID, owner, version, ordering)

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
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 @@ -49,7 +49,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 @@ -66,7 +66,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 @@ -37,7 +37,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 @@ -19,7 +19,7 @@ func NewMsgRegisterInterchainAccountWithOrdering(connectionID, owner, version st
ConnectionId: connectionID,
Owner: owner,
Version: version,
Order: ordering,
Ordering: ordering,
}
}

Expand All @@ -31,7 +31,7 @@ func NewMsgRegisterInterchainAccount(connectionID, owner, version string) *MsgRe
ConnectionId: connectionID,
Owner: owner,
Version: version,
Order: channeltypes.ORDERED,
Ordering: channeltypes.ORDERED,
}
}

Expand Down
96 changes: 48 additions & 48 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 @@ -24,7 +24,7 @@ message MsgRegisterInterchainAccount {
string owner = 1;
string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""];
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 f395900

Please sign in to comment.