Documentation ¶
Index ¶
- type TrieState
- func (s *TrieState) BeginStorageTransaction()
- 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) ClearPrefixLimit(prefix []byte, limit uint32) (uint32, bool)
- func (s *TrieState) CommitStorageTransaction()
- func (s *TrieState) Delete(key []byte)
- func (s *TrieState) DeleteChild(key []byte)
- func (s *TrieState) DeleteChildLimit(key []byte, limit *[]byte) (uint32, bool, error)
- func (s *TrieState) Get(key []byte) []byte
- 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) GetDeletedNodeHashes() (hashesSet map[common.Hash]struct{})
- func (s *TrieState) GetInsertedNodeHashes() (hashesSet map[common.Hash]struct{}, err error)
- func (s *TrieState) GetKeysWithPrefixFromChild(keyToChild, prefix []byte) ([][]byte, error)
- func (s *TrieState) Has(key []byte) bool
- func (s *TrieState) LoadCode() []byte
- func (s *TrieState) LoadCodeHash() (common.Hash, error)
- func (s *TrieState) MustRoot() common.Hash
- func (s *TrieState) NextKey(key []byte) []byte
- func (s *TrieState) RollbackStorageTransaction()
- func (s *TrieState) Root() (common.Hash, error)
- func (s *TrieState) Set(key, value []byte)
- func (s *TrieState) SetChild(keyToChild []byte, child *trie.Trie) error
- func (s *TrieState) SetChildStorage(keyToChild, key, value []byte) error
- func (s *TrieState) Snapshot() *trie.Trie
- 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) BeginStorageTransaction ¶
func (s *TrieState) BeginStorageTransaction()
BeginStorageTransaction begins a new nested storage transaction which will either be committed or rolled back at a later time.
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) ClearPrefixLimit ¶
ClearPrefixLimit deletes key-value pairs from the trie where the key starts with the given prefix till limit reached
func (*TrieState) CommitStorageTransaction ¶
func (s *TrieState) CommitStorageTransaction()
CommitStorageTransaction commits all storage changes made since BeginStorageTransaction was called.
func (*TrieState) DeleteChild ¶
DeleteChild deletes a child trie from the main trie
func (*TrieState) DeleteChildLimit ¶
DeleteChildLimit deletes up to limit of database entries by lexicographic order, return number
deleted, true if all delete otherwise false
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) GetDeletedNodeHashes ¶
GetDeletedNodeHashes returns the hash of nodes that were deleted from the state trie since the last block produced.
func (*TrieState) GetInsertedNodeHashes ¶
GetInsertedNodeHashes returns a set of hashes of all nodes that were inserted into state trie since the last block produced.
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) RollbackStorageTransaction ¶
func (s *TrieState) RollbackStorageTransaction()
RollbackStorageTransaction rolls back all storage changes made since BeginStorageTransaction was called.
func (*TrieState) SetChildStorage ¶
SetChildStorage sets a key-value pair in a child trie
func (*TrieState) Snapshot ¶
Snapshot creates a new "version" of the trie. The trie before Snapshot is called can no longer be modified, all further changes are on a new "version" of the trie. It returns the new version of the trie.
func (*TrieState) TrieEntries ¶
TrieEntries returns every key-value pair in the trie