-
Notifications
You must be signed in to change notification settings - Fork 586
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
api!: remove capabilities #7270
Changes from all commits
85e65bf
265889e
df1d289
87aa51a
f1908a8
fd56f19
2fcea96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ import ( | |
"github.com/cosmos/ibc-go/v9/internal/logging" | ||
icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" | ||
channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" | ||
host "github.com/cosmos/ibc-go/v9/modules/core/24-host" | ||
ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" | ||
) | ||
|
||
|
@@ -65,16 +64,7 @@ func (k Keeper) registerInterchainAccount(ctx context.Context, connectionID, por | |
return "", errorsmod.Wrapf(icatypes.ErrActiveChannelAlreadySet, "existing active channel %s for portID %s on connection %s", activeChannelID, portID, connectionID) | ||
} | ||
|
||
switch { | ||
case k.portKeeper.IsBound(ctx, portID) && !k.hasCapability(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. This case basically says - if a a capability exists (port is bound) with core ibc, but not claimed by the ica app, then return an error. This is essentially unreachable code, unless someone has wired a code path into the chain to allow icacontroller- port ids to be created with the core ibc scoped keeper. |
||
return "", errorsmod.Wrapf(icatypes.ErrPortAlreadyBound, "another module has claimed capability for and bound port with portID: %s", portID) | ||
case !k.portKeeper.IsBound(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. This case is - if no capability exists (port bound) for port id in core ibc's scoped keeper, then;
In scenarios where we open a new channel(after close) for an existing port id, then neither of these cases are hit and skip the entire switch statement. |
||
k.setPort(ctx, portID) | ||
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) | ||
} | ||
} | ||
k.setPort(ctx, portID) | ||
|
||
sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/7223 | ||
msg := channeltypes.NewMsgChannelOpenInit(portID, version, ordering, []string{connectionID}, icatypes.HostPortID, authtypes.NewModuleAddress(icatypes.ModuleName).String()) | ||
|
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.
🥳