Skip to content

Commit

Permalink
feat(configs): allow clone for genesis file structs (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercurial authored Dec 14, 2024
1 parent 9747be3 commit fcfc5af
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pallas-configs/src/alonzo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
8 changes: 4 additions & 4 deletions pallas-configs/src/byron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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,
Expand All @@ -77,15 +77,15 @@ 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,
pub delegate_pk: String,
pub cert: String,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct VssCert {
pub vss_key: String,
Expand Down
8 changes: 4 additions & 4 deletions pallas-configs/src/conway.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions pallas-configs/src/shelley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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>,
Expand Down

0 comments on commit fcfc5af

Please sign in to comment.