Trait vapcore_blockchain::BlockProvider [−][src]
Interface for querying blocks by hash and by number.
Required methods
fn is_known(&self, hash: &H256) -> bool
[src]
Returns true if the given block is known (though not necessarily a part of the canon chain).
fn first_block(&self) -> Option<H256>
[src]
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.
fn best_ancient_block(&self) -> Option<H256>
[src]
Get the best block of an first block sequence if there is a gap.
fn block(&self, hash: &H256) -> Option<Block>
[src]
Get raw block data
fn block_details(&self, hash: &H256) -> Option<BlockDetails>
[src]
Get the familial details concerning a block.
fn block_hash(&self, index: BlockNumber) -> Option<H256>
[src]
Get the hash of given block’s number.
fn transaction_address(&self, hash: &H256) -> Option<TransactionAddress>
[src]
Get the address of transaction with given hash.
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>
[src]
Get receipts of block with given hash.
fn block_header_data(&self, hash: &H256) -> Option<Header>
[src]
Get the header RLP of a block.
fn block_body(&self, hash: &H256) -> Option<Body>
[src]
Get the block body (uncles and transactions).
fn blocks_with_bloom<'a, B, I, II>(
&self,
blooms: II,
from_block: BlockNumber,
to_block: BlockNumber
) -> Vec<BlockNumber> where
BloomRef<'a>: From<B>,
II: IntoIterator<Item = B, IntoIter = I> + Copy,
I: Iterator<Item = B>,
Self: Sized,
[src]
&self,
blooms: II,
from_block: BlockNumber,
to_block: BlockNumber
) -> Vec<BlockNumber> where
BloomRef<'a>: From<B>,
II: IntoIterator<Item = B, IntoIter = I> + Copy,
I: Iterator<Item = B>,
Self: Sized,
Returns numbers of blocks containing given bloom.
fn logs<F>(
&self,
blocks: Vec<H256>,
matches: F,
limit: Option<usize>
) -> Vec<LocalizedLogEntry> where
F: Fn(&LogEntry) -> bool + Send + Sync,
Self: Sized,
[src]
&self,
blocks: Vec<H256>,
matches: F,
limit: Option<usize>
) -> Vec<LocalizedLogEntry> where
F: Fn(&LogEntry) -> bool + Send + Sync,
Self: Sized,
Returns logs matching given filter.
Provided methods
fn is_canon(&self, hash: &H256) -> bool
[src]
Returns true if the given block is known and in the canon chain.
fn first_block_number(&self) -> Option<BlockNumber>
[src]
Get the number of the first block.
fn best_ancient_number(&self) -> Option<BlockNumber>
[src]
Get the number of the first block.
fn uncles(&self, hash: &H256) -> Option<Vec<Header>>
[src]
Get a list of uncles for a given block. Returns None if block does not exist.
fn uncle_hashes(&self, hash: &H256) -> Option<Vec<H256>>
[src]
Get a list of uncle hashes for a given block. Returns None if block does not exist.
fn block_number(&self, hash: &H256) -> Option<BlockNumber>
[src]
Get the number of given block’s hash.
fn transaction(
&self,
address: &TransactionAddress
) -> Option<LocalizedTransaction>
[src]
&self,
address: &TransactionAddress
) -> Option<LocalizedTransaction>
Get transaction with given transaction hash.
fn transactions(&self, hash: &H256) -> Option<Vec<LocalizedTransaction>>
[src]
Get a list of transactions for a given block. Returns None if block does not exist.
fn genesis_hash(&self) -> H256
[src]
Returns reference to genesis hash.
fn genesis_header(&self) -> Header
[src]
Returns the header of the genesis block.
Implementors
impl BlockProvider for BlockChain
[src]
fn is_known(&self, hash: &H256) -> bool
[src]
Returns true if the given block is known (though not necessarily a part of the canon chain).
fn first_block(&self) -> Option<H256>
[src]
fn best_ancient_block(&self) -> Option<H256>
[src]
fn best_ancient_number(&self) -> Option<BlockNumber>
[src]
fn block(&self, hash: &H256) -> Option<Block>
[src]
Get raw block data
fn block_header_data(&self, hash: &H256) -> Option<Header>
[src]
Get block header data
fn block_body(&self, hash: &H256) -> Option<Body>
[src]
Get block body data
fn block_details(&self, hash: &H256) -> Option<BlockDetails>
[src]
Get the familial details concerning a block.
fn block_hash(&self, index: BlockNumber) -> Option<H256>
[src]
Get the hash of given block’s number.
fn transaction_address(&self, hash: &H256) -> Option<TransactionAddress>
[src]
Get the address of transaction with given hash.
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>
[src]
Get receipts of block with given hash.
fn blocks_with_bloom<'a, B, I, II>(
&self,
blooms: II,
from_block: BlockNumber,
to_block: BlockNumber
) -> Vec<BlockNumber> where
BloomRef<'a>: From<B>,
II: IntoIterator<Item = B, IntoIter = I> + Copy,
I: Iterator<Item = B>,
[src]
&self,
blooms: II,
from_block: BlockNumber,
to_block: BlockNumber
) -> Vec<BlockNumber> where
BloomRef<'a>: From<B>,
II: IntoIterator<Item = B, IntoIter = I> + Copy,
I: Iterator<Item = B>,
Returns numbers of blocks containing given bloom.
fn logs<F>(
&self,
blocks: Vec<H256>,
matches: F,
limit: Option<usize>
) -> Vec<LocalizedLogEntry> where
F: Fn(&LogEntry) -> bool + Send + Sync,
Self: Sized,
[src]
&self,
blocks: Vec<H256>,
matches: F,
limit: Option<usize>
) -> Vec<LocalizedLogEntry> where
F: Fn(&LogEntry) -> bool + Send + Sync,
Self: Sized,
Returns logs matching given filter. The order of logs returned will be the same as the order of the blocks provided. And it’s the callers responsibility to sort blocks provided in advance.