Documentation
¶
Index ¶
- func NewDatabaseWithConfig(db ethdb.Database, config *triedb.Config) state.Database
- func NewDatabaseWithNodeDB(db ethdb.Database, triedb *triedb.Database) state.Database
- func RegisterExtras()
- func WithConcurrentWorkers(prefetchers int) state.PrefetcherOption
- type StateDB
- func (s *StateDB) AddBalanceMultiCoin(addr common.Address, coinID common.Hash, amount *big.Int)
- func (s *StateDB) GetBalanceMultiCoin(addr common.Address, coinID common.Hash) *big.Int
- func (s *StateDB) GetPredicate(address common.Address, index int) (predicate.Predicate, bool)
- func (s *StateDB) Prepare(rules params.Rules, sender, coinbase common.Address, dst *common.Address, ...)
- func (s *StateDB) SubBalanceMultiCoin(addr common.Address, coinID common.Hash, amount *big.Int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseWithConfig ¶ added in v0.15.3
func NewDatabaseWithNodeDB ¶ added in v0.15.3
func RegisterExtras ¶ added in v0.15.4
func RegisterExtras()
RegisterExtras registers hooks with libevm to achieve Avalanche state management. It MUST NOT be called more than once and therefore is only allowed to be used in tests and `package main`, to avoid polluting other packages that transitively depend on this one but don't need registration.
Of note, a call to RegisterExtras will result in state-key normalization unless stateconf.SkipStateKeyTransformation is used.
func WithConcurrentWorkers ¶ added in v0.15.3
func WithConcurrentWorkers(prefetchers int) state.PrefetcherOption
Types ¶
type StateDB ¶
func New ¶
New creates a new StateDB with the given state.StateDB, wrapping it with additional functionality.
func (*StateDB) AddBalanceMultiCoin ¶ added in v0.15.3
AddBalance adds amount to the account associated with addr.
func (*StateDB) GetBalanceMultiCoin ¶ added in v0.15.3
Retrieve the balance from the given address or 0 if object not found
func (*StateDB) GetPredicate ¶ added in v0.15.4
GetPredicate returns the storage slots associated with the address, index pair. A list of access tuples can be included within transaction types post EIP-2930. The address is declared directly on the access tuple and the index is the i'th occurrence of an access tuple with the specified address.
Ex. AccessList[[AddrA, Predicate1], [AddrB, Predicate2], [AddrA, Predicate3]] In this case, the caller could retrieve predicates 1-3 with the following calls: GetPredicate(AddrA, 0) -> Predicate1 GetPredicate(AddrB, 0) -> Predicate2 GetPredicate(AddrA, 1) -> Predicate3