diff --git a/consensus/example/consensus_service.rs b/consensus/example/consensus_service.rs index 1047b5b1b4..08f87d6883 100644 --- a/consensus/example/consensus_service.rs +++ b/consensus/example/consensus_service.rs @@ -53,7 +53,7 @@ pub fn run_main_loop( // Load provisioners keys from external consensus keys. // The loaded keys should be the same as the ones from Genesis State. let keys = load_provisioners_keys(provisioners_num); - let mut provisioners = Provisioners::new(); + let mut provisioners = Provisioners::default(); for (_, (_, pk)) in keys.iter().enumerate() { provisioners.add_member_with_value(pk.clone(), 1000 * DUSK * 10); diff --git a/consensus/example/main.rs b/consensus/example/main.rs index cd6b6fccf3..3f7127f85d 100644 --- a/consensus/example/main.rs +++ b/consensus/example/main.rs @@ -43,7 +43,7 @@ fn generate_keys(n: u64) -> Vec<(SecretKey, PublicKey)> { fn generate_provisioners_from_keys( keys: Vec<(SecretKey, PublicKey)>, ) -> Provisioners { - let mut p = Provisioners::new(); + let mut p = Provisioners::default(); for (pos, (_, pk)) in keys.into_iter().enumerate() { p.add_member_with_value(pk, 1000 * (pos as u64) * DUSK); diff --git a/consensus/src/aggregator.rs b/consensus/src/aggregator.rs index c9899081ce..a11663fbc3 100644 --- a/consensus/src/aggregator.rs +++ b/consensus/src/aggregator.rs @@ -225,7 +225,7 @@ mod tests { // Create provisioners // Also populate a vector of headers - let mut p = Provisioners::new(); + let mut p = Provisioners::default(); let mut input = vec![]; for sk in sks { diff --git a/consensus/src/user/provisioners.rs b/consensus/src/user/provisioners.rs index a1505aabc8..c005e1d794 100644 --- a/consensus/src/user/provisioners.rs +++ b/consensus/src/user/provisioners.rs @@ -19,12 +19,6 @@ pub struct Provisioners { } impl Provisioners { - pub fn new() -> Self { - Self { - members: BTreeMap::new(), - } - } - /// Adds a provisioner with stake. /// /// It appends the stake if the given provisioner already exists. diff --git a/consensus/tests/sortition.rs b/consensus/tests/sortition.rs index 29bc066f60..f426d755c4 100644 --- a/consensus/tests/sortition.rs +++ b/consensus/tests/sortition.rs @@ -103,7 +103,7 @@ fn generate_provisioners(n: usize) -> Provisioners { .map(|data| SecretKey::from_slice(&data[..]).expect("valid secret key")) .collect(); - let mut p = Provisioners::new(); + let mut p = Provisioners::default(); for (i, sk) in sks.iter().enumerate().skip(1) { let stake_value = 1000 * (i) as u64 * DUSK; let pubkey_bls = PublicKey::new(BlsPublicKey::from(sk)); diff --git a/node/benches/accept.rs b/node/benches/accept.rs index 7923264808..47c4f52656 100644 --- a/node/benches/accept.rs +++ b/node/benches/accept.rs @@ -84,7 +84,7 @@ pub fn verify_block_cert(c: &mut Criterion) { for input in INPUTS { group.measurement_time(Duration::from_secs(input.measurement_time)); let mut keys = vec![]; - let mut provisioners = Provisioners::new(); + let mut provisioners = Provisioners::default(); let rng = &mut StdRng::seed_from_u64(0xbeef); for _ in 0..input.provisioners { let sk = BlsSecretKey::random(rng); diff --git a/rusk/src/lib/vm.rs b/rusk/src/lib/vm.rs index ae4a50724e..517be30ec8 100644 --- a/rusk/src/lib/vm.rs +++ b/rusk/src/lib/vm.rs @@ -144,7 +144,7 @@ impl VMExecution for Rusk { (pubkey_bls, stake) }) }); - let mut ret = Provisioners::new(); + let mut ret = Provisioners::default(); for (pubkey_bls, stake) in provisioners { ret.add_member_with_stake(pubkey_bls, stake); }