Update VT goroutines errs & Update Pack&UnpackSibl

- Update VT goroutines errs to avoid race condition
- Update pack & unpack siblings to use 2-byte for full length & bitmap
bytes length
- Add check in UnpackSiblings to avoid panic
This commit is contained in:
2021-09-20 18:09:32 +02:00
parent f09b0b0392
commit ed0cf70d57
4 changed files with 25 additions and 17 deletions

View File

@@ -311,7 +311,7 @@ func TestGenProofAndVerify(t *testing.T) {
c.Assert(err, qt.IsNil)
defer tree.db.Close() //nolint:errcheck
bLen := tree.HashFunction().Len()
bLen := tree.HashFunction().Len() - 1
for i := 0; i < 10; i++ {
k := BigIntToBytes(bLen, big.NewInt(int64(i)))
v := BigIntToBytes(bLen, big.NewInt(int64(i*2)))