algonaut_indexer 0.6.0

Algorand ledger analytics API.
Documentation
/*
 * 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,
        }
    }
}