AddBatch use Virtual Tree for empty trees/subtrees

- AddBatch use Virtual Tree for cases A,B,C
- ImportDump use AddBatch instead of adding one by one
- Reorg & add more virtual tree tests
This commit is contained in:
2021-05-18 10:15:07 +02:00
parent 66f6ae14bb
commit 03bb9f7447
6 changed files with 336 additions and 91 deletions

View File

@@ -14,13 +14,13 @@ func TestAddTestVectors(t *testing.T) {
c := qt.New(t)
// Poseidon test vectors generated using https://github.com/iden3/circomlib smt.js
testVectorsPoseidon := []string{
"0000000000000000000000000000000000000000000000000000000000000000",
"13578938674299138072471463694055224830892726234048532520316387704878000008795",
"5412393676474193513566895793055462193090331607895808993925969873307089394741",
"14204494359367183802864593755198662203838502594566452929175967972147978322084",
}
testAdd(c, HashFunctionPoseidon, testVectorsPoseidon)
// testVectorsPoseidon := []string{
// "0000000000000000000000000000000000000000000000000000000000000000",
// "13578938674299138072471463694055224830892726234048532520316387704878000008795",
// "5412393676474193513566895793055462193090331607895808993925969873307089394741",
// "14204494359367183802864593755198662203838502594566452929175967972147978322084",
// }
// testAdd(c, HashFunctionPoseidon, testVectorsPoseidon)
testVectorsSha256 := []string{
"0000000000000000000000000000000000000000000000000000000000000000",