Skip to content
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

updated error calls with module names #2399

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (apps/27-interchain-accounts) [\#2140](https://github.com/cosmos/ibc-go/pull/2140) Adding migration handler to ICS27 `controller` submodule to assert ownership of channel capabilities and set middleware enabled flag for existing channels. The ICS27 module consensus version has been bumped from 1 to 2.
* (apps/27-interchain-accounts) [\#2290](https://github.com/cosmos/ibc-go/pull/2290) Changed `DefaultParams` function in `host` submodule to allow all messages by default. Defined a constant named `AllowAllHostMsgs` for `host` module to keep wildcard "*" string which allows all messages.
* (apps/27-interchain-accounts) [\#2248](https://github.com/cosmos/ibc-go/pull/2248) Adding call to underlying app in `OnChanCloseConfirm` callback of the controller submodule and adding relevant unit tests.
* (apps/27-interchain-accounts) [\#2251](https://github.com/cosmos/ibc-go/pull/2251) Adding `msgServer` struct to controller submodule that embeds the `Keeper` struct.
* (apps/27-interchain-accounts) [\#2251](https://github.com/cosmos/ibc-go/pull/2251) Adding `msgServer` struct to controller submodule that embeds the `Keeper` struct.
* (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to includ portID & channelID for better identification of errors.

### Features

Expand Down
12 changes: 6 additions & 6 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChan
// Perform application logic callback
version, err := cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, channelID, cap, msg.Channel.Counterparty, msg.Channel.Version)
if err != nil {
return nil, sdkerrors.Wrap(err, "channel open init callback failed")
return nil, sdkerrors.Wrapf(err, "channel open init callback failed for Port ID: %s, Channel ID: %s", msg.PortId, channelID)
alizahidraja marked this conversation as resolved.
Show resolved Hide resolved
}

// Write channel into state
Expand Down Expand Up @@ -231,7 +231,7 @@ func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChann
// Perform application logic callback
version, err := cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, channelID, cap, msg.Channel.Counterparty, msg.CounterpartyVersion)
if err != nil {
return nil, sdkerrors.Wrap(err, "channel open try callback failed")
return nil, sdkerrors.Wrapf(err, "channel open try callback failed for Port ID: %s, Channel ID: %s", msg.PortId, channelID)
}

// Write channel into state
Expand Down Expand Up @@ -269,7 +269,7 @@ func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChann

// Perform application logic callback
if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyChannelId, msg.CounterpartyVersion); err != nil {
return nil, sdkerrors.Wrap(err, "channel open ack callback failed")
return nil, sdkerrors.Wrapf(err, "channel open ack callback failed for Port ID: %s, Channel ID: %s", msg.PortId, msg.ChannelId)
}

// Write channel into state
Expand Down Expand Up @@ -303,7 +303,7 @@ func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgC

// Perform application logic callback
if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil {
return nil, sdkerrors.Wrap(err, "channel open confirm callback failed")
return nil, sdkerrors.Wrapf(err, "channel open confirm callback failed for Port ID: %s, Channel ID: %s", msg.PortId, msg.ChannelId)
}

// Write channel into state
Expand All @@ -328,7 +328,7 @@ func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgCha
}

if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil {
return nil, sdkerrors.Wrap(err, "channel close init callback failed")
return nil, sdkerrors.Wrapf(err, "channel close init callback failed for Port ID: %s, Channel ID: %s", msg.PortId, msg.ChannelId)
}

err = k.ChannelKeeper.ChanCloseInit(ctx, msg.PortId, msg.ChannelId, cap)
Expand Down Expand Up @@ -356,7 +356,7 @@ func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.Msg
}

if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil {
return nil, sdkerrors.Wrap(err, "channel close confirm callback failed")
return nil, sdkerrors.Wrapf(err, "channel close confirm callback failed for Port ID: %s, Channel ID: %s", msg.PortId, msg.ChannelId)
}

err = k.ChannelKeeper.ChanCloseConfirm(ctx, msg.PortId, msg.ChannelId, cap, msg.ProofInit, msg.ProofHeight)
Expand Down