Skip to content

Commit

Permalink
Explicitly specify mainnet env for evm (#1447)
Browse files Browse the repository at this point in the history
* fix the evm usage for test contract

Signed-off-by: noelwei <[email protected]>

* more fixs

Signed-off-by: noelwei <[email protected]>

---------

Signed-off-by: noelwei <[email protected]>
  • Loading branch information
noel2004 authored Nov 21, 2024
1 parent 7fd6b6d commit de04c66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prover/src/utils/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use halo2_proofs::{
poly::kzg::commitment::ParamsKZG,
};
use revm::{
primitives::{Env, ExecutionResult, Output, SpecId, TxEnv, TxKind},
Evm, InMemoryDB,
primitives::{self, Env, ExecutionResult, Output, TxEnv, TxKind},
Evm, Handler, InMemoryDB,
};

use snark_verifier::pcs::kzg::{Bdfg21, Kzg};
Expand Down Expand Up @@ -63,9 +63,9 @@ pub fn deploy_and_call(deployment_code: Vec<u8>, calldata: Vec<u8>) -> Result<u6
};
let mut db = InMemoryDB::default();
let mut evm = Evm::builder()
.with_spec_id(SpecId::CANCUN)
.with_db(&mut db)
.with_env(env.clone())
.with_handler(Handler::mainnet::<primitives::CancunSpec>())
.build();
let result = evm.transact_commit().unwrap();
let contract = match result {
Expand Down Expand Up @@ -94,9 +94,9 @@ pub fn deploy_and_call(deployment_code: Vec<u8>, calldata: Vec<u8>) -> Result<u6
..Default::default()
};
let mut evm = Evm::builder()
.with_spec_id(SpecId::CANCUN)
.with_db(&mut db)
.with_env(env)
.with_env(env.clone())
.with_handler(Handler::mainnet::<primitives::CancunSpec>())
.build();
let result = evm.transact_commit().unwrap();
match result {
Expand Down

0 comments on commit de04c66

Please sign in to comment.