pub trait ChainProvider {
type Error: Display + ToString + Into<PipelineErrorKind>;
// Required methods
fn header_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn block_info_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockInfo, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn receipts_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn block_info_and_transactions_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<(BlockInfo, Vec<TxEnvelope>), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Describes the functionality of a data source that can provide information from the blockchain.
Required Associated Types§
Sourcetype Error: Display + ToString + Into<PipelineErrorKind>
type Error: Display + ToString + Into<PipelineErrorKind>
The error type for the ChainProvider.
Required Methods§
Sourcefn header_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn header_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Header, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn block_info_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockInfo, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_info_by_number<'life0, 'async_trait>(
&'life0 mut self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockInfo, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns the block at the given number, or an error if the block does not exist in the data source.
Sourcefn receipts_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn receipts_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns all receipts in the block with the given hash, or an error if the block does not exist in the data source.
Sourcefn block_info_and_transactions_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<(BlockInfo, Vec<TxEnvelope>), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_info_and_transactions_by_hash<'life0, 'async_trait>(
&'life0 mut self,
hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<(BlockInfo, Vec<TxEnvelope>), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns the BlockInfo and list of TxEnvelopes from the given block hash.