aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.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/proof.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/proof.go')
-rw-r--r--trie/proof.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/trie/proof.go b/trie/proof.go
index 06cf827ab..fb7734b86 100644
--- a/trie/proof.go
+++ b/trie/proof.go
@@ -38,7 +38,7 @@ import (
// absence of the key.
func (t *Trie) Prove(key []byte) []rlp.RawValue {
// Collect all nodes on the path to key.
- key = compactHexDecode(key)
+ key = keybytesToHex(key)
nodes := []node{}
tn := t.root
for len(key) > 0 && tn != nil {
@@ -89,7 +89,7 @@ func (t *Trie) Prove(key []byte) []rlp.RawValue {
// returns an error if the proof contains invalid trie nodes or the
// wrong value.
func VerifyProof(rootHash common.Hash, key []byte, proof []rlp.RawValue) (value []byte, err error) {
- key = compactHexDecode(key)
+ key = keybytesToHex(key)
sha := sha3.NewKeccak256()
wantHash := rootHash.Bytes()
for i, buf := range proof {