Skip to main content

aptos_client_icp/models/
transaction_validator_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 TransactionValidatorTransaction {
16    #[serde(rename = "validator_transaction_type")]
17    pub validator_transaction_type: ValidatorTransactionType,
18    /// 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. 
19    #[serde(rename = "version")]
20    pub version: String,
21    #[serde(rename = "hash")]
22    pub hash: String,
23    #[serde(rename = "state_change_hash")]
24    pub state_change_hash: String,
25    #[serde(rename = "event_root_hash")]
26    pub event_root_hash: String,
27    #[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
28    pub state_checkpoint_hash: Option<String>,
29    /// 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. 
30    #[serde(rename = "gas_used")]
31    pub gas_used: String,
32    /// Whether the transaction was successful
33    #[serde(rename = "success")]
34    pub success: bool,
35    /// The VM status of the transaction, can tell useful information in a failure
36    #[serde(rename = "vm_status")]
37    pub vm_status: String,
38    #[serde(rename = "accumulator_root_hash")]
39    pub accumulator_root_hash: String,
40    /// Final state of resources changed by the transaction
41    #[serde(rename = "changes")]
42    pub changes: Vec<models::WriteSetChange>,
43    #[serde(rename = "events")]
44    pub events: Vec<models::Event>,
45    /// 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. 
46    #[serde(rename = "timestamp")]
47    pub timestamp: String,
48    #[serde(rename = "quorum_certified_update")]
49    pub quorum_certified_update: Box<models::ExportedQuorumCertifiedUpdate>,
50    #[serde(rename = "dkg_transcript")]
51    pub dkg_transcript: Box<models::ExportedDkgTranscript>,
52    #[serde(rename = "type")]
53    pub r#type: Type,
54}
55
56impl TransactionValidatorTransaction {
57    pub fn new(validator_transaction_type: ValidatorTransactionType, 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>, events: Vec<models::Event>, timestamp: String, quorum_certified_update: models::ExportedQuorumCertifiedUpdate, dkg_transcript: models::ExportedDkgTranscript, r#type: Type) -> TransactionValidatorTransaction {
58        TransactionValidatorTransaction {
59            validator_transaction_type,
60            version,
61            hash,
62            state_change_hash,
63            event_root_hash,
64            state_checkpoint_hash: None,
65            gas_used,
66            success,
67            vm_status,
68            accumulator_root_hash,
69            changes,
70            events,
71            timestamp,
72            quorum_certified_update: Box::new(quorum_certified_update),
73            dkg_transcript: Box::new(dkg_transcript),
74            r#type,
75        }
76    }
77}
78/// 
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum ValidatorTransactionType {
81    #[serde(rename = "dkg_result")]
82    DkgResult,
83}
84
85impl Default for ValidatorTransactionType {
86    fn default() -> ValidatorTransactionType {
87        Self::DkgResult
88    }
89}
90/// 
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum Type {
93    #[serde(rename = "validator_transaction")]
94    ValidatorTransaction,
95}
96
97impl Default for Type {
98    fn default() -> Type {
99        Self::ValidatorTransaction
100    }
101}
102