Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit de04c66

Browse files
authored
Explicitly specify mainnet env for evm (#1447)
* 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]>
1 parent 7fd6b6d commit de04c66

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

prover/src/utils/evm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use halo2_proofs::{
66
poly::kzg::commitment::ParamsKZG,
77
};
88
use revm::{
9-
primitives::{Env, ExecutionResult, Output, SpecId, TxEnv, TxKind},
10-
Evm, InMemoryDB,
9+
primitives::{self, Env, ExecutionResult, Output, TxEnv, TxKind},
10+
Evm, Handler, InMemoryDB,
1111
};
1212

1313
use snark_verifier::pcs::kzg::{Bdfg21, Kzg};
@@ -63,9 +63,9 @@ pub fn deploy_and_call(deployment_code: Vec<u8>, calldata: Vec<u8>) -> Result<u6
6363
};
6464
let mut db = InMemoryDB::default();
6565
let mut evm = Evm::builder()
66-
.with_spec_id(SpecId::CANCUN)
6766
.with_db(&mut db)
6867
.with_env(env.clone())
68+
.with_handler(Handler::mainnet::<primitives::CancunSpec>())
6969
.build();
7070
let result = evm.transact_commit().unwrap();
7171
let contract = match result {
@@ -94,9 +94,9 @@ pub fn deploy_and_call(deployment_code: Vec<u8>, calldata: Vec<u8>) -> Result<u6
9494
..Default::default()
9595
};
9696
let mut evm = Evm::builder()
97-
.with_spec_id(SpecId::CANCUN)
9897
.with_db(&mut db)
99-
.with_env(env)
98+
.with_env(env.clone())
99+
.with_handler(Handler::mainnet::<primitives::CancunSpec>())
100100
.build();
101101
let result = evm.transact_commit().unwrap();
102102
match result {

0 commit comments

Comments
 (0)