()
| 821 | |
| 822 | #[test] |
| 823 | fn test_read_from_stack() { |
| 824 | let _m = BigUint::from_str_radix(Fq::MODULUS, 16).unwrap(); |
| 825 | let mut prng = ChaCha20Rng::seed_from_u64(0); |
| 826 | let a: BigUint = prng.sample(RandomBits::new(254)); |
| 827 | |
| 828 | let script = script! { |
| 829 | { Fq::push_u32_le(&a.to_u32_digits()) } |
| 830 | }; |
| 831 | |
| 832 | let res = execute_script(script); |
| 833 | let witness = extract_witness_from_stack(res); |
| 834 | |
| 835 | let u32s = Fq::read_u32_le(witness); |
| 836 | let read_a = BigUint::from_slice(&u32s); |
| 837 | assert_eq!(read_a, a); |
| 838 | } |
| 839 | |
| 840 | #[test] |
| 841 | fn test_add() { |
nothing calls this directly
no test coverage detected