Documentation ¶
Index ¶
- type TrieState
- func (t *TrieState) ClearChildStorage(keyToChild, key []byte) error
- func (t *TrieState) ClearPrefix(prefix []byte) (err error)
- func (t *TrieState) ClearPrefixInChild(keyToChild, prefix []byte) error
- func (t *TrieState) ClearPrefixInChildWithLimit(keyToChild, prefix []byte, limit uint32) (uint32, bool, error)
- func (t *TrieState) ClearPrefixLimit(prefix []byte, limit uint32) (deleted uint32, allDeleted bool, err error)
- func (t *TrieState) CommitTransaction()
- func (t *TrieState) Delete(key []byte) (err error)
- func (t *TrieState) DeleteChild(key []byte) (err error)
- func (t *TrieState) DeleteChildLimit(key []byte, limit *[]byte) (deleted uint32, allDeleted bool, err error)
- func (t *TrieState) Get(key []byte) []byte
- func (t *TrieState) GetChangedNodeHashes() (inserted, deleted map[common.Hash]struct{}, err error)
- func (t *TrieState) GetChild(keyToChild []byte) (*trie.Trie, error)
- func (t *TrieState) GetChildNextKey(keyToChild, key []byte) ([]byte, error)
- func (t *TrieState) GetChildStorage(keyToChild, key []byte) ([]byte, error)
- func (t *TrieState) GetKeysWithPrefixFromChild(keyToChild, prefix []byte) ([][]byte, error)
- func (t *TrieState) Has(key []byte) bool
- func (t *TrieState) LoadCode() []byte
- func (t *TrieState) LoadCodeHash() (common.Hash, error)
- func (t *TrieState) MustRoot() common.Hash
- func (t *TrieState) NextKey(key []byte) []byte
- func (t *TrieState) Put(key, value []byte) (err error)
- func (t *TrieState) RollbackTransaction()
- func (t *TrieState) Root() (common.Hash, error)
- func (t *TrieState) SetChild(keyToChild []byte, child *trie.Trie) error
- func (t *TrieState) SetChildStorage(keyToChild, key, value []byte) error
- func (t *TrieState) SetVersion(v trie.TrieLayout)
- func (t *TrieState) Snapshot() *trie.Trie
- func (t *TrieState) StartTransaction()
- func (t *TrieState) Trie() *trie.Trie
- func (t *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 ¶
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) ClearPrefixInChildWithLimit ¶ added in v0.8.0
func (*TrieState) ClearPrefixLimit ¶ added in v0.7.0
func (t *TrieState) ClearPrefixLimit(prefix []byte, limit uint32) ( deleted uint32, allDeleted bool, err error)
ClearPrefixLimit deletes key-value pairs from the trie where the key starts with the given prefix till limit reached
func (*TrieState) CommitTransaction ¶ added in v0.9.0
func (t *TrieState) CommitTransaction()
Commit commits all storage changes made since StartTransaction was called.
func (*TrieState) DeleteChild ¶ added in v0.3.1
DeleteChild deletes a child trie from the main trie
func (*TrieState) DeleteChildLimit ¶ added in v0.7.0
func (t *TrieState) DeleteChildLimit(key []byte, limit *[]byte) ( deleted uint32, allDeleted bool, err error)
DeleteChildLimit deletes up to limit of database entries by lexicographic order.
func (*TrieState) GetChangedNodeHashes ¶ added in v0.7.0
GetChangedNodeHashes returns the two sets of hashes for all nodes inserted and deleted in the state trie since the last block produced (trie snapshot).
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) RollbackTransaction ¶ added in v0.9.0
func (t *TrieState) RollbackTransaction()
Rollback rolls back all storage changes made since StartTransaction was called.
func (*TrieState) SetChildStorage ¶
SetChildStorage sets a key-value pair in a child trie
func (*TrieState) SetVersion ¶ added in v0.9.0
func (t *TrieState) SetVersion(v trie.TrieLayout)
func (*TrieState) Snapshot ¶ added in v0.3.1
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) StartTransaction ¶ added in v0.9.0
func (t *TrieState) StartTransaction()
StartTransaction begins a new nested storage transaction which will either be committed or rolled back at a later time.
func (*TrieState) TrieEntries ¶
TrieEntries returns every key-value pair in the trie