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
/*
* 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
*/
use algonaut_encoding::Bytes;
/// AccountParticipation : AccountParticipation describes the parameters used by this account in consensus protocol.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AccountParticipation {
/// \\[sel\\] Selection public key (if any) currently registered for this round.
#[serde(rename = "selection-participation-key")]
pub selection_participation_key: Bytes,
/// \\[stprf\\] Root of the state proof key (if any)
#[serde(rename = "state-proof-key", skip_serializing_if = "Option::is_none")]
pub state_proof_key: Option<Bytes>,
/// \\[voteFst\\] First round for which this participation is valid.
#[serde(rename = "vote-first-valid")]
pub vote_first_valid: u64,
/// \\[voteKD\\] Number of subkeys in each batch of participation keys.
#[serde(rename = "vote-key-dilution")]
pub vote_key_dilution: u64,
/// \\[voteLst\\] Last round for which this participation is valid.
#[serde(rename = "vote-last-valid")]
pub vote_last_valid: u64,
/// \\[vote\\] root participation public key (if any) currently registered for this round.
#[serde(rename = "vote-participation-key")]
pub vote_participation_key: Bytes,
}
impl AccountParticipation {
/// AccountParticipation describes the parameters used by this account in consensus protocol.
pub fn new(
selection_participation_key: Bytes,
vote_first_valid: u64,
vote_key_dilution: u64,
vote_last_valid: u64,
vote_participation_key: Bytes,
) -> AccountParticipation {
AccountParticipation {
selection_participation_key,
state_proof_key: None,
vote_first_valid,
vote_key_dilution,
vote_last_valid,
vote_participation_key,
}
}
}