1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Aptos Node API
*
* The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
*
* The version of the OpenAPI document: 1.2.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BlockMetadataTransaction : A block metadata transaction This signifies the beginning of a block, and contains information about the specific block
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlockMetadataTransaction {
/// 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.
#[serde(rename = "version")]
pub version: String,
#[serde(rename = "hash")]
pub hash: String,
#[serde(rename = "state_change_hash")]
pub state_change_hash: String,
#[serde(rename = "event_root_hash")]
pub event_root_hash: String,
#[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
pub state_checkpoint_hash: Option<String>,
/// 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.
#[serde(rename = "gas_used")]
pub gas_used: String,
/// Whether the transaction was successful
#[serde(rename = "success")]
pub success: bool,
/// The VM status of the transaction, can tell useful information in a failure
#[serde(rename = "vm_status")]
pub vm_status: String,
#[serde(rename = "accumulator_root_hash")]
pub accumulator_root_hash: String,
/// Final state of resources changed by the transaction
#[serde(rename = "changes")]
pub changes: Vec<models::WriteSetChange>,
#[serde(rename = "id")]
pub id: String,
/// 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.
#[serde(rename = "epoch")]
pub epoch: String,
/// 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.
#[serde(rename = "round")]
pub round: String,
/// The events emitted at the block creation
#[serde(rename = "events")]
pub events: Vec<models::Event>,
/// Previous block votes
#[serde(rename = "previous_block_votes_bitvec")]
pub previous_block_votes_bitvec: Vec<i32>,
/// 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.
#[serde(rename = "proposer")]
pub proposer: String,
/// The indices of the proposers who failed to propose
#[serde(rename = "failed_proposer_indices")]
pub failed_proposer_indices: Vec<i32>,
/// 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.
#[serde(rename = "timestamp")]
pub timestamp: String,
#[serde(rename = "block_metadata_extension", skip_serializing_if = "Option::is_none")]
pub block_metadata_extension: Option<Box<models::BlockMetadataTransactionBlockMetadataExtension>>,
}
impl BlockMetadataTransaction {
/// A block metadata transaction This signifies the beginning of a block, and contains information about the specific block
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) -> BlockMetadataTransaction {
BlockMetadataTransaction {
version,
hash,
state_change_hash,
event_root_hash,
state_checkpoint_hash: None,
gas_used,
success,
vm_status,
accumulator_root_hash,
changes,
id,
epoch,
round,
events,
previous_block_votes_bitvec,
proposer,
failed_proposer_indices,
timestamp,
block_metadata_extension: None,
}
}
}