mirror of https://github.com/vacp2p/pmtree.git
test: add tests for proof & verify API
This commit is contained in:
parent
ef4d821d3c
commit
ccb66c61fb
|
@ -91,6 +91,10 @@ fn insert_delete() -> Result<()> {
|
|||
assert_eq!(mt.root(), MyFr(roots[i]));
|
||||
}
|
||||
|
||||
for (i, &leaf) in leaves.iter().enumerate() {
|
||||
assert!(mt.verify(&MyFr(leaf), &mt.proof(i)?));
|
||||
}
|
||||
|
||||
for i in (0..leaves.len()).rev() {
|
||||
mt.delete(i)?;
|
||||
}
|
||||
|
|
|
@ -106,6 +106,10 @@ fn insert_delete() -> Result<()> {
|
|||
assert_eq!(mt.root(), MyFr(roots[i]));
|
||||
}
|
||||
|
||||
for (i, &leaf) in leaves.iter().enumerate() {
|
||||
assert!(mt.verify(&MyFr(leaf), &mt.proof(i)?));
|
||||
}
|
||||
|
||||
for i in (0..leaves.len()).rev() {
|
||||
mt.delete(i)?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue