aboutsummaryrefslogtreecommitdiffstats
path: root/trie/iterator.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-04-18 19:25:07 +0800
committerFelix Lange <fjl@twurst.com>2017-04-25 08:14:31 +0800
commitf958d7d4822d257598ae36fc3b381040faa5bb30 (patch)
tree332291db0e8e1e7a41699aad291e5f13f35e6385 /trie/iterator.go
parenta31d268b76ff13df8e7d060163a842b8ed569793 (diff)
downloaddexon-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.gz
dexon-f958d7d4822d257598ae36fc3b381040faa5bb30.tar.zst
dexon-f958d7d4822d257598ae36fc3b381040faa5bb30.zip
trie: rework and document key encoding
'encode' and 'decode' are meaningless because the code deals with three encodings. Document the encodings and give a name to each one.
Diffstat (limited to 'trie/iterator.go')
-rw-r--r--trie/iterator.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/trie/iterator.go b/trie/iterator.go
index 42149a7d3..dd63a0c5a 100644
--- a/trie/iterator.go
+++ b/trie/iterator.go
@@ -19,6 +19,7 @@ package trie
import (
"bytes"
"container/heap"
+
"github.com/ethereum/go-ethereum/common"
)
@@ -48,7 +49,7 @@ func NewIteratorFromNodeIterator(it NodeIterator) *Iterator {
func (it *Iterator) Next() bool {
for it.nodeIt.Next(true) {
if it.nodeIt.Leaf() {
- it.Key = decodeCompact(it.nodeIt.Path())
+ it.Key = hexToKeybytes(it.nodeIt.Path())
it.Value = it.nodeIt.LeafBlob()
return true
}