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
/*
* Indexer
*
* Algorand ledger analytics API.
*
* The version of the OpenAPI document: 2.0
*
* Generated by: https://openapi-generator.tech
*/
/// BlockUpgradeState : Fields relating to a protocol upgrade.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct BlockUpgradeState {
/// \\[proto\\] The current protocol version.
#[serde(rename = "current-protocol")]
pub current_protocol: String,
/// \\[nextproto\\] The next proposed protocol version.
#[serde(rename = "next-protocol", skip_serializing_if = "Option::is_none")]
pub next_protocol: Option<String>,
/// \\[nextyes\\] Number of blocks which approved the protocol upgrade.
#[serde(
rename = "next-protocol-approvals",
skip_serializing_if = "Option::is_none"
)]
pub next_protocol_approvals: Option<u64>,
/// \\[nextswitch\\] Round on which the protocol upgrade will take effect.
#[serde(
rename = "next-protocol-switch-on",
skip_serializing_if = "Option::is_none"
)]
pub next_protocol_switch_on: Option<u64>,
/// \\[nextbefore\\] Deadline round for this protocol upgrade (No votes will be consider after this round).
#[serde(
rename = "next-protocol-vote-before",
skip_serializing_if = "Option::is_none"
)]
pub next_protocol_vote_before: Option<u64>,
}
impl BlockUpgradeState {
/// Fields relating to a protocol upgrade.
pub fn new(current_protocol: String) -> BlockUpgradeState {
BlockUpgradeState {
current_protocol,
next_protocol: None,
next_protocol_approvals: None,
next_protocol_switch_on: None,
next_protocol_vote_before: None,
}
}
}