Skip to content

Commit

Permalink
fix op
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Feb 7, 2025
1 parent 4b8c055 commit 4f5049a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 5 additions & 1 deletion crates/evm/src/eth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//! Ethereum EVM implementation.
use crate::{env::EvmEnv, evm::{Database, EvmFactory}, Evm};
use crate::{
env::EvmEnv,
evm::{Database, EvmFactory},
Evm,
};
use alloc::vec::Vec;
use alloy_primitives::{Address, Bytes, TxKind, U256};
use core::fmt::Debug;
Expand Down
10 changes: 7 additions & 3 deletions crates/evm/src/evm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Abstraction over EVM.
use core::error::Error;
use alloy_primitives::{Address, Bytes};
use core::error::Error;
use revm::{
primitives::{BlockEnv, ResultAndState},
DatabaseCommit, GetInspector,
Expand Down Expand Up @@ -32,7 +32,6 @@ pub trait Evm {
/// running out of gas or overflowing stack).
type HaltReason: Send + Sync;


/// Reference to [`BlockEnv`].
fn block(&self) -> &BlockEnv;

Expand Down Expand Up @@ -67,7 +66,12 @@ pub trait EvmFactory<Input> {
/// The EVM type that this factory creates.
// TODO: this doesn't quite work because this would force use to use an enum approach for trace
// evm for example, unless we
type Evm<'a, DB: Database + 'a, I: 'a>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<DB::Error>>;
type Evm<'a, DB: Database + 'a, I: 'a>: Evm<
DB = DB,
Tx = Self::Tx,
HaltReason = Self::HaltReason,
Error = Self::Error<DB::Error>,
>;

/// Transaction environment.
type Tx;
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ pub use eth::{EthEvm, EthEvmFactory};
pub mod env;
pub use env::EvmEnv;
pub mod error;
pub use error::*;
pub use error::*;
4 changes: 2 additions & 2 deletions crates/op-evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl EvmFactory<EvmEnv> for OpEvmFactory {
fn create_evm<'a, DB: Database + 'a>(&self, db: DB, input: EvmEnv) -> Self::Evm<'a, DB, ()> {
let cfg_env_with_handler_cfg = CfgEnvWithHandlerCfg {
cfg_env: input.cfg_env,
handler_cfg: HandlerCfg::new(input.spec),
handler_cfg: HandlerCfg { spec_id: input.spec, is_optimism: true },
};
OpEvm(
revm::Evm::builder()
Expand All @@ -137,7 +137,7 @@ impl EvmFactory<EvmEnv> for OpEvmFactory {
) -> Self::Evm<'a, DB, I> {
let cfg_env_with_handler_cfg = CfgEnvWithHandlerCfg {
cfg_env: input.cfg_env,
handler_cfg: HandlerCfg::new(input.spec),
handler_cfg: HandlerCfg { spec_id: input.spec, is_optimism: true },
};
revm::Evm::builder()
.with_db(db)
Expand Down

0 comments on commit 4f5049a

Please sign in to comment.