Skip to content

Commit dc85d2b

Browse files
committed
Add unit test for Params::into_compact
1 parent 64ca109 commit dc85d2b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/dynafed.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,20 @@ mod tests {
529529
"113160f76dc17fe367a2def79aefe06feeea9c795310c9e88aeedc23e145982e"
530530
);
531531
}
532+
533+
#[test]
534+
fn into_compact_test() {
535+
let full = Params::Full {
536+
signblockscript: vec![0x01, 0x02].into(),
537+
signblock_witness_limit: 3,
538+
fedpeg_program: vec![0x04, 0x05].into(),
539+
fedpegscript: vec![0x06, 0x07],
540+
extension_space: vec![vec![0x08, 0x09], vec![0x0a]],
541+
};
542+
let extra_root = full.extra_root();
543+
544+
let compact = full.into_compact().unwrap();
545+
assert_eq!(compact.elided_root(), Some(&extra_root));
546+
assert_eq!(compact.extra_root(), extra_root);
547+
}
532548
}

0 commit comments

Comments
 (0)