Skip to content

Commit

Permalink
merkle_test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjit-bhat committed Dec 2, 2024
1 parent 0d31377 commit 8075b4f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions merkle/merkle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
)

func PutCheck(t *testing.T, tr *Tree, label []byte, val []byte) {
digest, proof, err := tr.Put(label, val)
dig, proof, err := tr.Put(label, val)
if err {
t.Fatal()
}
err = CheckProof(MembProofTy, proof, label, val, digest)
err = CheckProof(MembProofTy, proof, label, val, dig)
if err {
t.Fatal()
}
Expand Down Expand Up @@ -131,16 +131,16 @@ func TestAttackPutNilEmptyNode(t *testing.T) {
label1[cryptoffi.HashLen-1] = 1

tr := NewTree()
digest0, proof0, err := tr.Put(label0, nil)
dig0, proof0, err := tr.Put(label0, nil)
if err {
t.Fatal()
}
err = CheckProof(MembProofTy, proof0, label0, nil, digest0)
err = CheckProof(MembProofTy, proof0, label0, nil, dig0)
if err {
t.Fatal()
}

err = CheckProof(MembProofTy, proof0, label1, nil, digest0)
err = CheckProof(MembProofTy, proof0, label1, nil, dig0)
if !err {
t.Fatal()
}
Expand Down

0 comments on commit 8075b4f

Please sign in to comment.