Skip to content

Commit 24a8aa2

Browse files
committed
fix the type of the reward pot and the initial tresury pot
1 parent 190c37e commit 24a8aa2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

jormungandr-lib/src/interfaces/block0_configuration/initial_config.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{
22
interfaces::{
33
ActiveSlotCoefficient, BFTSlotsRatio, ConsensusLeaderId, KESUpdateSpeed, LinearFeeDef,
4-
NumberOfSlotsPerEpoch, SlotDuration,
4+
NumberOfSlotsPerEpoch, SlotDuration, Value,
55
},
66
time::SecondsSinceUnixEpoch,
77
};
@@ -11,7 +11,6 @@ use chain_impl_mockchain::{
1111
config::{Block0Date, ConfigParam},
1212
fee::LinearFee,
1313
fragment::config::ConfigParams,
14-
value,
1514
};
1615
use serde::{Deserialize, Serialize};
1716
use std::convert::TryFrom;
@@ -108,11 +107,11 @@ pub struct BlockchainConfiguration {
108107

109108
/// Set the default value in the treasury. if omitted then the treasury starts with the value of 0
110109
#[serde(default)]
111-
pub treasury: Option<u64>,
110+
pub treasury: Option<Value>,
112111

113112
/// Set the value of the reward pot. if omitted then the reward pot is empty
114113
#[serde(default)]
115-
pub rewards: Option<u64>,
114+
pub rewards: Option<Value>,
116115
}
117116

118117
impl From<BlockchainConfiguration> for ConfigParams {
@@ -232,9 +231,13 @@ impl BlockchainConfiguration {
232231
ConfigParam::EpochStabilityDepth(param) => epoch_stability_depth
233232
.replace(param)
234233
.map(|_| "epoch_stability_depth"),
235-
ConfigParam::TreasuryAdd(param) => treasury.replace(param.0).map(|_| "treasury"),
234+
ConfigParam::TreasuryAdd(param) => {
235+
treasury.replace(param.into()).map(|_| "treasury")
236+
}
236237
ConfigParam::TreasuryParams(_) => unimplemented!(),
237-
ConfigParam::RewardPot(param) => rewards.replace(param.0).map(|_| "reward-pot"),
238+
ConfigParam::RewardPot(param) => {
239+
rewards.replace(param.into()).map(|_| "reward-pot")
240+
}
238241
ConfigParam::RewardParams(_) => unimplemented!(),
239242
ConfigParam::PerCertificateFees(param) => per_certificate_fees
240243
.replace(param)
@@ -315,10 +318,10 @@ impl BlockchainConfiguration {
315318
}
316319

317320
if let Some(treasury) = treasury {
318-
params.push(ConfigParam::TreasuryAdd(value::Value(treasury)));
321+
params.push(ConfigParam::TreasuryAdd(treasury.into()));
319322
}
320323
if let Some(rewards) = rewards {
321-
params.push(ConfigParam::RewardPot(value::Value(rewards)));
324+
params.push(ConfigParam::RewardPot(rewards.into()));
322325
}
323326

324327
consensus_leader_ids

0 commit comments

Comments
 (0)