coinbase_mesh/models/
block_transaction.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BlockTransaction : BlockTransaction contains a populated Transaction and the BlockIdentifier that contains it.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BlockTransaction {
17    #[serde(rename = "block_identifier")]
18    pub block_identifier: Box<models::BlockIdentifier>,
19    #[serde(rename = "transaction")]
20    pub transaction: Box<models::Transaction>,
21    /// The timestamp of the block in milliseconds since the Unix Epoch.
22    /// This field is optional and not part of the official spec.
23    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
24    pub timestamp: Option<i64>,
25}
26
27impl BlockTransaction {
28    /// BlockTransaction contains a populated Transaction and the BlockIdentifier that contains it.
29    pub fn new(
30        block_identifier: models::BlockIdentifier,
31        transaction: models::Transaction,
32    ) -> BlockTransaction {
33        BlockTransaction {
34            block_identifier: Box::new(block_identifier),
35            transaction: Box::new(transaction),
36            timestamp: None,
37        }
38    }
39}