2022-06-06 12:37:13 +00:00
|
|
|
package ante
|
2022-04-20 11:50:55 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
|
2022-09-07 06:36:11 +00:00
|
|
|
"github.com/cerc-io/laconicd/x/evm/statedb"
|
|
|
|
evmtypes "github.com/cerc-io/laconicd/x/evm/types"
|
2022-10-10 10:38:33 +00:00
|
|
|
evm "github.com/cerc-io/laconicd/x/evm/vm"
|
|
|
|
feemarkettypes "github.com/cerc-io/laconicd/x/feemarket/types"
|
2022-04-20 11:50:55 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
tx "github.com/cosmos/cosmos-sdk/types/tx"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/core"
|
|
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
|
|
)
|
|
|
|
|
2022-10-10 10:38:33 +00:00
|
|
|
// DynamicFeeEVMKeeper is a subset of EVMKeeper interface that supports dynamic fee checker
|
|
|
|
type DynamicFeeEVMKeeper interface {
|
|
|
|
ChainID() *big.Int
|
|
|
|
GetParams(ctx sdk.Context) evmtypes.Params
|
|
|
|
GetBaseFee(ctx sdk.Context, ethCfg *params.ChainConfig) *big.Int
|
|
|
|
}
|
|
|
|
|
2022-04-20 11:50:55 +00:00
|
|
|
// EVMKeeper defines the expected keeper interface used on the Eth AnteHandler
|
|
|
|
type EVMKeeper interface {
|
|
|
|
statedb.Keeper
|
2022-10-10 10:38:33 +00:00
|
|
|
DynamicFeeEVMKeeper
|
2022-04-20 11:50:55 +00:00
|
|
|
|
2022-10-10 10:38:33 +00:00
|
|
|
NewEVM(ctx sdk.Context, msg core.Message, cfg *evmtypes.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) evm.EVM
|
2022-04-20 11:50:55 +00:00
|
|
|
DeductTxCostsFromUserBalance(
|
|
|
|
ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool,
|
2022-10-10 10:38:33 +00:00
|
|
|
) (fees sdk.Coins, priority int64, err error)
|
2022-04-20 11:50:55 +00:00
|
|
|
GetBalance(ctx sdk.Context, addr common.Address) *big.Int
|
|
|
|
ResetTransientGasUsed(ctx sdk.Context)
|
2022-10-10 10:38:33 +00:00
|
|
|
GetTxIndexTransient(ctx sdk.Context) uint64
|
2022-04-20 11:50:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type protoTxProvider interface {
|
|
|
|
GetProtoTx() *tx.Tx
|
|
|
|
}
|
2022-10-10 10:38:33 +00:00
|
|
|
|
|
|
|
// FeeMarketKeeper defines the expected keeper interface used on the AnteHandler
|
|
|
|
type FeeMarketKeeper interface {
|
|
|
|
GetParams(ctx sdk.Context) (params feemarkettypes.Params)
|
|
|
|
AddTransientGasWanted(ctx sdk.Context, gasWanted uint64) (uint64, error)
|
|
|
|
}
|