pub trait BlockProvider {
Show 22 methods fn is_known(&self, hash: &H256) -> bool;
fn first_block(&self) -> Option<H256>;
fn best_ancient_block(&self) -> Option<H256>;
fn block(&self, hash: &H256) -> Option<Block>;
fn block_details(&self, hash: &H256) -> Option<BlockDetails>;
fn block_hash(&self, index: BlockNumber) -> Option<H256>;
fn transaction_address(&self, hash: &H256) -> Option<TransactionAddress>;
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>;
fn block_header_data(&self, hash: &H256) -> Option<Header>;
fn block_body(&self, hash: &H256) -> Option<Body>;
fn blocks_with_bloom<'a, B, I, II>(
        &self,
        blooms: II,
        from_block: BlockNumber,
        to_block: BlockNumber
    ) -> Vec<BlockNumber>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator

    where
        BloomRef<'a>: From<B>,
        II: IntoIterator<Item = B, IntoIter = I> + Copy,
        I: Iterator<Item = B>,
        Self: Sized
;
fn logs<F>(
        &self,
        blocks: Vec<H256>,
        matches: F,
        limit: Option<usize>
    ) -> Vec<LocalizedLogEntry>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator

    where
        F: Fn(&LogEntry) -> bool + Send + Sync,
        Self: Sized
; fn is_canon(&self, hash: &H256) -> bool { ... }
fn first_block_number(&self) -> Option<BlockNumber> { ... }
fn best_ancient_number(&self) -> Option<BlockNumber> { ... }
fn uncles(
        &self,
        hash: &H256,
        eip1559_transition: BlockNumber
    ) -> Option<Vec<Header>> { ... }
fn uncle_hashes(&self, hash: &H256) -> Option<Vec<H256>> { ... }
fn block_number(&self, hash: &H256) -> Option<BlockNumber> { ... }
fn transaction(
        &self,
        address: &TransactionAddress
    ) -> Option<LocalizedTransaction> { ... }
fn transactions(&self, hash: &H256) -> Option<Vec<LocalizedTransaction>> { ... }
fn genesis_hash(&self) -> H256 { ... }
fn genesis_header(&self) -> Header { ... }
}
Expand description

Interface for querying blocks by hash and by number.

Required methods

Returns true if the given block is known (though not necessarily a part of the canon chain).

Get the first block of the best part of the chain. Return None if there is no gap and the first block is the genesis. Any queries of blocks which precede this one are not guaranteed to succeed.

Get the best block of an first block sequence if there is a gap.

Get raw block data

Get the familial details concerning a block.

Get the hash of given block’s number.

Get the address of transaction with given hash.

Get receipts of block with given hash.

Get the header RLP of a block.

Get the block body (uncles and transactions).

Returns numbers of blocks containing given bloom.

Returns logs matching given filter.

Provided methods

Returns true if the given block is known and in the canon chain.

Get the number of the first block.

Get the number of the first block.

Get a list of uncles for a given block. Returns None if block does not exist.

Get a list of uncle hashes for a given block. Returns None if block does not exist.

Get the number of given block’s hash.

Get transaction with given transaction hash.

Get a list of transactions for a given block. Returns None if block does not exist.

Returns reference to genesis hash.

Returns the header of the genesis block.

Implementors