reth_rpc_eth_api/
types.rsuse std::{
error::Error,
fmt::{self},
};
use alloy_network::Network;
use alloy_rpc_types_eth::Block;
use reth_rpc_types_compat::TransactionCompat;
use crate::{AsEthApiError, FromEthApiError, FromEvmError};
pub trait EthApiTypes: Send + Sync + Clone {
type Error: Into<jsonrpsee_types::error::ErrorObject<'static>>
+ FromEthApiError
+ AsEthApiError
+ FromEvmError
+ Error
+ Send
+ Sync;
type NetworkTypes: Network<HeaderResponse = alloy_rpc_types_eth::Header>;
type TransactionCompat: Send + Sync + Clone + fmt::Debug;
fn tx_resp_builder(&self) -> &Self::TransactionCompat;
}
pub type RpcTransaction<T> = <T as Network>::TransactionResponse;
pub type RpcBlock<T> = Block<RpcTransaction<T>, <T as Network>::HeaderResponse>;
pub type RpcReceipt<T> = <T as Network>::ReceiptResponse;
pub type RpcError<T> = <T as EthApiTypes>::Error;
pub trait FullEthApiTypes:
EthApiTypes<
TransactionCompat: TransactionCompat<
Transaction = RpcTransaction<Self::NetworkTypes>,
Error = RpcError<Self>,
>,
>
{
}
impl<T> FullEthApiTypes for T where
T: EthApiTypes<
TransactionCompat: TransactionCompat<
Transaction = RpcTransaction<T::NetworkTypes>,
Error = RpcError<T>,
>,
>
{
}