mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
implement missing interface methods after rebase
This commit is contained in:
parent
93077a6838
commit
f93d68e778
1 changed files with 27 additions and 2 deletions
|
|
@ -241,7 +241,7 @@ func (t *BinaryTrie) Hash() common.Hash {
|
||||||
|
|
||||||
// Commit writes all nodes to the trie's memory database, tracking the internal
|
// Commit writes all nodes to the trie's memory database, tracking the internal
|
||||||
// and external (for account tries) references.
|
// and external (for account tries) references.
|
||||||
func (t *BinaryTrie) Commit(_ bool) (common.Hash, *trienode.NodeSet, error) {
|
func (t *BinaryTrie) Commit(_ bool) (common.Hash, *trienode.NodeSet) {
|
||||||
root := t.root.(*InternalNode)
|
root := t.root.(*InternalNode)
|
||||||
nodeset := trienode.NewNodeSet(common.Hash{})
|
nodeset := trienode.NewNodeSet(common.Hash{})
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ func (t *BinaryTrie) Commit(_ bool) (common.Hash, *trienode.NodeSet, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize root commitment form
|
// Serialize root commitment form
|
||||||
return t.Hash(), nodeset, nil
|
return t.Hash(), nodeset
|
||||||
}
|
}
|
||||||
|
|
||||||
// NodeIterator returns an iterator that returns nodes of the trie. Iteration
|
// NodeIterator returns an iterator that returns nodes of the trie. Iteration
|
||||||
|
|
@ -318,3 +318,28 @@ func (t *BinaryTrie) UpdateContractCode(addr common.Address, codeHash common.Has
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *BinaryTrie) PrefetchAccount(addresses []common.Address) error {
|
||||||
|
for _, addr := range addresses {
|
||||||
|
if _, err := t.GetAccount(addr); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// PrefetchStorage attempts to resolve specific storage slots from the database
|
||||||
|
// to accelerate subsequent trie operations.
|
||||||
|
func (t *BinaryTrie) PrefetchStorage(addr common.Address, keys [][]byte) error {
|
||||||
|
for _, key := range keys {
|
||||||
|
if _, err := t.GetStorage(addr, key); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Witness returns a set containing all trie nodes that have been accessed.
|
||||||
|
func (t *BinaryTrie) Witness() map[string][]byte {
|
||||||
|
panic("not implemented")
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue