Struct rosetta_types::block_response::BlockResponse
source · 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 moresource§impl Debug for BlockResponse
impl Debug for BlockResponse
source§impl Default for BlockResponse
impl Default for BlockResponse
source§fn default() -> BlockResponse
fn default() -> BlockResponse
source§impl<'de> Deserialize<'de> for BlockResponse
impl<'de> Deserialize<'de> for BlockResponse
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<BlockResponse> for BlockResponse
impl PartialEq<BlockResponse> for BlockResponse
source§fn eq(&self, other: &BlockResponse) -> bool
fn eq(&self, other: &BlockResponse) -> bool
self and other values to be equal, and is used
by ==.