use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProposalsInner {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "tx_hash")]
pub tx_hash: String,
#[serde(rename = "cert_index")]
pub cert_index: i32,
#[serde(rename = "governance_type")]
pub governance_type: GovernanceType,
}
impl ProposalsInner {
pub fn new(id: String, tx_hash: String, cert_index: i32, governance_type: GovernanceType) -> ProposalsInner {
ProposalsInner {
id,
tx_hash,
cert_index,
governance_type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum GovernanceType {
#[serde(rename = "hard_fork_initiation")]
HardForkInitiation,
#[serde(rename = "new_committee")]
NewCommittee,
#[serde(rename = "new_constitution")]
NewConstitution,
#[serde(rename = "info_action")]
InfoAction,
#[serde(rename = "no_confidence")]
NoConfidence,
#[serde(rename = "parameter_change")]
ParameterChange,
#[serde(rename = "treasury_withdrawals")]
TreasuryWithdrawals,
}
impl Default for GovernanceType {
fn default() -> GovernanceType {
Self::HardForkInitiation
}
}