Reorder IBC channel callbacks (#8404)
* reorder chan callbacks * add changelog * Update CHANGELOG.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
78703f1b6e
commit
f9ee39f0b2
|
@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
|||
|
||||
### Improvements
|
||||
|
||||
* (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
|
|
@ -326,15 +326,15 @@ func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChann
|
|||
return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module)
|
||||
}
|
||||
|
||||
if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "channel open ack callback failed")
|
||||
}
|
||||
|
||||
_, err = channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "channel open ack callback failed")
|
||||
}
|
||||
|
||||
return &channeltypes.MsgChannelOpenAckResponse{}, nil
|
||||
}
|
||||
|
||||
|
@ -354,15 +354,15 @@ func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgC
|
|||
return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module)
|
||||
}
|
||||
|
||||
if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "channel open confirm callback failed")
|
||||
}
|
||||
|
||||
_, err = channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "channel open confirm callback failed")
|
||||
}
|
||||
|
||||
return &channeltypes.MsgChannelOpenConfirmResponse{}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue