Skip to main content

ReceiptConverter

Trait ReceiptConverter 

Source
pub trait ReceiptConverter<N>: Debug + 'static
where N: NodePrimitives,
{ type RpcReceipt; type RpcLog; type Error; // Required methods fn convert_log( &self, log: Log, receipt: &<N as NodePrimitives>::Receipt, header: &SealedHeader<<N as NodePrimitives>::BlockHeader>, ) -> Result<Self::RpcLog, Self::Error>; 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§

Source

type RpcReceipt

RPC receipt representation.

Source

type RpcLog

RPC log representation.

Source

type Error

Error that may occur during conversion.

Required Methods§

Source

fn convert_log( &self, log: Log, receipt: &<N as NodePrimitives>::Receipt, header: &SealedHeader<<N as NodePrimitives>::BlockHeader>, ) -> Result<Self::RpcLog, Self::Error>

Converts an RPC log using its primitive receipt and block header.

Source

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§

Source

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

Converts primitive receipts from block to RPC representations.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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,