File tree 1 file changed +16
-0
lines changed
twenty-first/src/util_types/mmr
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,22 @@ mod tests {
418
418
}
419
419
}
420
420
421
+ #[ test]
422
+ fn auth_struct_on_empty_mmr ( ) {
423
+ let empty_mmra = MmrAccumulator :: init ( vec ! [ ] , 0 ) ;
424
+ let authenticated_auth_structs =
425
+ AuthStructIntegrityProof :: new_from_mmr_membership_proofs ( & empty_mmra, vec ! [ ] ) ;
426
+ assert ! ( authenticated_auth_structs. is_empty( ) ) ;
427
+ }
428
+
429
+ #[ test]
430
+ fn auth_struct_non_empty_mmr_empty_leaf_list ( ) {
431
+ let mmra_10_leafs = MmrAccumulator :: new_from_leafs ( vec ! [ Digest :: default ( ) ; 10 ] ) ;
432
+ let authenticated_auth_structs =
433
+ AuthStructIntegrityProof :: new_from_mmr_membership_proofs ( & mmra_10_leafs, vec ! [ ] ) ;
434
+ assert ! ( authenticated_auth_structs. is_empty( ) ) ;
435
+ }
436
+
421
437
#[ test]
422
438
fn auth_struct_from_mmr_mps_test_height_5_9_indices ( ) {
423
439
let local_tree_height = 5 ;
You can’t perform that action at this time.
0 commit comments