runtime/smt: return early with SUCCESS (but give a warning) if the nullifiers list for changing the tree is empty.

This commit is contained in:
zero
2024-03-19 10:26:01 +01:00
parent 309157e0ba
commit fd1d154b15
2 changed files with 11 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ fn zkvm_smt() -> Result<()> {
// Use the leaf value as its position in the SMT
// Therefore we need an additional constraint that leaf == pos
let leaves: Vec<_> = leaves.into_iter().map(|l| (l, l)).collect();
smt.insert_batch(leaves.clone());
smt.insert_batch(leaves.clone()).unwrap();
let (pos, leaf) = leaves[2];
assert_eq!(pos, leaf);