pub struct BlockResponse {
pub block: Option<Block>,
pub other_transactions: Option<Vec<TransactionIdentifier>>,
}Expand description
BlockResponse : A BlockResponse includes a fully-populated block or a partially-populated block with a list of other transactions to fetch (other_transactions). As a result of the consensus algorithm of some blockchains, blocks can be omitted (i.e. certain block indices can be skipped). If a query for one of these omitted indices is made, the response should not include a Block object. It is VERY important to note that blocks MUST still form a canonical, connected chain of blocks where each block has a unique index. In other words, the PartialBlockIdentifier of a block after an omitted block should reference the last non-omitted block.
Fields§
§block: Option<Block>§other_transactions: Option<Vec<TransactionIdentifier>>Some blockchains may require additional transactions to be fetched that weren’t returned in the block response (ex: block only returns transaction hashes). For blockchains with a lot of transactions in each block, this can be very useful as consumers can concurrently fetch all transactions returned.
Implementations§
Source§impl BlockResponse
impl BlockResponse
Sourcepub fn new() -> BlockResponse
pub fn new() -> BlockResponse
A BlockResponse includes a fully-populated block or a partially-populated block with a list of other transactions to fetch (other_transactions). As a result of the consensus algorithm of some blockchains, blocks can be omitted (i.e. certain block indices can be skipped). If a query for one of these omitted indices is made, the response should not include a Block object. It is VERY important to note that blocks MUST still form a canonical, connected chain of blocks where each block has a unique index. In other words, the PartialBlockIdentifier of a block after an omitted block should reference the last non-omitted block.
Trait Implementations§
Source§impl Clone for BlockResponse
impl Clone for BlockResponse
Source§fn clone(&self) -> BlockResponse
fn clone(&self) -> BlockResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more