Skip to main content

aptos_client_icp/models/
transaction_block_metadata_transaction.rs

1/*
2 * Aptos Node API
3 *
4 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
5 *
6 * The version of the OpenAPI document: 1.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TransactionBlockMetadataTransaction {
16    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
17    #[serde(rename = "version")]
18    pub version: String,
19    #[serde(rename = "hash")]
20    pub hash: String,
21    #[serde(rename = "state_change_hash")]
22    pub state_change_hash: String,
23    #[serde(rename = "event_root_hash")]
24    pub event_root_hash: String,
25    #[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
26    pub state_checkpoint_hash: Option<String>,
27    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
28    #[serde(rename = "gas_used")]
29    pub gas_used: String,
30    /// Whether the transaction was successful
31    #[serde(rename = "success")]
32    pub success: bool,
33    /// The VM status of the transaction, can tell useful information in a failure
34    #[serde(rename = "vm_status")]
35    pub vm_status: String,
36    #[serde(rename = "accumulator_root_hash")]
37    pub accumulator_root_hash: String,
38    /// Final state of resources changed by the transaction
39    #[serde(rename = "changes")]
40    pub changes: Vec<models::WriteSetChange>,
41    #[serde(rename = "id")]
42    pub id: String,
43    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
44    #[serde(rename = "epoch")]
45    pub epoch: String,
46    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
47    #[serde(rename = "round")]
48    pub round: String,
49    /// The events emitted at the block creation
50    #[serde(rename = "events")]
51    pub events: Vec<models::Event>,
52    /// Previous block votes
53    #[serde(rename = "previous_block_votes_bitvec")]
54    pub previous_block_votes_bitvec: Vec<i32>,
55    /// A hex encoded 32 byte Aptos account address.  This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.  For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1. 
56    #[serde(rename = "proposer")]
57    pub proposer: String,
58    /// The indices of the proposers who failed to propose
59    #[serde(rename = "failed_proposer_indices")]
60    pub failed_proposer_indices: Vec<i32>,
61    /// A string containing a 64-bit unsigned integer.  We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. 
62    #[serde(rename = "timestamp")]
63    pub timestamp: String,
64    #[serde(rename = "block_metadata_extension", skip_serializing_if = "Option::is_none")]
65    pub block_metadata_extension: Option<Box<models::BlockMetadataTransactionBlockMetadataExtension>>,
66    #[serde(rename = "type")]
67    pub r#type: Type,
68}
69
70impl TransactionBlockMetadataTransaction {
71    pub fn new(version: String, hash: String, state_change_hash: String, event_root_hash: String, gas_used: String, success: bool, vm_status: String, accumulator_root_hash: String, changes: Vec<models::WriteSetChange>, id: String, epoch: String, round: String, events: Vec<models::Event>, previous_block_votes_bitvec: Vec<i32>, proposer: String, failed_proposer_indices: Vec<i32>, timestamp: String, r#type: Type) -> TransactionBlockMetadataTransaction {
72        TransactionBlockMetadataTransaction {
73            version,
74            hash,
75            state_change_hash,
76            event_root_hash,
77            state_checkpoint_hash: None,
78            gas_used,
79            success,
80            vm_status,
81            accumulator_root_hash,
82            changes,
83            id,
84            epoch,
85            round,
86            events,
87            previous_block_votes_bitvec,
88            proposer,
89            failed_proposer_indices,
90            timestamp,
91            block_metadata_extension: None,
92            r#type,
93        }
94    }
95}
96/// 
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum Type {
99    #[serde(rename = "block_metadata_transaction")]
100    BlockMetadataTransaction,
101}
102
103impl Default for Type {
104    fn default() -> Type {
105        Self::BlockMetadataTransaction
106    }
107}
108