Skip to content

Commit

Permalink
fix: resotre test, unused dep in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nhtyy committed Nov 14, 2024
1 parent db577e1 commit 3803e1d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
1 change: 0 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ regex = "1.5.4"
prettytable-rs = "0.10"
textwrap = "0.16.0"
ctrlc = "3.4.2"
gecko_profile = "0.4.0"
54 changes: 27 additions & 27 deletions examples/fibonacci/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ fn main() {
let (_, report) = client.execute(ELF, stdin.clone()).run().unwrap();
println!("executed program with {} cycles", report.total_instruction_count());

//// Generate the proof for the given program and input.
//let (pk, vk) = client.setup(ELF);
//let mut proof = client.prove(&pk, stdin).run().unwrap();
//
//println!("generated proof");
//
//// Read and verify the output.
////
//// Note that this output is read from values committed to in the program using
//// `sp1_zkvm::io::commit`.
//let _ = proof.public_values.read::<u32>();
//let a = proof.public_values.read::<u32>();
//let b = proof.public_values.read::<u32>();
//
//println!("a: {}", a);
//println!("b: {}", b);
//
//// Verify proof and public values
//client.verify(&proof, &vk).expect("verification failed");
//
//// Test a round trip of proof serialization and deserialization.
//proof.save("proof-with-pis.bin").expect("saving proof failed");
//let deserialized_proof =
// SP1ProofWithPublicValues::load("proof-with-pis.bin").expect("loading proof failed");
//
//// Verify the deserialized proof.
//client.verify(&deserialized_proof, &vk).expect("verification failed");
// Generate the proof for the given program and input.
let (pk, vk) = client.setup(ELF);
let mut proof = client.prove(&pk, stdin).run().unwrap();

println!("generated proof");

// Read and verify the output.
//
// Note that this output is read from values committed to in the program using
// `sp1_zkvm::io::commit`.
let _ = proof.public_values.read::<u32>();
let a = proof.public_values.read::<u32>();
let b = proof.public_values.read::<u32>();

println!("a: {}", a);
println!("b: {}", b);

// Verify proof and public values
client.verify(&proof, &vk).expect("verification failed");

// Test a round trip of proof serialization and deserialization.
proof.save("proof-with-pis.bin").expect("saving proof failed");
let deserialized_proof =
SP1ProofWithPublicValues::load("proof-with-pis.bin").expect("loading proof failed");

// Verify the deserialized proof.
client.verify(&deserialized_proof, &vk).expect("verification failed");

println!("successfully generated and verified proof for the program!")
}

0 comments on commit 3803e1d

Please sign in to comment.