-
Notifications
You must be signed in to change notification settings - Fork 620
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
refactor: always set ics27 ports regardless of whether the capability exists #4640
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
62b0fb3
refactor: always set ics27 ports regardless of whether the capability…
colin-axner 69cb39f
test: add tests for host genesis logic
colin-axner dbf18a7
test: add controller genesis test and fixup host test
colin-axner 12de9b9
Merge branch 'main' into colin/4626-ica-initgenesis-fix
colin-axner cc239e2
lint lint lint
colin-axner ec56a19
Merge branch 'colin/4626-ica-initgenesis-fix' of github.com:cosmos/ib…
colin-axner a36a978
fix: remove verification assertion in e2e as we have not checked for …
colin-axner 7e22c19
Merge branch 'main' into colin/4626-ica-initgenesis-fix
colin-axner b8c2927
Merge branch 'main' into colin/4626-ica-initgenesis-fix
colin-axner 05bd205
Merge branch 'main' into colin/4626-ica-initgenesis-fix
colin-axner 0c72f48
Merge branch 'main' into colin/4626-ica-initgenesis-fix
colin-axner f981eb7
Merge branch 'main' into colin/4626-ica-initgenesis-fix
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,8 @@ func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID, | |
case k.portKeeper.IsBound(ctx, portID) && !k.hasCapability(ctx, portID): | ||
return "", errorsmod.Wrapf(icatypes.ErrPortAlreadyBound, "another module has claimed capability for and bound port with portID: %s", portID) | ||
case !k.portKeeper.IsBound(ctx, portID): | ||
capability := k.BindPort(ctx, portID) | ||
k.setPort(ctx, portID) | ||
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. ideally gets removed #4638 in the future |
||
capability := k.portKeeper.BindPort(ctx, portID) | ||
if err := k.ClaimCapability(ctx, capability, host.PortPath(portID)); err != nil { | ||
return "", errorsmod.Wrapf(err, "unable to bind to newly generated portID: %s", portID) | ||
} | ||
|
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
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 |
---|---|---|
|
@@ -29,7 +29,6 @@ import ( | |
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/simulation" | ||
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" | ||
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" | ||
ibchost "github.com/cosmos/ibc-go/v8/modules/core/24-host" | ||
) | ||
|
||
var ( | ||
|
@@ -123,19 +122,20 @@ func NewAppModule(controllerKeeper *controllerkeeper.Keeper, hostKeeper *hostkee | |
// called once and as an alternative to InitGenesis. | ||
func (am AppModule) InitModule(ctx sdk.Context, controllerParams controllertypes.Params, hostParams hosttypes.Params) { | ||
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. |
||
if am.controllerKeeper != nil { | ||
am.controllerKeeper.SetParams(ctx, controllerParams) | ||
controllerkeeper.InitGenesis(ctx, *am.controllerKeeper, genesistypes.ControllerGenesisState{ | ||
Params: controllerParams, | ||
}) | ||
} | ||
|
||
if am.hostKeeper != nil { | ||
if err := hostParams.Validate(); err != nil { | ||
panic(fmt.Sprintf("could not set ica host params at initialization: %v", err)) | ||
} | ||
am.hostKeeper.SetParams(ctx, hostParams) | ||
|
||
capability := am.hostKeeper.BindPort(ctx, types.HostPortID) | ||
if err := am.hostKeeper.ClaimCapability(ctx, capability, ibchost.PortPath(types.HostPortID)); err != nil { | ||
panic(fmt.Sprintf("could not claim port capability: %v", err)) | ||
} | ||
hostkeeper.InitGenesis(ctx, *am.hostKeeper, genesistypes.HostGenesisState{ | ||
Params: hostParams, | ||
Port: types.HostPortID, | ||
}) | ||
} | ||
} | ||
|
||
|
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.
copy/pasted from ics27 tests