Struct rosetta_types::block::Block
source · pub struct Block {
pub block_identifier: BlockIdentifier,
pub parent_block_identifier: BlockIdentifier,
pub timestamp: i64,
pub transactions: Vec<Transaction>,
pub metadata: Option<Value>,
}
Expand description
Block : Blocks contain an array of Transactions that occurred at a particular BlockIdentifier. A hard requirement for blocks returned by Rosetta implementations is that they MUST be inalterable: once a client has requested and received a block identified by a specific BlockIndentifier, all future calls for that same BlockIdentifier must return the same block contents.
Fields§
§block_identifier: BlockIdentifier
§parent_block_identifier: BlockIdentifier
§timestamp: i64
The timestamp of the block in milliseconds since the Unix Epoch. The timestamp is stored in milliseconds because some blockchains produce blocks more often than once a second.
transactions: Vec<Transaction>
§metadata: Option<Value>
Implementations§
source§impl Block
impl Block
sourcepub fn new(
block_identifier: BlockIdentifier,
parent_block_identifier: BlockIdentifier,
timestamp: i64,
transactions: Vec<Transaction>
) -> Block
pub fn new( block_identifier: BlockIdentifier, parent_block_identifier: BlockIdentifier, timestamp: i64, transactions: Vec<Transaction> ) -> Block
Blocks contain an array of Transactions that occurred at a particular BlockIdentifier. A hard requirement for blocks returned by Rosetta implementations is that they MUST be inalterable: once a client has requested and received a block identified by a specific BlockIndentifier, all future calls for that same BlockIdentifier must return the same block contents.