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
/*
* 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;
/// StateProofMessage : Represents the message that the state proofs are attesting to.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct StateProofMessage {
/// The vector commitment root on all light block headers within a state proof interval.
#[serde(rename = "BlockHeadersCommitment")]
pub block_headers_commitment: Bytes,
/// The first round the message attests to.
#[serde(rename = "FirstAttestedRound")]
pub first_attested_round: u64,
/// The last round the message attests to.
#[serde(rename = "LastAttestedRound")]
pub last_attested_round: u64,
/// An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.
#[serde(rename = "LnProvenWeight")]
pub ln_proven_weight: u64,
/// The vector commitment root of the top N accounts to sign the next StateProof.
#[serde(rename = "VotersCommitment")]
pub voters_commitment: Bytes,
}
impl StateProofMessage {
/// Represents the message that the state proofs are attesting to.
pub fn new(
block_headers_commitment: Bytes,
first_attested_round: u64,
last_attested_round: u64,
ln_proven_weight: u64,
voters_commitment: Bytes,
) -> StateProofMessage {
StateProofMessage {
block_headers_commitment,
first_attested_round,
last_attested_round,
ln_proven_weight,
voters_commitment,
}
}
}