feat(configs): allow clone for genesis file structs (#528)

This commit is contained in:
Clark Alesna 2024-12-15 03:42:14 +08:00 committed by GitHub
parent 9747be3095
commit fcfc5af253
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

View file

@ -85,7 +85,7 @@ impl From<CostModelPerLanguage> for pallas_primitives::alonzo::CostModels {
}
}
#[derive(Deserialize)]
#[derive(Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GenesisFile {
#[serde(rename = "lovelacePerUTxOWord")]

View file

@ -7,7 +7,7 @@ use serde_with::serde_as;
use serde_with::DisplayFromStr;
use std::collections::HashMap;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GenesisFile {
pub avvm_distr: HashMap<String, String>,
@ -64,7 +64,7 @@ pub struct BlockVersionData {
pub update_vote_thd: u64,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ProtocolConsts {
pub k: usize,
@ -77,7 +77,7 @@ pub struct ProtocolConsts {
pub type BootStakeWeight = u16;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct HeavyDelegation {
pub issuer_pk: String,
@ -85,7 +85,7 @@ pub struct HeavyDelegation {
pub cert: String,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct VssCert {
pub vss_key: String,

View file

@ -1,7 +1,7 @@
use serde::Deserialize;
use std::collections::HashMap;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GenesisFile {
pub pool_voting_thresholds: PoolVotingThresholds,
@ -43,20 +43,20 @@ pub struct DRepVotingThresholds {
pub treasury_withdrawal: f32,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
pub struct Constitution {
pub anchor: Anchor,
pub script: String,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Anchor {
pub data_hash: String,
pub url: String,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
pub struct Committee {
pub members: HashMap<String, u64>,
pub threshold: Fraction,

View file

@ -22,7 +22,7 @@ where
Ok(r)
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GenDelegs {
pub delegate: Option<String>,
@ -75,7 +75,7 @@ impl From<ExtraEntropy> for pallas_primitives::alonzo::Nonce {
}
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ProtocolParams {
pub protocol_version: ProtocolVersion,
@ -106,14 +106,14 @@ pub struct ProtocolParams {
pub a0: pallas_primitives::alonzo::RationalNumber,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Staking {
pub pools: Option<HashMap<String, String>>,
pub stake: Option<HashMap<String, String>>,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GenesisFile {
pub active_slots_coeff: Option<f32>,