Documentation ¶
Index ¶
- Constants
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func ValidateGenesis(data GenesisState) error
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, bl abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisAccount
- type GenesisState
- 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) BlockHash(ctx sdk.Context) ethcmn.Hash
- 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) CreateGenesisAccount(ctx sdk.Context, account GenesisAccount)
- func (k *Keeper) Database(ctx sdk.Context) ethstate.Database
- func (k *Keeper) Empty(ctx sdk.Context, addr ethcmn.Address) bool
- 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)
- func (k *Keeper) ForEachStorage(ctx sdk.Context, addr ethcmn.Address, cb func(key, value ethcmn.Hash) bool) error
- func (k *Keeper) GetBalance(ctx sdk.Context, addr ethcmn.Address) *big.Int
- func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bloom
- func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64)
- 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) GetLogs(ctx sdk.Context, hash ethcmn.Hash) []*ethtypes.Log
- 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) 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)
- func (k *Keeper) Logs(ctx sdk.Context) []*ethtypes.Log
- 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) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64)
- func (k *Keeper) SetBlockHashMapping(ctx sdk.Context, hash []byte, height int64)
- func (k *Keeper) SetCode(ctx sdk.Context, addr ethcmn.Address, code []byte)
- func (k *Keeper) SetNonce(ctx sdk.Context, addr ethcmn.Address, nonce uint64)
- 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
Constants ¶
const ( QueryProtocolVersion = "protocolVersion" QueryBalance = "balance" QueryBlockNumber = "blockNumber" QueryStorage = "storage" QueryCode = "code" QueryNonce = "nonce" QueryHashToHeight = "hashToHeight" QueryTxLogs = "txLogs" QueryLogsBloom = "logsBloom" QueryLogs = "logs" QueryAccount = "account" )
Supported endpoints
Variables ¶
This section is empty.
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
InitGenesis initializes genesis state based on exported genesis
func NewHandler ¶
NewHandler returns a handler for Ethermint type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates evm genesis config
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule is struct that defines variables used within module
func NewAppModule ¶
NewAppModule creates a new AppModule Object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, bl abci.RequestBeginBlock)
BeginBlock function for module at start of each block
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock function for module at end of block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis exports the genesis state to be used by daemon
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis instantiates the genesis state
func (AppModule) NewHandler ¶
NewHandler sets up a new handler for module
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler sets up new querier handler for module
func (AppModule) QuerierRoute ¶
QuerierRoute sets up path for queries
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants interface for registering invariants
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic struct
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis is json default structure
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd Gets the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd Gets the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers types for module
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes Registers rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis is the validation check of the Genesis
type GenesisAccount ¶
type GenesisAccount struct { Address ethcmn.Address `json:"address"` Balance *big.Int `json:"balance"` Code []byte `json:"code,omitempty"` Storage types.Storage `json:"storage,omitempty"` }
GenesisAccount defines an account to be initialized in the genesis state.
type GenesisState ¶
type GenesisState struct {
Accounts []GenesisAccount `json:"accounts"`
}
GenesisState defines the application's genesis state. It contains all the information required and accounts to initialize the blockchain.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState sets default evm genesis config
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis exports genesis state
type Keeper ¶
type Keeper struct {
// 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(ak auth.AccountKeeper, storageKey, codeKey sdk.StoreKey, blockKey sdk.StoreKey, cdc *codec.Codec) 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) CreateAccount ¶
CreateAccount calls CommitStateDB.CreateAccount using the passed in context
func (*Keeper) CreateGenesisAccount ¶
func (k *Keeper) CreateGenesisAccount(ctx sdk.Context, account GenesisAccount)
CreateGenesisAccount initializes an account and its balance, code, and storage
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) GetBalance ¶
GetBalance calls CommitStateDB.GetBalance using the passed in context
func (*Keeper) GetBlockBloomMapping ¶
GetBlockBloomMapping gets bloombits from block height
func (*Keeper) GetBlockHashMapping ¶
GetBlockHashMapping 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) 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) RevertToSnapshot ¶
RevertToSnapshot calls CommitStateDB.RevertToSnapshot using the passed in context
func (*Keeper) SetBalance ¶
SetBalance calls CommitStateDB.SetBalance using the passed in context
func (*Keeper) SetBlockBloomMapping ¶
SetBlockBloomMapping sets the mapping from block height to bloom bits
func (*Keeper) SetBlockHashMapping ¶
SetBlockHashMapping sets the mapping from block consensus hash to block 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