pub trait RpcResponseConverter<N: Network>:
Send
+ Sync
+ Debug
+ 'static {
type Block;
type Transaction;
type Receipt;
// Required methods
fn block(
&self,
response: N::BlockResponse,
) -> Result<Self::Block, RpcResponseConverterError>;
fn transaction(
&self,
response: N::TransactionResponse,
) -> Result<Self::Transaction, RpcResponseConverterError>;
fn receipt(
&self,
response: N::ReceiptResponse,
) -> Result<Self::Receipt, RpcResponseConverterError>;
}Expand description
Converts RPC network responses (blocks, transactions, receipts) into primitive types.
Required Associated Types§
Sourcetype Transaction
type Transaction
Primitive transaction type.
Required Methods§
Sourcefn block(
&self,
response: N::BlockResponse,
) -> Result<Self::Block, RpcResponseConverterError>
fn block( &self, response: N::BlockResponse, ) -> Result<Self::Block, RpcResponseConverterError>
Converts a network block response to a primitive block.
Sourcefn transaction(
&self,
response: N::TransactionResponse,
) -> Result<Self::Transaction, RpcResponseConverterError>
fn transaction( &self, response: N::TransactionResponse, ) -> Result<Self::Transaction, RpcResponseConverterError>
Converts a network transaction response to a primitive transaction.
Sourcefn receipt(
&self,
response: N::ReceiptResponse,
) -> Result<Self::Receipt, RpcResponseConverterError>
fn receipt( &self, response: N::ReceiptResponse, ) -> Result<Self::Receipt, RpcResponseConverterError>
Converts a network receipt response to a primitive receipt.