Trait vapcore_light::provider::Provider[][src]

pub trait Provider: Send + Sync {
    fn chain_info(&self) -> BlockChainInfo;
fn reorg_depth(&self, a: &H256, b: &H256) -> Option<u64>;
fn earliest_state(&self) -> Option<u64>;
fn block_header(&self, id: BlockId) -> Option<Header>;
fn transaction_index(
        &self,
        req: CompleteTransactionIndexRequest
    ) -> Option<TransactionIndexResponse>;
fn block_body(&self, req: CompleteBodyRequest) -> Option<BodyResponse>;
fn block_receipts(
        &self,
        req: CompleteReceiptsRequest
    ) -> Option<ReceiptsResponse>;
fn account_proof(
        &self,
        req: CompleteAccountRequest
    ) -> Option<AccountResponse>;
fn storage_proof(
        &self,
        req: CompleteStorageRequest
    ) -> Option<StorageResponse>;
fn contract_code(&self, req: CompleteCodeRequest) -> Option<CodeResponse>;
fn header_proof(
        &self,
        req: CompleteHeaderProofRequest
    ) -> Option<HeaderProofResponse>;
fn transactions_to_propagate(&self) -> Vec<PendingTransaction>;
fn transaction_proof(
        &self,
        req: CompleteExecutionRequest
    ) -> Option<ExecutionResponse>;
fn epoch_signal(&self, req: CompleteSignalRequest) -> Option<SignalResponse>; fn block_headers(
        &self,
        req: CompleteHeadersRequest
    ) -> Option<HeadersResponse> { ... } }

Defines the operations that a provider for the light subprotocol must fulfill.

Required methods

fn chain_info(&self) -> BlockChainInfo[src]

Provide current blockchain info.

fn reorg_depth(&self, a: &H256, b: &H256) -> Option<u64>[src]

Find the depth of a common ancestor between two blocks. If either block is unknown or an ancestor can’t be found then return None.

fn earliest_state(&self) -> Option<u64>[src]

Earliest block where state queries are available. If None, no state queries are servable.

fn block_header(&self, id: BlockId) -> Option<Header>[src]

Get a block header by id.

fn transaction_index(
    &self,
    req: CompleteTransactionIndexRequest
) -> Option<TransactionIndexResponse>
[src]

Get a transaction index by hash.

fn block_body(&self, req: CompleteBodyRequest) -> Option<BodyResponse>[src]

Fulfill a block body request.

fn block_receipts(
    &self,
    req: CompleteReceiptsRequest
) -> Option<ReceiptsResponse>
[src]

Fulfill a request for block receipts.

fn account_proof(&self, req: CompleteAccountRequest) -> Option<AccountResponse>[src]

Get an account proof.

fn storage_proof(&self, req: CompleteStorageRequest) -> Option<StorageResponse>[src]

Get a storage proof.

fn contract_code(&self, req: CompleteCodeRequest) -> Option<CodeResponse>[src]

Provide contract code for the specified (block_hash, code_hash) pair.

fn header_proof(
    &self,
    req: CompleteHeaderProofRequest
) -> Option<HeaderProofResponse>
[src]

Provide a header proof from a given Canonical Hash Trie as well as the corresponding header.

fn transactions_to_propagate(&self) -> Vec<PendingTransaction>[src]

Provide pending transactions.

fn transaction_proof(
    &self,
    req: CompleteExecutionRequest
) -> Option<ExecutionResponse>
[src]

Provide a proof-of-execution for the given transaction proof request. Returns a vector of all state items necessary to execute the transaction.

fn epoch_signal(&self, req: CompleteSignalRequest) -> Option<SignalResponse>[src]

Provide epoch signal data at given block hash. This should be just the

Loading content...

Provided methods

fn block_headers(&self, req: CompleteHeadersRequest) -> Option<HeadersResponse>[src]

Provide a list of headers starting at the requested block, possibly in reverse and skipping skip at a time.

The returned vector may have any length in the range [0, max], but the results within must adhere to the skip and reverse parameters.

Loading content...

Implementors

impl<L: AsLightClient + Send + Sync> Provider for LightProvider<L>[src]

impl<T: ProvingBlockChainClient + ?Sized> Provider for T[src]

Loading content...