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

Function test_neg

bitvm/src/bigint/sub.rs:165–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

163
164 #[test]
165 fn test_neg() {
166 println!("U254.neg: {} bytes", U254::neg().len());
167 let mut prng = ChaCha20Rng::seed_from_u64(0);
168
169 let a: BigUint = prng.sample(RandomBits::new(254));
170
171 let script = script! {
172 { U254::push_zero() }
173 { U254::push_u32_le(&a.to_u32_digits()) }
174 { U254::sub(1, 0) }
175 { U254::push_u32_le(&a.to_u32_digits()) }
176 { U254::neg() }
177 { U254::equalverify(1, 0) }
178 OP_TRUE
179 };
180 run(script);
181 }
182}

Callers

nothing calls this directly

Calls 1

runFunction · 0.85

Tested by

no test coverage detected