Documentation ¶
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Keeper
- func (k *Keeper) AddBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k *Keeper) AddLog(ctx sdk.Context, log *ethtypes.Log)
- func (k *Keeper) AddPreimage(ctx sdk.Context, hash ethcmn.Hash, preimage []byte)
- func (k *Keeper) AddRefund(ctx sdk.Context, gas uint64)
- func (k *Keeper) AllLogs(ctx sdk.Context) []*ethtypes.Log
- func (k Keeper) BalanceInvariant() sdk.Invariant
- func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (k *Keeper) BlockHash(ctx sdk.Context) ethcmn.Hash
- func (k *Keeper) ClearStateObjects(ctx sdk.Context)
- func (k *Keeper) Commit(ctx sdk.Context, deleteEmptyObjects bool) (root ethcmn.Hash, err error)
- func (k *Keeper) Copy(ctx sdk.Context) ethvm.StateDB
- func (k *Keeper) CreateAccount(ctx sdk.Context, addr ethcmn.Address)
- func (k *Keeper) Database(ctx sdk.Context) ethstate.Database
- func (k *Keeper) DeleteLogs(ctx sdk.Context, hash ethcmn.Hash)
- func (k *Keeper) Empty(ctx sdk.Context, addr ethcmn.Address) bool
- func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func (k *Keeper) Error(ctx sdk.Context) error
- func (k *Keeper) Exist(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) Finalise(ctx sdk.Context, deleteEmptyObjects bool) error
- func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
- func (k Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) (types.Storage, error)
- func (k Keeper) GetAllTxLogs(ctx sdk.Context) []types.TransactionLogs
- func (k *Keeper) GetBalance(ctx sdk.Context, addr ethcmn.Address) *big.Int
- func (k Keeper) GetBlockBloom(ctx sdk.Context, height int64) (ethtypes.Bloom, bool)
- func (k Keeper) GetBlockHash(ctx sdk.Context, hash []byte) (int64, bool)
- func (k Keeper) GetChainConfig(ctx sdk.Context) (types.ChainConfig, bool)
- func (k *Keeper) GetCode(ctx sdk.Context, addr ethcmn.Address) []byte
- func (k *Keeper) GetCodeHash(ctx sdk.Context, addr ethcmn.Address) ethcmn.Hash
- func (k *Keeper) GetCodeSize(ctx sdk.Context, addr ethcmn.Address) int
- func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
- func (k Keeper) GetHeightHash(ctx sdk.Context, height uint64) common.Hash
- func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) ([]*ethtypes.Log, error)
- func (k *Keeper) GetNonce(ctx sdk.Context, addr ethcmn.Address) uint64
- func (k *Keeper) GetOrNewStateObject(ctx sdk.Context, addr ethcmn.Address) types.StateObject
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) GetRefund(ctx sdk.Context) uint64
- func (k *Keeper) GetState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
- func (k *Keeper) HasSuicided(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) IntermediateRoot(ctx sdk.Context, deleteEmptyObjects bool) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NonceInvariant() sdk.Invariant
- func (k *Keeper) Preimages(ctx sdk.Context) map[ethcmn.Hash][]byte
- func (k *Keeper) Prepare(ctx sdk.Context, thash, bhash ethcmn.Hash, txi int)
- func (k *Keeper) Reset(ctx sdk.Context, root ethcmn.Hash) error
- func (k *Keeper) RevertToSnapshot(ctx sdk.Context, revID int)
- func (k *Keeper) SetBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k Keeper) SetBlockBloom(ctx sdk.Context, height int64, bloom ethtypes.Bloom)
- func (k Keeper) SetBlockHash(ctx sdk.Context, hash []byte, height int64)
- func (k Keeper) SetChainConfig(ctx sdk.Context, config types.ChainConfig)
- func (k *Keeper) SetCode(ctx sdk.Context, addr ethcmn.Address, code []byte)
- func (k Keeper) SetHeightHash(ctx sdk.Context, height uint64, hash common.Hash)
- func (k *Keeper) SetLogs(ctx sdk.Context, hash ethcmn.Hash, logs []*ethtypes.Log) error
- func (k *Keeper) SetNonce(ctx sdk.Context, addr ethcmn.Address, nonce uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetState(ctx sdk.Context, addr ethcmn.Address, key, value ethcmn.Hash)
- func (k *Keeper) Snapshot(ctx sdk.Context) int
- func (k *Keeper) StorageTrie(ctx sdk.Context, addr ethcmn.Address) ethstate.Trie
- func (k *Keeper) SubBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)
- func (k *Keeper) SubRefund(ctx sdk.Context, gas uint64)
- func (k *Keeper) Suicide(ctx sdk.Context, addr ethcmn.Address) bool
- func (k *Keeper) TxIndex(ctx sdk.Context) int
- func (k *Keeper) UpdateAccounts(ctx sdk.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the evm module invariants
Types ¶
type Keeper ¶
type Keeper struct { // Ethermint concrete implementation on the EVM StateDB interface CommitStateDB *types.CommitStateDB // Transaction counter in a block. Used on StateSB's Prepare function. // It is reset to 0 every block on BeginBlock so there's no point in storing the counter // on the KVStore or adding it as a field on the EVM genesis state. TxCount int Bloom *big.Int // contains filtered or unexported fields }
Keeper wraps the CommitStateDB, allowing us to pass in SDK context while adhering to the StateDB interface.
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, ak types.AccountKeeper, sk types.SupplyKeeper, bk bank.Keeper, ) *Keeper
NewKeeper generates new evm module keeper
func (*Keeper) AddBalance ¶
AddBalance calls CommitStateDB.AddBalance using the passed in context
func (*Keeper) AddPreimage ¶
AddPreimage calls CommitStateDB.AddPreimage using the passed in context
func (Keeper) BalanceInvariant ¶
BalanceInvariant checks that all auth module's EthAccounts in the application have the same balance as the EVM one.
func (*Keeper) BeginBlock ¶
func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock sets the block hash -> block height map for the previous block height and resets the Bloom filter and the transaction count to 0.
func (*Keeper) ClearStateObjects ¶
ClearStateObjects calls CommitStateDB.ClearStateObjects using the passed in context
func (*Keeper) CreateAccount ¶
CreateAccount calls CommitStateDB.CreateAccount using the passed in context
func (*Keeper) DeleteLogs ¶
DeleteLogs calls CommitStateDB.DeleteLogs using the passed in context
func (Keeper) EndBlock ¶
func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock updates the accounts and commits state objects to the KV Store, while deleting the empty ones. It also sets the bloom filers for the request block to the store. The EVM end block logic doesn't update the validator set, thus it returns an empty slice.
func (*Keeper) ForEachStorage ¶
func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
ForEachStorage calls CommitStateDB.ForEachStorage using passed in context
func (Keeper) GetAccountStorage ¶
GetAccountStorage return state storage associated with an account
func (Keeper) GetAllTxLogs ¶
func (k Keeper) GetAllTxLogs(ctx sdk.Context) []types.TransactionLogs
GetAllTxLogs return all the transaction logs from the store.
func (*Keeper) GetBalance ¶
GetBalance calls CommitStateDB.GetBalance using the passed in context
func (Keeper) GetBlockBloom ¶
GetBlockBloom gets bloombits from block height
func (Keeper) GetBlockHash ¶
GetBlockHash gets block height from block consensus hash
func (Keeper) GetChainConfig ¶
GetChainConfig gets block height from block consensus hash
func (*Keeper) GetCodeHash ¶
GetCodeHash calls CommitStateDB.GetCodeHash using the passed in context
func (*Keeper) GetCodeSize ¶
GetCodeSize calls CommitStateDB.GetCodeSize using the passed in context
func (*Keeper) GetCommittedState ¶
func (k *Keeper) GetCommittedState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash
GetCommittedState calls CommitStateDB.GetCommittedState using the passed in context
func (Keeper) GetHeightHash ¶
GetHeightHash returns the block header hash associated with a given block height and chain epoch number.
func (*Keeper) GetOrNewStateObject ¶
GetOrNewStateObject calls CommitStateDB.GetOrNetStateObject using the passed in context
func (*Keeper) HasSuicided ¶
HasSuicided calls CommitStateDB.HasSuicided using the passed in context
func (*Keeper) IntermediateRoot ¶
IntermediateRoot calls CommitStateDB.IntermediateRoot using the passed in context
func (Keeper) NonceInvariant ¶
NonceInvariant checks that all auth module's EthAccounts in the application have the same nonce sequence as the EVM.
func (*Keeper) RevertToSnapshot ¶
RevertToSnapshot calls CommitStateDB.RevertToSnapshot using the passed in context
func (*Keeper) SetBalance ¶
SetBalance calls CommitStateDB.SetBalance using the passed in context
func (Keeper) SetBlockBloom ¶
SetBlockBloom sets the mapping from block height to bloom bits
func (Keeper) SetBlockHash ¶
SetBlockHash sets the mapping from block consensus hash to block height
func (Keeper) SetChainConfig ¶
func (k Keeper) SetChainConfig(ctx sdk.Context, config types.ChainConfig)
SetChainConfig sets the mapping from block consensus hash to block height
func (Keeper) SetHeightHash ¶
SetHeightHash sets the block header hash associated with a given height.
func (*Keeper) StorageTrie ¶
StorageTrie calls CommitStateDB.StorageTrie using the passed in context
func (*Keeper) SubBalance ¶
SubBalance calls CommitStateDB.SubBalance using the passed in context
func (*Keeper) UpdateAccounts ¶
UpdateAccounts calls CommitStateDB.UpdateAccounts using the passed in context