evm

package
v0.0.0-...-9687111 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for Ethermint type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

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

func NewAppModule(keeper Keeper) AppModule

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

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) Name

func (AppModule) Name() string

Name is module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler sets up a new handler for module

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler sets up new querier handler for module

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

QuerierRoute sets up path for queries

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

RegisterInvariants interface for registering invariants

func (AppModule) Route

func (am AppModule) Route() string

Route specifies path for transactions

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) Name

func (AppModuleBasic) Name() string

Name for app module basic

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

func (k *Keeper) AddBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)

AddBalance calls CommitStateDB.AddBalance using the passed in context

func (*Keeper) AddLog

func (k *Keeper) AddLog(ctx sdk.Context, log *ethtypes.Log)

AddLog calls CommitStateDB.AddLog using the passed in context

func (*Keeper) AddPreimage

func (k *Keeper) AddPreimage(ctx sdk.Context, hash ethcmn.Hash, preimage []byte)

AddPreimage calls CommitStateDB.AddPreimage using the passed in context

func (*Keeper) AddRefund

func (k *Keeper) AddRefund(ctx sdk.Context, gas uint64)

AddRefund calls CommitStateDB.AddRefund using the passed in context

func (*Keeper) BlockHash

func (k *Keeper) BlockHash(ctx sdk.Context) ethcmn.Hash

BlockHash calls CommitStateDB.BlockHash using the passed in context

func (*Keeper) Commit

func (k *Keeper) Commit(ctx sdk.Context, deleteEmptyObjects bool) (root ethcmn.Hash, err error)

Commit calls CommitStateDB.Commit using the passed { in context

func (*Keeper) Copy

func (k *Keeper) Copy(ctx sdk.Context) ethvm.StateDB

Copy calls CommitStateDB.Copy using the passed in context

func (*Keeper) CreateAccount

func (k *Keeper) CreateAccount(ctx sdk.Context, addr ethcmn.Address)

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) Database

func (k *Keeper) Database(ctx sdk.Context) ethstate.Database

Database calls CommitStateDB.Database using the passed in context

func (*Keeper) Empty

func (k *Keeper) Empty(ctx sdk.Context, addr ethcmn.Address) bool

Empty calls CommitStateDB.Empty using the passed in context

func (*Keeper) Error

func (k *Keeper) Error(ctx sdk.Context) error

Error calls CommitStateDB.Error using the passed in context

func (*Keeper) Exist

func (k *Keeper) Exist(ctx sdk.Context, addr ethcmn.Address) bool

Exist calls CommitStateDB.Exist using the passed in context

func (*Keeper) Finalise

func (k *Keeper) Finalise(ctx sdk.Context, deleteEmptyObjects bool)

Finalise calls CommitStateDB.Finalise using the passed in context

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

func (k *Keeper) GetBalance(ctx sdk.Context, addr ethcmn.Address) *big.Int

GetBalance calls CommitStateDB.GetBalance using the passed in context

func (*Keeper) GetBlockBloomMapping

func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) ethtypes.Bloom

GetBlockBloomMapping gets bloombits from block height

func (*Keeper) GetBlockHashMapping

func (k *Keeper) GetBlockHashMapping(ctx sdk.Context, hash []byte) (height int64)

GetBlockHashMapping gets block height from block consensus hash

func (*Keeper) GetCode

func (k *Keeper) GetCode(ctx sdk.Context, addr ethcmn.Address) []byte

GetCode calls CommitStateDB.GetCode using the passed in context

func (*Keeper) GetCodeHash

func (k *Keeper) GetCodeHash(ctx sdk.Context, addr ethcmn.Address) ethcmn.Hash

GetCodeHash calls CommitStateDB.GetCodeHash using the passed in context

func (*Keeper) GetCodeSize

func (k *Keeper) GetCodeSize(ctx sdk.Context, addr ethcmn.Address) int

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) GetLogs

func (k *Keeper) GetLogs(ctx sdk.Context, hash ethcmn.Hash) []*ethtypes.Log

GetLogs calls CommitStateDB.GetLogs using the passed in context

func (*Keeper) GetNonce

func (k *Keeper) GetNonce(ctx sdk.Context, addr ethcmn.Address) uint64

GetNonce calls CommitStateDB.GetNonce using the passed in context

func (*Keeper) GetOrNewStateObject

func (k *Keeper) GetOrNewStateObject(ctx sdk.Context, addr ethcmn.Address) types.StateObject

GetOrNewStateObject calls CommitStateDB.GetOrNetStateObject using the passed in context

func (*Keeper) GetRefund

func (k *Keeper) GetRefund(ctx sdk.Context) uint64

GetRefund calls CommitStateDB.GetRefund using the passed in context

func (*Keeper) GetState

func (k *Keeper) GetState(ctx sdk.Context, addr ethcmn.Address, hash ethcmn.Hash) ethcmn.Hash

GetState calls CommitStateDB.GetState using the passed in context

func (*Keeper) HasSuicided

func (k *Keeper) HasSuicided(ctx sdk.Context, addr ethcmn.Address) bool

HasSuicided calls CommitStateDB.HasSuicided using the passed in context

func (*Keeper) IntermediateRoot

func (k *Keeper) IntermediateRoot(ctx sdk.Context, deleteEmptyObjects bool)

IntermediateRoot calls CommitStateDB.IntermediateRoot using the passed in context

func (*Keeper) Logs

func (k *Keeper) Logs(ctx sdk.Context) []*ethtypes.Log

Logs calls CommitStateDB.Logs using the passed in context

func (*Keeper) Preimages

func (k *Keeper) Preimages(ctx sdk.Context) map[ethcmn.Hash][]byte

Preimages calls CommitStateDB.Preimages using the passed in context

func (*Keeper) Prepare

func (k *Keeper) Prepare(ctx sdk.Context, thash, bhash ethcmn.Hash, txi int)

Prepare calls CommitStateDB.Prepare using the passed in context

func (*Keeper) Reset

func (k *Keeper) Reset(ctx sdk.Context, root ethcmn.Hash) error

Reset calls CommitStateDB.Reset using the passed in context

func (*Keeper) RevertToSnapshot

func (k *Keeper) RevertToSnapshot(ctx sdk.Context, revID int)

RevertToSnapshot calls CommitStateDB.RevertToSnapshot using the passed in context

func (*Keeper) SetBalance

func (k *Keeper) SetBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)

SetBalance calls CommitStateDB.SetBalance using the passed in context

func (*Keeper) SetBlockBloomMapping

func (k *Keeper) SetBlockBloomMapping(ctx sdk.Context, bloom ethtypes.Bloom, height int64)

SetBlockBloomMapping sets the mapping from block height to bloom bits

func (*Keeper) SetBlockHashMapping

func (k *Keeper) SetBlockHashMapping(ctx sdk.Context, hash []byte, height int64)

SetBlockHashMapping sets the mapping from block consensus hash to block height

func (*Keeper) SetCode

func (k *Keeper) SetCode(ctx sdk.Context, addr ethcmn.Address, code []byte)

SetCode calls CommitStateDB.SetCode using the passed in context

func (*Keeper) SetNonce

func (k *Keeper) SetNonce(ctx sdk.Context, addr ethcmn.Address, nonce uint64)

SetNonce calls CommitStateDB.SetNonce using the passed in context

func (*Keeper) SetState

func (k *Keeper) SetState(ctx sdk.Context, addr ethcmn.Address, key, value ethcmn.Hash)

SetState calls CommitStateDB.SetState using the passed in context

func (*Keeper) Snapshot

func (k *Keeper) Snapshot(ctx sdk.Context) int

Snapshot calls CommitStateDB.Snapshot using the passed in context

func (*Keeper) StorageTrie

func (k *Keeper) StorageTrie(ctx sdk.Context, addr ethcmn.Address) ethstate.Trie

StorageTrie calls CommitStateDB.StorageTrie using the passed in context

func (*Keeper) SubBalance

func (k *Keeper) SubBalance(ctx sdk.Context, addr ethcmn.Address, amount *big.Int)

SubBalance calls CommitStateDB.SubBalance using the passed in context

func (*Keeper) SubRefund

func (k *Keeper) SubRefund(ctx sdk.Context, gas uint64)

SubRefund calls CommitStateDB.SubRefund using the passed in context

func (*Keeper) Suicide

func (k *Keeper) Suicide(ctx sdk.Context, addr ethcmn.Address) bool

Suicide calls CommitStateDB.Suicide using the passed in context

func (*Keeper) TxIndex

func (k *Keeper) TxIndex(ctx sdk.Context) int

TxIndex calls CommitStateDB.TxIndex using the passed in context

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL