ReceiptConverter

Trait ReceiptConverter 

pub trait ReceiptConverter<N>: Debug + 'static
where N: NodePrimitives,
{ type RpcReceipt; type Error; // Required method fn convert_receipts( &self, receipts: Vec<ConvertReceiptInput<'_, N>>, ) -> Result<Vec<Self::RpcReceipt>, Self::Error>; // Provided method fn convert_receipts_with_block( &self, receipts: Vec<ConvertReceiptInput<'_, N>>, _block: &SealedBlock<<N as NodePrimitives>::Block>, ) -> Result<Vec<Self::RpcReceipt>, Self::Error> { ... } }
Available on crate feature node-api only.
Expand description

A type that knows how to convert primitive receipts to RPC representations.

Required Associated Types§

type RpcReceipt

RPC representation.

type Error

Error that may occur during conversion.

Required Methods§

fn convert_receipts( &self, receipts: Vec<ConvertReceiptInput<'_, N>>, ) -> Result<Vec<Self::RpcReceipt>, Self::Error>

Converts a set of primitive receipts to RPC representations. It is guaranteed that all receipts are from the same block.

Provided Methods§

fn convert_receipts_with_block( &self, receipts: Vec<ConvertReceiptInput<'_, N>>, _block: &SealedBlock<<N as NodePrimitives>::Block>, ) -> Result<Vec<Self::RpcReceipt>, Self::Error>

Converts a set of primitive receipts to RPC representations. It is guaranteed that all receipts are from block.

Implementations on Foreign Types§

§

impl<Provider, N> ReceiptConverter<N> for OpReceiptConverter<Provider>
where N: NodePrimitives<Receipt = OpReceipt>, <N as NodePrimitives>::SignedTx: OpTransaction, Provider: BlockReader<Block = <N as NodePrimitives>::Block> + ChainSpecProvider + Debug + 'static, <Provider as ChainSpecProvider>::ChainSpec: OpHardforks,

§

type RpcReceipt = OpTransactionReceipt

§

type Error = OpEthApiError

§

fn convert_receipts( &self, inputs: Vec<ConvertReceiptInput<'_, N>>, ) -> Result<Vec<<OpReceiptConverter<Provider> as ReceiptConverter<N>>::RpcReceipt>, <OpReceiptConverter<Provider> as ReceiptConverter<N>>::Error>

§

fn convert_receipts_with_block( &self, inputs: Vec<ConvertReceiptInput<'_, N>>, block: &SealedBlock<<N as NodePrimitives>::Block>, ) -> Result<Vec<<OpReceiptConverter<Provider> as ReceiptConverter<N>>::RpcReceipt>, <OpReceiptConverter<Provider> as ReceiptConverter<N>>::Error>

Implementors§

§

impl<N, ChainSpec, Builder, Rpc> ReceiptConverter<N> for EthReceiptConverter<ChainSpec, Builder>
where N: NodePrimitives, ChainSpec: EthChainSpec + 'static, Builder: Fn(<N as NodePrimitives>::Receipt, usize, TransactionMeta) -> Rpc + 'static,

§

type RpcReceipt = TransactionReceipt<Rpc>

§

type Error = EthApiError