Documentation
¶
Overview ¶
Package state provides a caching layer atop the Ethereum state trie.
Index ¶
- type Database
- type Dump
- type DumpAccount
- type DumpCollector
- type DumpConfig
- type StateDB
- type StateUpgradeAdapter
- func (a *StateUpgradeAdapter) AddBalance(addr common.Address, amount *uint256.Int)
- func (a *StateUpgradeAdapter) SetCode(addr common.Address, code []byte)
- func (a *StateUpgradeAdapter) SetNonce(addr common.Address, nonce uint64)
- func (a *StateUpgradeAdapter) SetState(addr common.Address, key, value common.Hash)
- type Trie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DumpAccount ¶
type DumpAccount = ethstate.DumpAccount
type DumpCollector ¶
type DumpCollector = ethstate.DumpCollector
type DumpConfig ¶
type DumpConfig = ethstate.DumpConfig
type StateDB ¶
StateDB structs within the ethereum protocol are used to store anything within the merkle trie. StateDBs take care of caching and storing nested states. It's the general query interface to retrieve:
* Contracts * Accounts
Once the state is committed, tries cached in stateDB (including account trie, storage tries) will no longer be functional. A new state instance must be created with new root and updated database for accessing post- commit states.
func (*StateDB) GetTxHash ¶
GetTxHash returns the current tx hash on the StateDB set by SetTxContext.
type StateUpgradeAdapter ¶ added in v0.8.6
type StateUpgradeAdapter struct {
*StateDB
}
StateUpgradeAdapter adapts the new geth StateDB interface (with BalanceChangeReason) to the legacy stateupgrade.StateDB interface that doesn't use BalanceChangeReason.
func NewStateUpgradeAdapter ¶ added in v0.8.6
func NewStateUpgradeAdapter(stateDB *StateDB) *StateUpgradeAdapter
NewStateUpgradeAdapter creates a new adapter for state upgrade compatibility
func (*StateUpgradeAdapter) AddBalance ¶ added in v0.8.6
func (a *StateUpgradeAdapter) AddBalance(addr common.Address, amount *uint256.Int)
AddBalance implements the legacy AddBalance without BalanceChangeReason
func (*StateUpgradeAdapter) SetCode ¶ added in v0.8.6
func (a *StateUpgradeAdapter) SetCode(addr common.Address, code []byte)
SetCode implements the stateupgrade.StateDB interface (no return value)