Trait ethcore_blockchain::BlockProvider
source · [−]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).
fn first_block(&self) -> Option<H256>
fn first_block(&self) -> Option<H256>
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>
fn best_ancient_block(&self) -> Option<H256>
Get the best block of an first block sequence if there is a gap.
fn block_details(&self, hash: &H256) -> Option<BlockDetails>
fn block_details(&self, hash: &H256) -> Option<BlockDetails>
Get the familial details concerning a block.
fn block_hash(&self, index: BlockNumber) -> Option<H256>
fn block_hash(&self, index: BlockNumber) -> Option<H256>
Get the hash of given block’s number.
fn transaction_address(&self, hash: &H256) -> Option<TransactionAddress>
fn transaction_address(&self, hash: &H256) -> Option<TransactionAddress>
Get the address of transaction with given hash.
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>
Get receipts of block with given hash.
fn block_header_data(&self, hash: &H256) -> Option<Header>
fn block_header_data(&self, hash: &H256) -> Option<Header>
Get the header RLP of a block.
fn block_body(&self, hash: &H256) -> Option<Body>
fn block_body(&self, hash: &H256) -> Option<Body>
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>ⓘ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 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,
A: Allocator,
Returns numbers of blocks containing given bloom.
Provided methods
Returns true if the given block is known and in the canon chain.
fn first_block_number(&self) -> Option<BlockNumber>
fn first_block_number(&self) -> Option<BlockNumber>
Get the number of the first block.
fn best_ancient_number(&self) -> Option<BlockNumber>
fn best_ancient_number(&self) -> Option<BlockNumber>
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.
fn block_number(&self, hash: &H256) -> Option<BlockNumber>
fn block_number(&self, hash: &H256) -> Option<BlockNumber>
Get the number of given block’s hash.
fn transaction(
&self,
address: &TransactionAddress
) -> Option<LocalizedTransaction>
fn transaction(
&self,
address: &TransactionAddress
) -> Option<LocalizedTransaction>
Get transaction with given transaction hash.
fn transactions(&self, hash: &H256) -> Option<Vec<LocalizedTransaction>>
fn transactions(&self, hash: &H256) -> Option<Vec<LocalizedTransaction>>
Get a list of transactions for a given block. Returns None if block does not exist.
fn genesis_hash(&self) -> H256
fn genesis_hash(&self) -> H256
Returns reference to genesis hash.
fn genesis_header(&self) -> Header
fn genesis_header(&self) -> Header
Returns the header of the genesis block.