MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_split_padding

Function test_split_padding

bitvm/src/hash/sha256_u4.rs:580–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

578
579 #[test]
580 fn test_split_padding() {
581 for num_bytes in 0..150 {
582 let (padding_scripts, chunks) = double_padding(num_bytes);
583
584 let script = script! {
585 for _ in 0..num_bytes {
586 { 1 }
587 { 0 }
588 }
589 OP_DEPTH
590 OP_TOALTSTACK
591 for script in padding_scripts {
592 { script }
593 OP_DEPTH
594 OP_TOALTSTACK
595 }
596 { u4_drop(chunks*128) }
597 OP_DEPTH
598 OP_TOALTSTACK
599 OP_TRUE
600 };
601
602 let res = execute_script(script);
603 assert!(res.success);
604 }
605 }
606
607 #[test]
608 fn test_genesis_block() {

Callers

nothing calls this directly

Calls 2

execute_scriptFunction · 0.85
double_paddingFunction · 0.70

Tested by

no test coverage detected