pub trait EthBlocks: LoadBlock {
// Required method
fn provider(&self) -> impl HeaderProvider;
// Provided methods
fn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header>, EthApiError>> + Send
where Self: LoadPendingBlock + SpawnBlocking { ... }
fn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Rich<Block>>, EthApiError>> + Send
where Self: LoadPendingBlock + SpawnBlocking { ... }
fn block_transaction_count(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<usize>, EthApiError>> + Send { ... }
fn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<WithOtherFields<TransactionReceipt<AnyReceiptEnvelope<Log>>>>>, EthApiError>> + Send
where Self: LoadReceipt { ... }
fn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock, Arc<Vec<Receipt>>)>, EthApiError>> + Send
where Self: LoadReceipt { ... }
fn ommers(
&self,
block_id: BlockId,
) -> Result<Option<Vec<Header>>, EthApiError> { ... }
fn ommer_by_block_and_index(
&self,
block_id: BlockId,
index: Index,
) -> impl Future<Output = Result<Option<Rich<Block>>, EthApiError>> + Send { ... }
}
Expand description
Block related functions for the EthApiServer
trait in the
eth_
namespace.
Required Methods§
sourcefn provider(&self) -> impl HeaderProvider
fn provider(&self) -> impl HeaderProvider
Returns a handle for reading data from disk.
Data access in default (L1) trait method implementations.
Provided Methods§
sourcefn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header>, EthApiError>> + Sendwhere
Self: LoadPendingBlock + SpawnBlocking,
fn rpc_block_header(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Header>, EthApiError>> + Sendwhere
Self: LoadPendingBlock + SpawnBlocking,
Returns the block header for the given block id.
sourcefn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Rich<Block>>, EthApiError>> + Sendwhere
Self: LoadPendingBlock + SpawnBlocking,
fn rpc_block(
&self,
block_id: BlockId,
full: bool,
) -> impl Future<Output = Result<Option<Rich<Block>>, EthApiError>> + Sendwhere
Self: LoadPendingBlock + SpawnBlocking,
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>, EthApiError>> + Send
fn block_transaction_count( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<usize>, EthApiError>> + Send
Returns the number transactions in the given block.
Returns None
if the block does not exist
sourcefn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<WithOtherFields<TransactionReceipt<AnyReceiptEnvelope<Log>>>>>, EthApiError>> + Sendwhere
Self: LoadReceipt,
fn block_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<Vec<WithOtherFields<TransactionReceipt<AnyReceiptEnvelope<Log>>>>>, EthApiError>> + Sendwhere
Self: LoadReceipt,
Helper function for eth_getBlockReceipts
.
Returns all transaction receipts in block, or None
if block wasn’t found.
sourcefn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock, Arc<Vec<Receipt>>)>, EthApiError>> + Sendwhere
Self: LoadReceipt,
fn load_block_and_receipts(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<(SealedBlock, Arc<Vec<Receipt>>)>, EthApiError>> + Sendwhere
Self: LoadReceipt,
Helper method that loads a bock and all its receipts.
Object Safety§
This trait is not object safe.