@@ -9,8 +9,8 @@ use mithril_common::{
9
9
crypto_helper:: ProtocolGenesisSigner ,
10
10
digesters:: { DumbImmutableDigester , DumbImmutableFileObserver } ,
11
11
entities:: {
12
- Beacon , Certificate , Epoch , ImmutableFileNumber , SignedEntityTypeDiscriminants ,
13
- SignerWithStake , Snapshot , StakeDistribution ,
12
+ Beacon , Certificate , Epoch , ImmutableFileNumber , SignedEntityTypeDiscriminants , Snapshot ,
13
+ StakeDistribution ,
14
14
} ,
15
15
era:: { adapters:: EraReaderDummyAdapter , EraMarker , EraReader , SupportedEra } ,
16
16
test_utils:: {
@@ -324,11 +324,8 @@ impl RuntimeTester {
324
324
/// Updates the stake distribution given a vector of signers with stakes
325
325
pub async fn update_stake_distribution (
326
326
& mut self ,
327
- signers_with_stake : Vec < SignerWithStake > ,
327
+ new_stake_distribution : StakeDistribution ,
328
328
) -> Result < MithrilFixture , String > {
329
- self . chain_observer
330
- . set_signers ( signers_with_stake. clone ( ) )
331
- . await ;
332
329
let beacon = self . observer . current_beacon ( ) . await ;
333
330
let protocol_parameters = self
334
331
. deps_builder
@@ -343,17 +340,17 @@ impl RuntimeTester {
343
340
. ok_or ( "A protocol parameters for the recording epoch should be available" ) ?;
344
341
345
342
let fixture = MithrilFixtureBuilder :: default ( )
346
- . with_signers ( signers_with_stake . len ( ) )
343
+ . with_signers ( new_stake_distribution . len ( ) )
347
344
. with_protocol_parameters ( protocol_parameters)
348
345
. with_stake_distribution ( StakeDistributionGenerationMethod :: Custom (
349
- StakeDistribution :: from_iter (
350
- signers_with_stake
351
- . into_iter ( )
352
- . map ( |s| ( s. party_id , s. stake ) ) ,
353
- ) ,
346
+ new_stake_distribution,
354
347
) )
355
348
. build ( ) ;
356
349
350
+ self . chain_observer
351
+ . set_signers ( fixture. signers_with_stake ( ) )
352
+ . await ;
353
+
357
354
Ok ( fixture)
358
355
}
359
356
0 commit comments