evm

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEVMByDefaultConfig

func NewEVMByDefaultConfig(tx *types.Transaction, statedb *StateDB, blockHeader *types.BlockHeader, bcStore store.BlockchainStore) *vm.EVM

NewEVMByDefaultConfig returns a new EVM. The returned EVM is not thread safe and should only ever be used *once*.

Types

type StateDB

type StateDB struct {
	*state.Statedb
}

StateDB for evm

func (*StateDB) AddPreimage

func (s *StateDB) AddPreimage(common.Hash, []byte)

AddPreimage records a SHA3 preimage seen by the VM.

func (*StateDB) ForEachStorage

func (s *StateDB) ForEachStorage(common.Address, func(common.Hash, common.Hash) bool)

ForEachStorage visits all the key-value pairs for the specified account storage.

func (*StateDB) GetCommittedState

func (s *StateDB) GetCommittedState(addr common.Address, hash common.Hash) common.Hash

GetCommittedState returns the committed value of the specified key in account storage if exists.

func (*StateDB) GetState

func (s *StateDB) GetState(address common.Address, key common.Hash) common.Hash

GetState returns the value of the specified key in account storage if exists. Otherwise, return empty hash.

func (*StateDB) SetState

func (s *StateDB) SetState(address common.Address, key common.Hash, value common.Hash)

SetState adds or updates the specified key-value pair in account storage.

Jump to

Keyboard shortcuts

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