Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trie: readonly interface for trie iterator's resolver #24221

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions trie/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ type NodeIterator interface {
// Before adding a similar mechanism to any other place in Geth, consider
// making trie.Database an interface and wrapping at that level. It's a huge
// refactor, but it could be worth it if another occurrence arises.
AddResolver(ethdb.KeyValueStore)
AddResolver(ethdb.KeyValueReader)
}

// nodeIteratorState represents the iteration state at one particular node of the
Expand All @@ -134,7 +134,7 @@ type nodeIterator struct {
path []byte // Path to the current node
err error // Failure set in case of an internal error in the iterator

resolver ethdb.KeyValueStore // Optional intermediate resolver above the disk layer
resolver ethdb.KeyValueReader // Optional intermediate resolver above the disk layer
}

// errIteratorEnd is stored in nodeIterator.err when iteration is done.
Expand All @@ -159,7 +159,7 @@ func newNodeIterator(trie *Trie, start []byte) NodeIterator {
return it
}

func (it *nodeIterator) AddResolver(resolver ethdb.KeyValueStore) {
func (it *nodeIterator) AddResolver(resolver ethdb.KeyValueReader) {
it.resolver = resolver
}

Expand Down Expand Up @@ -549,7 +549,7 @@ func (it *differenceIterator) Path() []byte {
return it.b.Path()
}

func (it *differenceIterator) AddResolver(resolver ethdb.KeyValueStore) {
func (it *differenceIterator) AddResolver(resolver ethdb.KeyValueReader) {
panic("not implemented")
}

Expand Down Expand Up @@ -660,7 +660,7 @@ func (it *unionIterator) Path() []byte {
return (*it.items)[0].Path()
}

func (it *unionIterator) AddResolver(resolver ethdb.KeyValueStore) {
func (it *unionIterator) AddResolver(resolver ethdb.KeyValueReader) {
panic("not implemented")
}

Expand Down