Trait vapcore_light::client::LightChainClient [−][src]
Trait for interacting with the header chain abstractly.
Required methods
fn add_listener(&self, listener: Weak<dyn LightChainNotify>)
[src]
Adds a new LightChainNotify
listener.
fn chain_info(&self) -> BlockChainInfo
[src]
Get chain info.
fn queue_header(&self, header: Header) -> VapcoreResult<H256>
[src]
Queue header to be verified. Required that all headers queued have their parent queued prior.
fn block_hash(&self, id: BlockId) -> Option<H256>
[src]
Attempt to get a block hash by block id.
fn queue_info(&self) -> BlockQueueInfo
[src]
Get block queue information.
fn block_header(&self, id: BlockId) -> Option<Header>
[src]
Attempt to get block header by block id.
fn best_block_header(&self) -> Header
[src]
Get the best block header.
fn score(&self, id: BlockId) -> Option<U256>
[src]
Get a block’s chain score by ID.
fn ancestry_iter<'a>(
&'a self,
start: BlockId
) -> Box<dyn Iterator<Item = Header> + 'a>
[src]
&'a self,
start: BlockId
) -> Box<dyn Iterator<Item = Header> + 'a>
Get an iterator over a block and its ancestry.
fn signing_chain_id(&self) -> Option<u64>
[src]
Get the signing chain ID.
fn env_info(&self, id: BlockId) -> Option<EnvInfo>
[src]
Get environment info for execution at a given block. Fails if that block’s header is not stored.
fn engine(&self) -> &Arc<dyn Engine>
[src]
Get a handle to the consensus engine.
fn is_known(&self, hash: &H256) -> bool
[src]
Query whether a block is known.
fn set_spec_name(&self, new_spec_name: String) -> Result<(), ()>
[src]
Set the chain via a spec name.
fn clear_queue(&self)
[src]
Clear the queue.
fn flush_queue(&self)
[src]
Flush the queue.
fn cht_root(&self, i: usize) -> Option<H256>
[src]
Get the i
th CHT root.
fn report(&self) -> ClientReport
[src]
Get a report of import activity since the last call.
Implementors
impl<T: ChainDataFetcher> LightChainClient for Client<T>
[src]
fn add_listener(&self, listener: Weak<dyn LightChainNotify>)
[src]
fn chain_info(&self) -> BlockChainInfo
[src]
fn queue_info(&self) -> BlockQueueInfo
[src]
fn queue_header(&self, header: Header) -> VapcoreResult<H256>
[src]
fn block_hash(&self, id: BlockId) -> Option<H256>
[src]
fn block_header(&self, id: BlockId) -> Option<Header>
[src]
fn best_block_header(&self) -> Header
[src]
fn score(&self, id: BlockId) -> Option<U256>
[src]
fn ancestry_iter<'a>(
&'a self,
start: BlockId
) -> Box<dyn Iterator<Item = Header> + 'a>
[src]
&'a self,
start: BlockId
) -> Box<dyn Iterator<Item = Header> + 'a>