mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix ProofTracer interface (#666)
* fix `TestProofWithDeletion` * fix `ProofTracer` interface
This commit is contained in:
parent
521183581a
commit
2829e66aea
2 changed files with 6 additions and 5 deletions
|
|
@ -220,7 +220,7 @@ func TestProofWithDeletion(t *testing.T) {
|
|||
|
||||
proofTracer := tr.NewProofTracer()
|
||||
|
||||
err = proofTracer.Prove(s_key1.Bytes(), 0, proof)
|
||||
err = proofTracer.Prove(s_key1.Bytes(), proof)
|
||||
assert.NoError(t, err)
|
||||
nd, err := tr.TryGet(key2)
|
||||
assert.NoError(t, err)
|
||||
|
|
@ -228,7 +228,7 @@ func TestProofWithDeletion(t *testing.T) {
|
|||
s_key2, err := zkt.ToSecureKeyBytes(bytes.Repeat([]byte("x"), 32))
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = proofTracer.Prove(s_key2.Bytes(), 0, proof)
|
||||
err = proofTracer.Prove(s_key2.Bytes(), proof)
|
||||
assert.NoError(t, err)
|
||||
//assert.Equal(t, len(sibling1), len(delTracer.GetProofs()))
|
||||
|
||||
|
|
@ -260,9 +260,9 @@ func TestProofWithDeletion(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
proofTracer = tr.NewProofTracer()
|
||||
err = proofTracer.Prove(s_key1.Bytes(), 0, proof)
|
||||
err = proofTracer.Prove(s_key1.Bytes(), proof)
|
||||
assert.NoError(t, err)
|
||||
err = proofTracer.Prove(s_key2.Bytes(), 0, proof)
|
||||
err = proofTracer.Prove(s_key2.Bytes(), proof)
|
||||
assert.NoError(t, err)
|
||||
|
||||
proofTracer.MarkDeletion(s_key1.Bytes())
|
||||
|
|
|
|||
|
|
@ -137,7 +137,8 @@ func (t *ProofTracer) MarkDeletion(key []byte) {
|
|||
|
||||
// Prove act the same as zktrie.Prove, while also collect the raw path
|
||||
// for collecting deletion proofs in a post-work
|
||||
func (t *ProofTracer) Prove(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) error {
|
||||
func (t *ProofTracer) Prove(key []byte, proofDb ethdb.KeyValueWriter) error {
|
||||
fromLevel := uint(0)
|
||||
var mptPath []*zktrie.Node
|
||||
err := t.ZkTrie.ProveWithDeletion(key, fromLevel,
|
||||
func(n *zktrie.Node) error {
|
||||
|
|
|
|||
Loading…
Reference in a new issue