state

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemDB

type MemDB struct {
	// contains filtered or unexported fields
}

MemDB is an in stateful wrapper around core.Genesis, that makes it easier to build genesis state.

func NewMemDB

func NewMemDB(genesis *core.Genesis) *MemDB

func (*MemDB) Genesis

func (db *MemDB) Genesis() *core.Genesis

func (*MemDB) SetBalance added in v0.1.9

func (db *MemDB) SetBalance(addr common.Address, balance *big.Int)

func (*MemDB) SetCode

func (db *MemDB) SetCode(addr common.Address, code []byte)

func (*MemDB) SetState

func (db *MemDB) SetState(addr common.Address, key, value common.Hash)

type StorageSlot

type StorageSlot struct {
	Key   common.Hash
	Value common.Hash
}

func EncodeStorage

func EncodeStorage(layout solc.StorageLayout, values StorageValues) ([]StorageSlot, error)

EncodeStorage encodes the given storage values according to the given storage layout. If it does not find a slot for a label, it returns an error. If it does not support encoding a value, it returns an error.

func EncodeStorageEntry added in v0.1.9

func EncodeStorageEntry(layout solc.StorageLayout, label string, value any) (StorageSlot, error)

EncodeStorageEntry encodes the given storage value according to the given storage layout.

type StorageValues

type StorageValues map[string]any

Jump to

Keyboard shortcuts

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