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

Function test_script

bitvm/src/signatures/winternitz.rs:755–781  ·  view source on GitHub ↗
(
        ps: &Parameters,
        standard_script: Script,
        message_checker: Script,
        desired_outcome: bool,
    )

Source from the content-addressed store, hash-verified

753 }
754
755 fn test_script(
756 ps: &Parameters,
757 standard_script: Script,
758 message_checker: Script,
759 desired_outcome: bool,
760 ) {
761 println!(
762 "Winternitz signature size:\n \t{:?} bytes / {:?} bits \n\t{:?} bytes / bit\n",
763 standard_script.len(),
764 ps.message_digit_len * ps.log2_base,
765 standard_script.len() as f64 / (ps.message_digit_len * ps.log2_base) as f64
766 );
767 if desired_outcome == true {
768 assert!(
769 execute_script(standard_script.push_script(message_checker.clone().compile()))
770 .success
771 == true
772 );
773 } else {
774 assert!(
775 execute_script(standard_script.clone()).success == false
776 || execute_script(standard_script.push_script(message_checker.compile()))
777 .success
778 == true
779 );
780 }
781 }
782
783 fn run_winternitz_test<VERIFIER: Verifier, CONVERTER: Converter>(
784 ps: &Parameters,

Callers 1

run_winternitz_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected