Skip to content

Commit

Permalink
wip: update ante handler
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Oct 31, 2024
1 parent 8f2e114 commit 6a2ba62
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/ante/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
storetypes "cosmossdk.io/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
ethtypes "github.com/ethereum/go-ethereum/core/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
Expand Down Expand Up @@ -113,18 +112,21 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
return next(ctx, tx, simulate)
}

fmt.Println("EthValidateBasicDecorator.AnteHandle")
fmt.Println("EthValidateBasicDecorator.AnteHandle", tx)
for _, msg := range tx.GetMsgs() {
fmt.Println("EthValidateBasicDecorator.AnteHandle", msg.String())
}

//sigetheriumTx, ok := tx.(*evmtypes.MsgEthereumTx)
sigetheriumTx, ok := tx.(sdk.HasValidateBasic)
if !ok {
return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type")
}
if ok {
err := sigetheriumTx.ValidateBasic()
// ErrNoSignatures is fine with eth tx
if err != nil && !errors.Is(err, errortypes.ErrNoSignatures) {
return ctx, errorsmod.Wrap(err, "tx basic validation failed")
}

err := sigetheriumTx.ValidateBasic()
// ErrNoSignatures is fine with eth tx
if err != nil && !errors.Is(err, errortypes.ErrNoSignatures) {
return ctx, errorsmod.Wrap(err, "tx basic validation failed")
//return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type")
}

// For eth type cosmos tx, some fields should be verified as zero values,
Expand Down

0 comments on commit 6a2ba62

Please sign in to comment.