Trait vapcore_light::client::LightChainClient[][src]

pub trait LightChainClient: Send + Sync {
    fn add_listener(&self, listener: Weak<dyn LightChainNotify>);
fn chain_info(&self) -> BlockChainInfo;
fn queue_header(&self, header: Header) -> VapcoreResult<H256>;
fn block_hash(&self, id: BlockId) -> Option<H256>;
fn queue_info(&self) -> BlockQueueInfo;
fn block_header(&self, id: BlockId) -> Option<Header>;
fn best_block_header(&self) -> Header;
fn score(&self, id: BlockId) -> Option<U256>;
fn ancestry_iter<'a>(
        &'a self,
        start: BlockId
    ) -> Box<dyn Iterator<Item = Header> + 'a>;
fn signing_chain_id(&self) -> Option<u64>;
fn env_info(&self, id: BlockId) -> Option<EnvInfo>;
fn engine(&self) -> &Arc<dyn Engine>;
fn is_known(&self, hash: &H256) -> bool;
fn set_spec_name(&self, new_spec_name: String) -> Result<(), ()>;
fn clear_queue(&self);
fn flush_queue(&self);
fn cht_root(&self, i: usize) -> Option<H256>;
fn report(&self) -> ClientReport; }

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]

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 ith CHT root.

fn report(&self) -> ClientReport[src]

Get a report of import activity since the last call.

Loading content...

Implementors

impl<T: ChainDataFetcher> LightChainClient for Client<T>[src]

Loading content...