use crate::network::wallet_state::Actor;
use jormungandr_lib::interfaces::Value;
use serde::{Deserialize, Serialize};
use snapshot_lib::{Dreps, Fraction};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Initials {
pub content: Vec<Actor>,
#[serde(default = "Parameters::default")]
pub parameters: Parameters,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Parameters {
#[serde(default = "default_latest")]
pub tag: String,
pub min_stake_threshold: Value,
pub voting_power_cap: Fraction,
pub direct_voters_group: Option<String>,
pub representatives_group: Option<String>,
pub dreps: Option<Dreps>,
}
impl Default for Parameters {
fn default() -> Self {
Parameters {
tag: default_latest(),
min_stake_threshold: 500.into(),
voting_power_cap: Fraction::new(1u64, 2u64),
direct_voters_group: None,
representatives_group: None,
dreps: None,
}
}
}
fn default_latest() -> String {
"latest".to_string()
}