MCPcopy Index your code
hub / github.com/BitVM/BitVM / test_valid_bigint

Function test_valid_bigint

bitvm/src/bigint/std.rs:677–709  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

675
676 #[test]
677 fn test_valid_bigint() {
678 let invalid_bigint = (
679 script! {
680 {0} {0} {0} {0} {0} {0} {0} {0} {-1}
681 },
682 false,
683 );
684
685 let invalid_bigint2 = (
686 script! {
687 {1 << U256::HEAD} {0} {0} {0} {0} {0} {0} {0} {0}
688 },
689 false,
690 );
691
692 let valid_bigint = (
693 script! {
694 {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234}
695 },
696 true,
697 );
698
699 for (bigint, expected) in [invalid_bigint, invalid_bigint2, valid_bigint] {
700 let res = execute_script(script! {
701 {bigint.clone()}
702 { U256::is_valid_bigint() }
703 OP_TOALTSTACK
704 for _ in 0..9 { OP_DROP }
705 OP_FROMALTSTACK
706 });
707 assert_eq!(res.success, expected);
708 }
709 }
710
711 #[test]
712 fn test_zip() {

Callers

nothing calls this directly

Calls 1

execute_scriptFunction · 0.85

Tested by

no test coverage detected