Skip to content

Commit

Permalink
fix: reduce get bech32 prefix when get signer (cosmos#1231)
Browse files Browse the repository at this point in the history
* add missing getFeePayer for clienttypes

* add missing getFeePayer for feetypes

* apply in penumbra

* add change doc

---------

Co-authored-by: Justin Tieri <[email protected]>
  • Loading branch information
mmsqe and jtieri authored Aug 1, 2023
1 parent d878a55 commit 2138221
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [\#1208](https://github.com/cosmos/relayer/pull/1208) Replace gogo/protobuf to cosmos/gogoproto.
* [\#1221](https://github.com/cosmos/relayer/pull/1221) Update cometbft to v0.37.2 and ibc-go to v7.2.0.
* [\#1226](https://github.com/cosmos/relayer/pull/1226) Avoid invalid Bech32 prefix error in parallel tests when sdk Config get overwritten by each other in single process.
* [\#1231](https://github.com/cosmos/relayer/pull/1231) Reduce get bech32 prefix when get signer.

## v0.9.3

Expand Down
8 changes: 8 additions & 0 deletions relayer/chains/cosmos/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,19 @@ func getFeePayer(tx *typestx.Tx) string {
case *clienttypes.MsgUpdateClient:
// Same failure mode as MsgCreateClient.
return firstMsg.Signer
case *clienttypes.MsgUpgradeClient:
return firstMsg.Signer
case *clienttypes.MsgSubmitMisbehaviour:
// Same failure mode as MsgCreateClient.
return firstMsg.Signer
case *feetypes.MsgRegisterPayee:
return firstMsg.Relayer
case *feetypes.MsgRegisterCounterpartyPayee:
return firstMsg.Relayer
case *feetypes.MsgPayPacketFee:
return firstMsg.Signer
case *feetypes.MsgPayPacketFeeAsync:
return firstMsg.PacketFee.RefundAddress
default:
return firstMsg.GetSigners()[0].String()
}
Expand Down
13 changes: 13 additions & 0 deletions relayer/chains/penumbra/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
typestx "github.com/cosmos/cosmos-sdk/types/tx"
feetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/relayer/v2/relayer/provider"
Expand Down Expand Up @@ -151,6 +152,18 @@ func getFeePayer(tx *typestx.Tx) string {
case *clienttypes.MsgUpdateClient:
// Same failure mode as MsgCreateClient.
return firstMsg.Signer
case *clienttypes.MsgUpgradeClient:
return firstMsg.Signer
case *clienttypes.MsgSubmitMisbehaviour:
return firstMsg.Signer
case *feetypes.MsgRegisterPayee:
return firstMsg.Relayer
case *feetypes.MsgRegisterCounterpartyPayee:
return firstMsg.Relayer
case *feetypes.MsgPayPacketFee:
return firstMsg.Signer
case *feetypes.MsgPayPacketFeeAsync:
return firstMsg.PacketFee.RefundAddress
default:
return firstMsg.GetSigners()[0].String()
}
Expand Down

0 comments on commit 2138221

Please sign in to comment.