2022-01-02 22:44:46 +00:00
|
|
|
package ante
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
tx "github.com/cosmos/cosmos-sdk/types/tx"
|
2022-01-05 18:18:02 +00:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2022-01-02 22:44:46 +00:00
|
|
|
"github.com/ethereum/go-ethereum/core"
|
|
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
2022-01-05 07:28:27 +00:00
|
|
|
"github.com/tharsis/ethermint/x/evm/statedb"
|
2022-01-02 22:44:46 +00:00
|
|
|
evmtypes "github.com/tharsis/ethermint/x/evm/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// EVMKeeper defines the expected keeper interface used on the Eth AnteHandler
|
|
|
|
type EVMKeeper interface {
|
2022-01-05 07:28:27 +00:00
|
|
|
statedb.Keeper
|
2022-01-02 22:44:46 +00:00
|
|
|
|
|
|
|
ChainID() *big.Int
|
|
|
|
GetParams(ctx sdk.Context) evmtypes.Params
|
2022-02-14 23:08:41 +00:00
|
|
|
NewEVM(ctx sdk.Context, msg core.Message, cfg *evmtypes.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) *vm.EVM
|
2022-01-02 22:44:46 +00:00
|
|
|
DeductTxCostsFromUserBalance(
|
|
|
|
ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool,
|
|
|
|
) (sdk.Coins, error)
|
2022-04-30 16:11:28 +00:00
|
|
|
GetBaseFee(ctx sdk.Context, ethCfg *params.ChainConfig) *big.Int
|
2022-01-05 18:18:02 +00:00
|
|
|
GetBalance(ctx sdk.Context, addr common.Address) *big.Int
|
2022-01-14 09:37:33 +00:00
|
|
|
ResetTransientGasUsed(ctx sdk.Context)
|
2022-01-02 22:44:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type protoTxProvider interface {
|
|
|
|
GetProtoTx() *tx.Tx
|
|
|
|
}
|