1
1
use crate :: {
2
2
interfaces:: {
3
3
ActiveSlotCoefficient , BFTSlotsRatio , ConsensusLeaderId , KESUpdateSpeed , LinearFeeDef ,
4
- NumberOfSlotsPerEpoch , SlotDuration ,
4
+ NumberOfSlotsPerEpoch , SlotDuration , Value ,
5
5
} ,
6
6
time:: SecondsSinceUnixEpoch ,
7
7
} ;
@@ -11,7 +11,6 @@ use chain_impl_mockchain::{
11
11
config:: { Block0Date , ConfigParam } ,
12
12
fee:: LinearFee ,
13
13
fragment:: config:: ConfigParams ,
14
- value,
15
14
} ;
16
15
use serde:: { Deserialize , Serialize } ;
17
16
use std:: convert:: TryFrom ;
@@ -108,11 +107,11 @@ pub struct BlockchainConfiguration {
108
107
109
108
/// Set the default value in the treasury. if omitted then the treasury starts with the value of 0
110
109
#[ serde( default ) ]
111
- pub treasury : Option < u64 > ,
110
+ pub treasury : Option < Value > ,
112
111
113
112
/// Set the value of the reward pot. if omitted then the reward pot is empty
114
113
#[ serde( default ) ]
115
- pub rewards : Option < u64 > ,
114
+ pub rewards : Option < Value > ,
116
115
}
117
116
118
117
impl From < BlockchainConfiguration > for ConfigParams {
@@ -232,9 +231,13 @@ impl BlockchainConfiguration {
232
231
ConfigParam :: EpochStabilityDepth ( param) => epoch_stability_depth
233
232
. replace ( param)
234
233
. 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
+ }
236
237
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
+ }
238
241
ConfigParam :: RewardParams ( _) => unimplemented ! ( ) ,
239
242
ConfigParam :: PerCertificateFees ( param) => per_certificate_fees
240
243
. replace ( param)
@@ -315,10 +318,10 @@ impl BlockchainConfiguration {
315
318
}
316
319
317
320
if let Some ( treasury) = treasury {
318
- params. push ( ConfigParam :: TreasuryAdd ( value :: Value ( treasury) ) ) ;
321
+ params. push ( ConfigParam :: TreasuryAdd ( treasury. into ( ) ) ) ;
319
322
}
320
323
if let Some ( rewards) = rewards {
321
- params. push ( ConfigParam :: RewardPot ( value :: Value ( rewards) ) ) ;
324
+ params. push ( ConfigParam :: RewardPot ( rewards. into ( ) ) ) ;
322
325
}
323
326
324
327
consensus_leader_ids
0 commit comments