Struct ic_ledger_types::QueryBlocksResponse
source · pub struct QueryBlocksResponse {
pub chain_length: u64,
pub certificate: Option<ByteBuf>,
pub blocks: Vec<Block>,
pub first_block_index: BlockIndex,
pub archived_blocks: Vec<ArchivedBlockRange>,
}
Expand description
Return type for the query_blocks
function.
Fields§
§chain_length: u64
The total number of blocks in the chain.
If the chain length is positive, the index of the last block is chain_length - 1
.
certificate: Option<ByteBuf>
The replica certificate for the last block hash (see Encoding of Certificates). Only available when querying blocks from a canister.
blocks: Vec<Block>
List of blocks that were available in the ledger when it processed the call.
The blocks form a contiguous range, with the first block having index
first_block_index
(see below), and the last block having index
first_block_index + blocks.len() - 1
.
The block range can be an arbitrary sub-range of the originally requested range.
first_block_index: BlockIndex
The index of the first block in QueryBlocksResponse::blocks.
If the blocks
vector is empty, the exact value of this field is not specified.
archived_blocks: Vec<ArchivedBlockRange>
Encoded functions for fetching archived blocks whose indices fall into the requested range.
For each entry e
in archived_blocks
, e.start..e.start + e.length
is a sub-range
of the originally requested block range.
Trait Implementations§
source§impl CandidType for QueryBlocksResponse
impl CandidType for QueryBlocksResponse
source§impl Clone for QueryBlocksResponse
impl Clone for QueryBlocksResponse
source§fn clone(&self) -> QueryBlocksResponse
fn clone(&self) -> QueryBlocksResponse
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more