Removed manual implementations of core::error::Error (#13370)

Co-authored-by: router <router@router.ian>
This commit is contained in:
Pelle
2024-12-18 00:01:48 +00:00
committed by GitHub
parent c51a188c72
commit ef033abaf9
13 changed files with 117 additions and 195 deletions

View File

@ -43,6 +43,7 @@ revm-primitives.workspace = true
# misc
derive_more.workspace = true
tracing.workspace = true
thiserror.workspace = true
[dev-dependencies]
reth-evm = { workspace = true, features = ["test-utils"] }
@ -64,12 +65,13 @@ std = [
"alloy-genesis/std",
"alloy-primitives/std",
"revm-primitives/std",
"reth-primitives-traits/std",
"reth-primitives-traits/std",
"revm/std",
"reth-optimism-primitives/std",
"reth-ethereum-forks/std",
"derive_more/std",
"reth-optimism-forks/std"
"reth-optimism-forks/std",
"thiserror/std"
]
optimism = [
"reth-primitives/optimism",

View File

@ -4,27 +4,25 @@ use alloc::string::String;
use reth_evm::execute::BlockExecutionError;
/// Optimism Block Executor Errors
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum OpBlockExecutionError {
/// Error when trying to parse L1 block info
#[display("could not get L1 block info from L2 block: {message}")]
#[error("could not get L1 block info from L2 block: {message}")]
L1BlockInfoError {
/// The inner error message
message: String,
},
/// Thrown when force deploy of create2deployer code fails.
#[display("failed to force create2deployer account code")]
#[error("failed to force create2deployer account code")]
ForceCreate2DeployerFail,
/// Thrown when a blob transaction is included in a sequencer's block.
#[display("blob transaction included in sequencer block")]
#[error("blob transaction included in sequencer block")]
BlobTransactionRejected,
/// Thrown when a database account could not be loaded.
#[display("failed to load account {_0}")]
#[error("failed to load account {_0}")]
AccountLoadFailed(alloy_primitives::Address),
}
impl core::error::Error for OpBlockExecutionError {}
impl From<OpBlockExecutionError> for BlockExecutionError {
fn from(err: OpBlockExecutionError) -> Self {
Self::other(err)