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
/*
* Algod REST API.
*
* API endpoint for algod operations.
*
* The version of the OpenAPI document: 0.0.1
* Contact: contact@algorand.com
* Generated by: https://openapi-generator.tech
*/
/// ParticipationKey : Represents a participation key used by the node.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ParticipationKey {
/// Address the key was generated for.
#[serde(rename = "address")]
pub address: String,
/// When registered, this is the first round it may be used.
#[serde(
rename = "effective-first-valid",
skip_serializing_if = "Option::is_none"
)]
pub effective_first_valid: Option<u64>,
/// When registered, this is the last round it may be used.
#[serde(
rename = "effective-last-valid",
skip_serializing_if = "Option::is_none"
)]
pub effective_last_valid: Option<u64>,
/// The key's ParticipationID.
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "key")]
pub key: Box<crate::models::AccountParticipation>,
/// Round when this key was last used to propose a block.
#[serde(
rename = "last-block-proposal",
skip_serializing_if = "Option::is_none"
)]
pub last_block_proposal: Option<u64>,
/// Round when this key was last used to generate a state proof.
#[serde(rename = "last-state-proof", skip_serializing_if = "Option::is_none")]
pub last_state_proof: Option<u64>,
/// Round when this key was last used to vote.
#[serde(rename = "last-vote", skip_serializing_if = "Option::is_none")]
pub last_vote: Option<u64>,
}
impl ParticipationKey {
/// Represents a participation key used by the node.
pub fn new(
address: String,
id: String,
key: crate::models::AccountParticipation,
) -> ParticipationKey {
ParticipationKey {
address,
effective_first_valid: None,
effective_last_valid: None,
id,
key: Box::new(key),
last_block_proposal: None,
last_state_proof: None,
last_vote: None,
}
}
}