pub trait EthBlocks: LoadBlock {
// Required method
fn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<<Self::NetworkTypes as Network>::ReceiptResponse>>, Self::Error>> + Send
where Self: LoadReceipt;
// Provided methods
fn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header<<Self::Provider as HeaderProvider>::Header>>, Self::Error>> + Send
where Self: FullEthApiTypes { ... }
fn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Send
where Self: FullEthApiTypes { ... }
fn block_transaction_count(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send { ... }
fn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock<<<Self::Provider as BlockReader>::Block as Block>::Header, <<Self::Provider as BlockReader>::Block as Block>::Body>, Arc<Vec<<Self::Provider as ReceiptProvider>::Receipt>>)>, Self::Error>> + Send
where Self: LoadReceipt { ... }
fn ommers(
&self,
block_id: BlockId,
) -> Result<Option<Vec<<Self::Provider as HeaderProvider>::Header>>, Self::Error> { ... }
fn ommer_by_block_and_index(
&self,
block_id: BlockId,
index: Index,
) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Send { ... }
}
Expand description
Block related functions for the EthApiServer
trait in the
eth_
namespace.
Required Methods§
Sourcefn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<<Self::NetworkTypes as Network>::ReceiptResponse>>, Self::Error>> + Sendwhere
Self: LoadReceipt,
fn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<<Self::NetworkTypes as Network>::ReceiptResponse>>, Self::Error>> + Sendwhere
Self: LoadReceipt,
Helper function for eth_getBlockReceipts
.
Returns all transaction receipts in block, or None
if block wasn’t found.
Provided Methods§
Sourcefn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header<<Self::Provider as HeaderProvider>::Header>>, Self::Error>> + Sendwhere
Self: FullEthApiTypes,
fn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header<<Self::Provider as HeaderProvider>::Header>>, Self::Error>> + Sendwhere
Self: FullEthApiTypes,
Returns the block header for the given block id.
Sourcefn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Sendwhere
Self: FullEthApiTypes,
fn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Sendwhere
Self: FullEthApiTypes,
Returns the populated rpc block object for the given block id.
If full
is true, the block object will contain all transaction objects, otherwise it will
only contain the transaction hashes.
Sourcefn block_transaction_count(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send
fn block_transaction_count( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send
Returns the number transactions in the given block.
Returns None
if the block does not exist
Sourcefn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock<<<Self::Provider as BlockReader>::Block as Block>::Header, <<Self::Provider as BlockReader>::Block as Block>::Body>, Arc<Vec<<Self::Provider as ReceiptProvider>::Receipt>>)>, Self::Error>> + Sendwhere
Self: LoadReceipt,
fn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock<<<Self::Provider as BlockReader>::Block as Block>::Header, <<Self::Provider as BlockReader>::Block as Block>::Body>, Arc<Vec<<Self::Provider as ReceiptProvider>::Receipt>>)>, Self::Error>> + Sendwhere
Self: LoadReceipt,
Helper method that loads a bock and all its receipts.
Sourcefn ommers(
&self,
block_id: BlockId,
) -> Result<Option<Vec<<Self::Provider as HeaderProvider>::Header>>, Self::Error>
fn ommers( &self, block_id: BlockId, ) -> Result<Option<Vec<<Self::Provider as HeaderProvider>::Header>>, Self::Error>
Returns uncle headers of given block.
Returns an empty vec if there are none.
Sourcefn ommer_by_block_and_index(
&self,
block_id: BlockId,
index: Index,
) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Send
fn ommer_by_block_and_index( &self, block_id: BlockId, index: Index, ) -> impl Future<Output = Result<Option<Block<<Self::NetworkTypes as Network>::TransactionResponse, <Self::NetworkTypes as Network>::HeaderResponse>>, Self::Error>> + Send
Returns uncle block at given index in given block.
Returns None
if index out of range.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.