algonaut_algod 0.5.0

API endpoint for algod operations.
Documentation
/*
 * 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,
        }
    }
}