Skip to content

Commit

Permalink
Internal: use an implementation of Fibonacci without hints for tests (#…
Browse files Browse the repository at this point in the history
…20)

Problem: The Fibonacci implementation we use for most tests uses a hint
that is not implemented. This prevents from running execute + prove
tests on this test case.

Solution: use an implementation that does not use a hint.
  • Loading branch information
Olivier Desenfans authored Nov 27, 2023
1 parent 363dec9 commit 4340fb6
Show file tree
Hide file tree
Showing 15 changed files with 442 additions and 1,330 deletions.
2 changes: 1 addition & 1 deletion integration-tests/tests/test_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod tests {
async fn test_execute(#[future] rpc_client_server: (RpcClient, RpcServer)) {
let (mut client, _server) = rpc_client_server.await;

let program_path = get_test_case_file_path("fibonacci-no-hint/fibonacci_compiled.json");
let program_path = get_test_case_file_path("fibonacci/fibonacci_compiled.json");
let program_content = std::fs::read(program_path).unwrap();

let result = execute_program(&mut client, program_content).await;
Expand Down
12 changes: 8 additions & 4 deletions madara-prover-common/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub struct PrivateInput {
pub pedersen: Vec<u32>,
pub range_check: Vec<u32>,
pub ecdsa: Vec<u32>,
pub bitwise: Vec<u32>,
pub ec_op: Vec<u32>,
pub keccak: Vec<u32>,
pub poseidon: Vec<u32>,
}

#[derive(Serialize, Deserialize, Eq, PartialEq, Debug)]
Expand Down Expand Up @@ -141,11 +145,11 @@ mod tests {

assert_eq!(
private_input.memory_path,
Path::new("/home/root/fibonacci_memory.json")
Path::new("/home/root/fibonacci_memory.bin")
);
assert_eq!(
private_input.trace_path,
Path::new("/home/root/fibonacci_trace.json")
Path::new("/home/root/fibonacci_trace.bin")
);
assert_eq!(private_input.pedersen, Vec::<u32>::new());
assert_eq!(private_input.range_check, Vec::<u32>::new());
Expand All @@ -160,8 +164,8 @@ mod tests {
.expect("Failed to deserialize public input fixture");

// We don't check all fields, just ensure that we can deserialize the fixture
assert_eq!(public_input.layout, Layout::Small);
assert_eq!(public_input.n_steps, 512);
assert_eq!(public_input.layout, Layout::StarknetWithKeccak);
assert_eq!(public_input.n_steps, 32768);
assert_eq!(public_input.dynamic_params, None);
}

Expand Down
4 changes: 4 additions & 0 deletions stone-prover/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ fn prepare_prover_files(
pedersen: vec![],
range_check: vec![],
ecdsa: vec![],
bitwise: vec![],
ec_op: vec![],
keccak: vec![],
poseidon: vec![],
};

write_json_to_file(private_input, &private_input_file)?;
Expand Down
18 changes: 0 additions & 18 deletions test-cases/cases/fibonacci-no-hint/fibonacci.cairo

This file was deleted.

Loading

0 comments on commit 4340fb6

Please sign in to comment.