mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: abstract RPC error over HaltReason (#14104)
This commit is contained in:
@ -4,9 +4,9 @@ use alloy_rpc_types_eth::{error::EthRpcErrorCode, BlockError};
|
||||
use jsonrpsee_types::error::INTERNAL_ERROR_CODE;
|
||||
use reth_optimism_evm::OpBlockExecutionError;
|
||||
use reth_rpc_eth_api::AsEthApiError;
|
||||
use reth_rpc_eth_types::EthApiError;
|
||||
use reth_rpc_eth_types::{error::api::FromEvmHalt, EthApiError};
|
||||
use reth_rpc_server_types::result::{internal_rpc_err, rpc_err};
|
||||
use revm::primitives::{EVMError, InvalidTransaction, OptimismInvalidTransaction};
|
||||
use revm::primitives::{EVMError, HaltReason, InvalidTransaction, OptimismInvalidTransaction};
|
||||
|
||||
/// Optimism specific errors, that extend [`EthApiError`].
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@ -128,3 +128,9 @@ where
|
||||
Self::Eth(error.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl FromEvmHalt for OpEthApiError {
|
||||
fn from_evm_halt(halt: HaltReason, gas_limit: u64) -> Self {
|
||||
EthApiError::from_evm_halt(halt, gas_limit).into()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user