aboutsummaryrefslogtreecommitdiffstats
path: root/trie/proof.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-09-24 20:57:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-03-06 19:35:03 +0800
commit054412e33528e53f6deae940c870217b614707b9 (patch)
tree7ffc999bb39384e1bfa8c71d80923879fc2e866b /trie/proof.go
parent15eee47ebf878b4eff3c2359b9eaa57bba397448 (diff)
downloadgo-tangerine-054412e33528e53f6deae940c870217b614707b9.tar
go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.gz
go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.bz2
go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.lz
go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.xz
go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.zst
go-tangerine-054412e33528e53f6deae940c870217b614707b9.zip
all: clean up and proerly abstract database access
Diffstat (limited to 'trie/proof.go')
-rw-r--r--trie/proof.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/trie/proof.go b/trie/proof.go
index 1334bde97..0f18dd26b 100644
--- a/trie/proof.go
+++ b/trie/proof.go
@@ -34,7 +34,7 @@ import (
// If the trie does not contain a value for key, the returned proof contains all
// nodes of the longest existing prefix of the key (at least the root node), ending
// with the node that proves the absence of the key.
-func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error {
+func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Writer) error {
// Collect all nodes on the path to key.
key = keybytesToHex(key)
var nodes []node
@@ -97,14 +97,14 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error {
// If the trie does not contain a value for key, the returned proof contains all
// nodes of the longest existing prefix of the key (at least the root node), ending
// with the node that proves the absence of the key.
-func (t *SecureTrie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error {
+func (t *SecureTrie) Prove(key []byte, fromLevel uint, proofDb ethdb.Writer) error {
return t.trie.Prove(key, fromLevel, proofDb)
}
// VerifyProof checks merkle proofs. The given proof must contain the value for
// key in a trie with the given root hash. VerifyProof returns an error if the
// proof contains invalid trie nodes or the wrong value.
-func VerifyProof(rootHash common.Hash, key []byte, proofDb DatabaseReader) (value []byte, nodes int, err error) {
+func VerifyProof(rootHash common.Hash, key []byte, proofDb ethdb.Reader) (value []byte, nodes int, err error) {
key = keybytesToHex(key)
wantHash := rootHash
for i := 0; ; i++ {