state

package
v0.0.0-...-7be72bc Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadKey   = errors.New("cannot decode key to address")
	ErrBadValue = errors.New("cannot decode override account")
)

Functions

This section is empty.

Types

type OverrideAccount

type OverrideAccount struct {
	Nonce     *hexutil.Uint64              `json:"nonce"`
	Code      *hexutil.Bytes               `json:"code"`
	Balance   *hexutil.Big                 `json:"balance"`
	State     *map[common.Hash]common.Hash `json:"state"`
	StateDiff *map[common.Hash]common.Hash `json:"stateDiff"`
}

type OverrideSet

type OverrideSet map[common.Address]OverrideAccount

OverrideSet is a set of accounts with customized state that can be applied during eth_call or debug_traceCall.

func Copy

func Copy(os OverrideSet) (OverrideSet, error)

Copy creates a deep copy of a given OverrideSet.

func ParseOverrideData

func ParseOverrideData(data map[string]any) (OverrideSet, error)

ParseOverrideData decodes a map into an OverrideSet and validates all the fields are correctly typed.

func WithMaxBalanceOverride

func WithMaxBalanceOverride(acc common.Address, os OverrideSet) OverrideSet

WithMaxBalanceOverride takes a set and appends an override for the given address to have a balance equal to max uint96.

Jump to

Keyboard shortcuts

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