Documentation ¶
Index ¶
- type TrieState
- func (s *TrieState) ClearChildStorage(keyToChild, key []byte) error
- func (s *TrieState) ClearPrefix(prefix []byte) error
- func (s *TrieState) ClearPrefixInChild(keyToChild, prefix []byte) error
- func (s *TrieState) Copy() (*TrieState, error)
- func (s *TrieState) Delete(key []byte) error
- func (s *TrieState) DeleteChildStorage(key []byte) error
- func (s *TrieState) Get(key []byte) ([]byte, error)
- func (s *TrieState) GetBalance(key [32]byte) (uint64, error)
- func (s *TrieState) GetChild(keyToChild []byte) (*trie.Trie, error)
- func (s *TrieState) GetChildNextKey(keyToChild, key []byte) ([]byte, error)
- func (s *TrieState) GetChildStorage(keyToChild, key []byte) ([]byte, error)
- func (s *TrieState) GetKeysWithPrefixFromChild(keyToChild, prefix []byte) ([][]byte, error)
- func (s *TrieState) Has(key []byte) (bool, error)
- func (s *TrieState) LoadCode() ([]byte, error)
- func (s *TrieState) LoadCodeHash() (common.Hash, error)
- func (s *TrieState) MustRoot() common.Hash
- func (s *TrieState) NextKey(key []byte) []byte
- func (s *TrieState) Root() (common.Hash, error)
- func (s *TrieState) Set(key []byte, value []byte) error
- func (s *TrieState) SetBalance(key [32]byte, balance uint64) error
- func (s *TrieState) SetChild(keyToChild []byte, child *trie.Trie) error
- func (s *TrieState) SetChildStorage(keyToChild, key, value []byte) error
- func (s *TrieState) Trie() *trie.Trie
- func (s *TrieState) TrieEntries() map[string][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TrieState ¶
type TrieState struct {
// contains filtered or unexported fields
}
TrieState is a wrapper around a transient trie that is used during the course of executing some runtime call. If the execution of the call is successful, the trie will be saved in the StorageState.
func NewTrieState ¶
NewTrieState returns a new TrieState with the given trie
func (*TrieState) ClearChildStorage ¶
ClearChildStorage removes the child storage entry from the trie
func (*TrieState) ClearPrefix ¶
ClearPrefix deletes all key-value pairs from the trie where the key starts with the given prefix
func (*TrieState) ClearPrefixInChild ¶
ClearPrefixInChild clears all the keys from the child trie that have the given prefix
func (*TrieState) DeleteChildStorage ¶
DeleteChildStorage deletes child storage from the trie
func (*TrieState) GetBalance ¶
GetBalance returns the balance for a given public key
func (*TrieState) GetChildNextKey ¶
GetChildNextKey returns the next lexicographical larger key from child storage. If it does not exist, it returns nil.
func (*TrieState) GetChildStorage ¶
GetChildStorage returns a value from a child trie
func (*TrieState) GetKeysWithPrefixFromChild ¶
GetKeysWithPrefixFromChild ...
func (*TrieState) LoadCodeHash ¶
LoadCodeHash returns the hash of the runtime code (located at :code)
func (*TrieState) MustRoot ¶
MustRoot returns the trie's root hash. It panics if it fails to compute the root.
func (*TrieState) NextKey ¶
NextKey returns the next key in the trie in lexicographical order. If it does not exist, it returns nil.
func (*TrieState) SetBalance ¶
SetBalance sets the balance for a given public key
func (*TrieState) SetChildStorage ¶
SetChildStorage sets a key-value pair in a child trie
func (*TrieState) TrieEntries ¶
TrieEntries returns every key-value pair in the trie