Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions crates/op-evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ use revm::{
Context, ExecuteEvm, InspectEvm, Inspector,
};
use revm_optimism::{
DefaultOp, OpBuilder, OpContext, OpHaltReason, OpSpecId, OpTransaction, OpTransactionError,
handler::precompiles::OpPrecompileProvider, DefaultOp, OpBuilder, OpContext, OpHaltReason, OpSpecId, OpTransaction, OpTransactionError
};

/// OP EVM implementation.
#[allow(missing_debug_implementations)] // missing revm::OpContext Debug impl
pub struct OpEvm<DB: Database, I> {
inner: revm_optimism::OpEvm<OpContext<DB>, I, EthInstructions<EthInterpreter, OpContext<DB>>>,
pub struct OpEvm<DB: Database, I, P = OpPrecompileProvider<OpContext<DB>>> {
inner: revm_optimism::OpEvm<OpContext<DB>, I, EthInstructions<EthInterpreter, OpContext<DB>>, P>,
inspect: bool,
}

Expand All @@ -47,6 +47,21 @@ impl<DB: Database, I> OpEvm<DB, I> {
}
}

impl<DB: Database, I, P> OpEvm<DB, I, P> {
/// Creates a new OP EVM instance.
pub const fn new(
evm: revm_optimism::OpEvm<
OpContext<DB>,
I,
EthInstructions<EthInterpreter, OpContext<DB>>,
P,
>,
inspect: bool,
) -> Self {
Self { inner: evm, inspect }
}
}

impl<DB: Database, I> Deref for OpEvm<DB, I> {
type Target = OpContext<DB>;

Expand Down
Loading