Skip to main content

aptos_client_icp/models/
state_checkpoint_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/// StateCheckpointTransaction : A state checkpoint transaction
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct StateCheckpointTransaction {
17    /// 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. 
18    #[serde(rename = "version")]
19    pub version: String,
20    #[serde(rename = "hash")]
21    pub hash: String,
22    #[serde(rename = "state_change_hash")]
23    pub state_change_hash: String,
24    #[serde(rename = "event_root_hash")]
25    pub event_root_hash: String,
26    #[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
27    pub state_checkpoint_hash: Option<String>,
28    /// 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. 
29    #[serde(rename = "gas_used")]
30    pub gas_used: String,
31    /// Whether the transaction was successful
32    #[serde(rename = "success")]
33    pub success: bool,
34    /// The VM status of the transaction, can tell useful information in a failure
35    #[serde(rename = "vm_status")]
36    pub vm_status: String,
37    #[serde(rename = "accumulator_root_hash")]
38    pub accumulator_root_hash: String,
39    /// Final state of resources changed by the transaction
40    #[serde(rename = "changes")]
41    pub changes: Vec<models::WriteSetChange>,
42    /// 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. 
43    #[serde(rename = "timestamp")]
44    pub timestamp: String,
45}
46
47impl StateCheckpointTransaction {
48    /// A state checkpoint transaction
49    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>, timestamp: String) -> StateCheckpointTransaction {
50        StateCheckpointTransaction {
51            version,
52            hash,
53            state_change_hash,
54            event_root_hash,
55            state_checkpoint_hash: None,
56            gas_used,
57            success,
58            vm_status,
59            accumulator_root_hash,
60            changes,
61            timestamp,
62        }
63    }
64}
65