Remove cropping on pow of two the kvs for AddBatch

- Remove cropping on power of two the kvs for AddBatch
  - As not needed to be power of two length with the Virtual Tree
- Fix keyValuesToKvs keyPath
This commit is contained in:
2021-05-19 12:58:11 +02:00
parent 03bb9f7447
commit 13378d338e
4 changed files with 27 additions and 62 deletions

View File

@@ -267,11 +267,11 @@ func TestGenProofAndVerify(t *testing.T) {
}
k := BigIntToBytes(big.NewInt(int64(7)))
_, siblings, err := tree.GenProof(k)
c.Assert(err, qt.IsNil)
k = BigIntToBytes(big.NewInt(int64(7)))
v := BigIntToBytes(big.NewInt(int64(14)))
proofV, siblings, err := tree.GenProof(k)
c.Assert(err, qt.IsNil)
c.Assert(proofV, qt.DeepEquals, v)
verif, err := CheckProof(tree.hashFunction, k, v, tree.Root(), siblings)
c.Assert(err, qt.IsNil)
c.Check(verif, qt.IsTrue)