From 72edb15addd1add929bae070583f98e0afda0e8d Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 28 Feb 2025 17:48:06 +0000 Subject: [PATCH 1/2] cleanup unused ibc ante handler (#3608) --- app/ante/handler_options.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 8a7db00ae2..96ce304ab1 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -27,8 +27,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ethante "github.com/zeta-chain/ethermint/app/ante" ethermint "github.com/zeta-chain/ethermint/types" evmtypes "github.com/zeta-chain/ethermint/x/evm/types" @@ -37,9 +35,10 @@ import ( ) type HandlerOptions struct { - AccountKeeper evmtypes.AccountKeeper - BankKeeper evmtypes.BankKeeper - IBCKeeper *ibckeeper.Keeper + AccountKeeper evmtypes.AccountKeeper + BankKeeper evmtypes.BankKeeper + // TODO: enable back IBC + // IBCKeeper *ibckeeper.Keeper FeeMarketKeeper FeeMarketKeeper EvmKeeper EVMKeeper FeegrantKeeper ante.FeegrantKeeper @@ -76,7 +75,9 @@ func NewLegacyCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler { // Note: signature verification uses EIP instead of the cosmos signature validator ethante.NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), - ibcante.NewRedundantRelayDecorator(options.IBCKeeper), + // TODO: enable back IBC + // check if this ante handler is needed in non legacy cosmos ante handlers + // ibcante.NewRedundantRelayDecorator(options.IBCKeeper), ethante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper), ) } From 0c5bccb1a67447476993fe55b7285e624f2314fd Mon Sep 17 00:00:00 2001 From: huochexizhan Date: Fri, 28 Feb 2025 19:05:36 +0100 Subject: [PATCH 2/2] chore: fix some function names in comment (#3610) Signed-off-by: huochexizhan --- testutil/sample/crypto.go | 2 +- testutil/sample/sample.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testutil/sample/crypto.go b/testutil/sample/crypto.go index 2ff635678f..b631520c4e 100644 --- a/testutil/sample/crypto.go +++ b/testutil/sample/crypto.go @@ -103,7 +103,7 @@ func BTCAddressP2WPKH(t *testing.T, r *rand.Rand, net *chaincfg.Params) *btcutil return addr } -// BtcAddressP2WPKH returns a pkscript for a sample btc P2WPKH address +// BTCAddressP2WPKHScript returns a pkscript for a sample btc P2WPKH address func BTCAddressP2WPKHScript(t *testing.T, r *rand.Rand, net *chaincfg.Params) []byte { addr := BTCAddressP2WPKH(t, r, net) script, err := txscript.PayToAddrScript(addr) diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index 99dd62844c..f2cd97278f 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -96,7 +96,7 @@ func Uint64InRange(low, high uint64) uint64 { return r.Uint64()%(high-low) + low } -// Uint64InRange returns a sample uint64 in the given ranges +// Uint64InRangeFromRand returns a sample uint64 in the given ranges func Uint64InRangeFromRand(r *rand.Rand, low, high uint64) uint64 { if low == high { return low // avoid division by zero