refactor(interfaces): Result -> RethResult, Error -> RethError (#4695)

This commit is contained in:
Alexey Shekhirin
2023-09-20 22:13:16 +01:00
committed by GitHub
parent 6016da7a12
commit 0874767cd9
59 changed files with 874 additions and 723 deletions

View File

@ -16,7 +16,7 @@
use crate::metrics::PayloadBuilderMetrics;
use futures_core::ready;
use futures_util::FutureExt;
use reth_interfaces::Error;
use reth_interfaces::{RethError, RethResult};
use reth_payload_builder::{
database::CachedReads, error::PayloadBuilderError, BuiltPayload, KeepPayloadJobAlive,
PayloadBuilderAttributes, PayloadJob, PayloadJobGenerator,
@ -964,12 +964,12 @@ impl WithdrawalsOutcome {
/// Returns the withdrawals root.
///
/// Returns `None` values pre shanghai
fn commit_withdrawals<DB: Database<Error = Error>>(
fn commit_withdrawals<DB: Database<Error = RethError>>(
db: &mut State<DB>,
chain_spec: &ChainSpec,
timestamp: u64,
withdrawals: Vec<Withdrawal>,
) -> Result<WithdrawalsOutcome, Error> {
) -> RethResult<WithdrawalsOutcome> {
if !chain_spec.is_shanghai_activated_at_timestamp(timestamp) {
return Ok(WithdrawalsOutcome::pre_shanghai())
}

View File

@ -1,5 +1,6 @@
//! Error types emitted by types or implementations of this crate.
use reth_interfaces::RethError;
use reth_primitives::H256;
use reth_transaction_pool::BlobStoreError;
use revm_primitives::EVMError;
@ -19,10 +20,10 @@ pub enum PayloadBuilderError {
BlobStore(#[from] BlobStoreError),
/// Other internal error
#[error(transparent)]
Internal(#[from] reth_interfaces::Error),
Internal(#[from] RethError),
/// Unrecoverable error during evm execution.
#[error("evm execution error: {0:?}")]
EvmExecutionError(EVMError<reth_interfaces::Error>),
EvmExecutionError(EVMError<RethError>),
/// Thrown if the payload requests withdrawals before Shanghai activation.
#[error("withdrawals set before Shanghai activation")]
WithdrawalsBeforeShanghai,