evm

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyPrefixCode       = []byte{0x01}
	KeyPrefixStorage    = []byte{0x02}
	KeyPrefixHeightHash = []byte{0x03}
	KeyPrefixLogs       = []byte{0x04}
)

Functions

func AddressStoragePrefix

func AddressStoragePrefix(address ethcmn.Address) []byte

AddressStoragePrefix returns a prefix to iterate over a given account storage.

func HeightHashKey

func HeightHashKey(height uint64) []byte

HeightHashKey returns the key for the given chain epoch and height. The key will be composed in the following order:

key = prefix + bytes(height)

This ordering facilitates the iteration by height for the EVM GetHashFn queries.

Types

type ContractStore

type ContractStore struct {
	State *storage.State
	// contains filtered or unexported fields
}

func NewContractStore

func NewContractStore(state *storage.State) *ContractStore

func (*ContractStore) Delete

func (cs *ContractStore) Delete(prefix []byte, key []byte) (bool, error)

func (*ContractStore) Get

func (cs *ContractStore) Get(prefix []byte, key []byte) ([]byte, error)

func (*ContractStore) GetStoreKey

func (cs *ContractStore) GetStoreKey(prefix []byte, key []byte) storage.StoreKey

func (*ContractStore) Iterate

func (cs *ContractStore) Iterate(prefix []byte, fn func(key []byte, value []byte) bool) (stop bool)

func (*ContractStore) Set

func (cs *ContractStore) Set(prefix []byte, key []byte, value []byte) error

func (*ContractStore) WithState

func (cs *ContractStore) WithState(state *storage.State) *ContractStore

Jump to

Keyboard shortcuts

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