Skip to content

Commit

Permalink
[Feat] A new unittest for evm verifier (#332)
Browse files Browse the repository at this point in the history
induce new evm verifier test

Co-authored-by: Rohit Narurkar <[email protected]>
  • Loading branch information
noel2004 and roynalnaruto authored Jul 22, 2024
1 parent 6c90372 commit d9a796e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions integration/tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,36 @@ fn test_evm_verifier() {
}
}

// suppose a "proof.json" has been provided under the 'release'
// directory or the test would fail
#[ignore]
#[test]
fn test_evm_verifier_for_dumped_proof() {
use prover::{io::from_json_file, proof::BundleProof};

init_env_and_log("test_evm_verifer");
log::info!("cwd {:?}", std::env::current_dir());
let version = "release-v0.12.0-rc.2";

let proof: BundleProof = from_json_file(&format!("../{version}/proof.json")).unwrap();

let proof_dump = proof.clone().proof_to_verify();
log::info!("pi dump {:#?}", proof_dump.instances());

let proof = proof.calldata();
log::info!("calldata len {}", proof.len());

log::info!("check released bin");
let bytecode = read_all(&format!("../{version}/evm_verifier.bin"));
log::info!("bytecode len {}", bytecode.len());
match integration::evm::deploy_and_call(bytecode, proof.clone()) {
Ok(gas) => log::info!("gas cost {gas}"),
Err(e) => {
panic!("test failed {e:#?}");
}
}
}

#[test]
fn test_capacity_checker() {
init_env_and_log("integration");
Expand Down

0 comments on commit d9a796e

Please sign in to comment.