Skip to content

Commit

Permalink
Simplify is IBC relayer msg check
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Sep 13, 2024
1 parent 412cd54 commit 5e61681
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/bypass_ibc_fee_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,28 @@ func (n BypassIBCFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b

// isIBCRelayerMsg checks if all the messages in the transaction are IBC relayer messages
func isIBCRelayerMsg(msgs []sdk.Msg) bool {
isIBCRelayer := false

for _, msg := range msgs {
switch msg.(type) {
// IBC Client Messages
case *clienttypes.MsgCreateClient, *clienttypes.MsgUpdateClient,
*clienttypes.MsgUpgradeClient, *clienttypes.MsgSubmitMisbehaviour:
isIBCRelayer = true

// IBC Connection Messages
case *conntypes.MsgConnectionOpenInit, *conntypes.MsgConnectionOpenTry,
*conntypes.MsgConnectionOpenAck, *conntypes.MsgConnectionOpenConfirm:
isIBCRelayer = true

// IBC Channel Messages
case *channeltypes.MsgChannelOpenInit, *channeltypes.MsgChannelOpenTry,
*channeltypes.MsgChannelOpenAck, *channeltypes.MsgChannelOpenConfirm,
*channeltypes.MsgChannelCloseInit, *channeltypes.MsgChannelCloseConfirm:
isIBCRelayer = true

// IBC Packet Messages
case *channeltypes.MsgRecvPacket, *channeltypes.MsgAcknowledgement,
*channeltypes.MsgTimeout, *channeltypes.MsgTimeoutOnClose:
isIBCRelayer = true
default:
return false
}
}

return isIBCRelayer
return true
}

0 comments on commit 5e61681

Please sign in to comment.