state

package
v0.6.34 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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