feat: abstract RPC error over HaltReason (#14104)

This commit is contained in:
Arsenii Kulikov
2025-01-31 00:51:01 +04:00
committed by GitHub
parent 590b58f978
commit 28f2690e04
10 changed files with 76 additions and 54 deletions

View File

@ -40,8 +40,8 @@ pub use receipts::*;
mod error;
pub use error::OpBlockExecutionError;
use revm_primitives::{
BlobExcessGasAndPrice, BlockEnv, Bytes, CfgEnv, EVMError, HandlerCfg, OptimismFields,
ResultAndState, SpecId, TxKind,
BlobExcessGasAndPrice, BlockEnv, Bytes, CfgEnv, EVMError, HaltReason, HandlerCfg,
OptimismFields, ResultAndState, SpecId, TxKind,
};
/// OP EVM implementation.
@ -53,6 +53,7 @@ impl<EXT, DB: Database> Evm for OpEvm<'_, EXT, DB> {
type DB = DB;
type Tx = TxEnv;
type Error = EVMError<DB::Error>;
type HaltReason = HaltReason;
fn block(&self) -> &BlockEnv {
self.0.block()
@ -225,6 +226,7 @@ impl ConfigureEvmEnv for OpEvmConfig {
impl ConfigureEvm for OpEvmConfig {
type Evm<'a, DB: Database + 'a, I: 'a> = OpEvm<'a, I, DB>;
type EvmError<DBError: core::error::Error + Send + Sync + 'static> = EVMError<DBError>;
type HaltReason = HaltReason;
fn evm_with_env<DB: Database>(&self, db: DB, evm_env: EvmEnv) -> Self::Evm<'_, DB, ()> {
let cfg_env_with_handler_cfg = CfgEnvWithHandlerCfg {