Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 6 additions & 3 deletions rust/alloy-op-evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ use core::{
ops::{Deref, DerefMut},
};
use op_revm::{
DefaultOp, OpBuilder, OpContext, OpHaltReason, OpSpecId, OpTransaction,
DefaultOp, L1BlockInfo, OpBuilder, OpContext, OpHaltReason, OpSpecId, OpTransaction,
precompiles::OpPrecompiles,
};
use revm::{
Context, ExecuteEvm, InspectEvm, Inspector, SystemCallEvm,
context::{BlockEnv, TxEnv},
Context, ExecuteEvm, InspectEvm, Inspector, Journal, SystemCallEvm,
context::{BlockEnv, CfgEnv, TxEnv},
context_interface::result::{EVMError, ResultAndState},
handler::{PrecompileProvider, instructions::EthInstructions},
inspector::NoOpInspector,
Expand All @@ -45,6 +45,9 @@ pub use tx::OpTx;
pub mod block;
pub use block::{OpBlockExecutionCtx, OpBlockExecutor, OpBlockExecutorFactory};

/// The OP EVM context type.
pub type OpEvmContext<DB> = Context<BlockEnv, OpTx, CfgEnv<OpSpecId>, DB, Journal<DB>, L1BlockInfo>;

/// OP EVM implementation.
///
/// This is a wrapper type around the `revm` evm with optional [`Inspector`] (tracing)
Expand Down
18 changes: 18 additions & 0 deletions rust/alloy-op-evm/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ impl revm::context::Transaction for OpTx {
}
}

impl op_revm::transaction::OpTxTr for OpTx {
fn enveloped_tx(&self) -> Option<&Bytes> {
self.0.enveloped_tx()
}

fn source_hash(&self) -> Option<B256> {
self.0.source_hash()
}

fn mint(&self) -> Option<u128> {
self.0.mint()
}

fn is_system_transaction(&self) -> bool {
self.0.is_system_transaction()
}
}

impl FromRecoveredTx<OpTxEnvelope> for OpTx {
fn from_recovered_tx(tx: &OpTxEnvelope, sender: Address) -> Self {
let encoded = tx.encoded_2718();
Expand Down
Loading