Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0c640ee

Browse files
mergify[bot]catShaarkdamiannolan
authored andcommittedJan 19, 2023
use controller module address instead of module name for NewMsgChannelOpenInit (backport cosmos#2568) (cosmos#2608)
* use controller module address instead of module name for NewMsgChannelOpenInit (cosmos#2568) In controller keeper's `registerInterchainAccount` we execute a `MsgChannelOpenInit` to set up an ica channel. Currently, we have [`icatypes.ModuleName`](https://github.com/cosmos/ibc-go/blob/95cec44c9fb10a2e84a327cdd98c7d588f091f42/modules/apps/27-interchain-accounts/controller/keeper/account.go#L63) as the msg signer. This is not good because the [`ValidateBasic()`](https://github.com/cosmos/ibc-go/blob/692790402a033c1d9647c1e1eded5351332283bf/modules/core/04-channel/types/msgs.go#L34) of `MsgChannelOpenInit` has check if msg signer is bech32 or not. ref cosmos#2566 closes: cosmos#2559 --- 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. - [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules/10-structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes (cherry picked from commit 6105db4) * resolving conflicts Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com> Co-authored-by: Damian Nolan <damiannolan@gmail.com>
1 parent b144f57 commit 0c640ee

File tree

1 file changed

+2
-1
lines changed
  • modules/apps/27-interchain-accounts/controller/keeper

1 file changed

+2
-1
lines changed
 

‎modules/apps/27-interchain-accounts/controller/keeper/account.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package keeper
33
import (
44
sdk "github.com/line/lbm-sdk/types"
55
sdkerrors "github.com/line/lbm-sdk/types/errors"
6+
authtypes "github.com/line/lbm-sdk/x/auth/types"
67

78
icatypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/types"
89
channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types"
@@ -56,7 +57,7 @@ func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, connectionID, owner s
5657
return err
5758
}
5859

59-
msg := channeltypes.NewMsgChannelOpenInit(portID, string(versionBytes), channeltypes.ORDERED, []string{connectionID}, icatypes.PortID, icatypes.ModuleName)
60+
msg := channeltypes.NewMsgChannelOpenInit(portID, string(versionBytes), channeltypes.ORDERED, []string{connectionID}, icatypes.PortID, authtypes.NewModuleAddress(icatypes.ModuleName).String())
6061
handler := k.msgRouter.Handler(msg)
6162

6263
res, err := handler(ctx, msg)

0 commit comments

Comments
 (0)
Please sign in to comment.