From c7cfd5340bae47b88e215131f1dd34ae3ea06b5a Mon Sep 17 00:00:00 2001 From: Weikeng Chen Date: Fri, 31 May 2024 13:44:55 +0800 Subject: [PATCH] Fix the options for script execution (#25) * fix the options for script execution * remove a println! debug code --- src/fibonacci/mod.rs | 14 ++++++++++++++ src/fri/bitcoin_script.rs | 8 +++++--- src/lib.rs | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/fibonacci/mod.rs diff --git a/src/fibonacci/mod.rs b/src/fibonacci/mod.rs new file mode 100644 index 0000000..40cc445 --- /dev/null +++ b/src/fibonacci/mod.rs @@ -0,0 +1,14 @@ +#[cfg(test)] +mod test { + use stwo_prover::core::fields::m31::M31; + use stwo_prover::examples::fibonacci::Fibonacci; + + #[test] + fn test_fib_prove() { + const FIB_LOG_SIZE: u32 = 5; + let fib = Fibonacci::new(FIB_LOG_SIZE, M31::reduce(443693538)); + + let proof = fib.prove().unwrap(); + fib.verify(proof).unwrap(); + } +} diff --git a/src/fri/bitcoin_script.rs b/src/fri/bitcoin_script.rs index def6bbb..eab2cc0 100644 --- a/src/fri/bitcoin_script.rs +++ b/src/fri/bitcoin_script.rs @@ -376,8 +376,6 @@ mod test { println!("FRI.Twiddle-Tree = {} bytes", script.len()); let exec_result = execute_script(script); - println!("{:8}", exec_result.final_stack); - println!("{:?}", exec_result.error); assert!(exec_result.success); } @@ -707,7 +705,11 @@ mod test { verify_csv: true, verify_minimal_if: true, enforce_stack_limit: false, - experimental: Experimental { op_cat: true }, + experimental: Experimental { + op_cat: true, + op_mul: false, + op_div: false, + }, }, TxTemplate { tx: Transaction { diff --git a/src/lib.rs b/src/lib.rs index 0c6d74a..e7abdc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,6 +20,8 @@ pub mod circle; pub mod circle_secure; /// Module for constraints over the circle curve pub mod constraints; +/// Module for Fibonacci end-to-end test. +pub mod fibonacci; /// Module for FRI. pub mod fri; /// Module for the field and group arithmetics.