Skip to content

Commit

Permalink
minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ElFantasma committed Mar 22, 2024
1 parent e20cdbd commit 8652d0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/actors/bft/src/leader/replica_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ impl StateMachine {
};

// Check that previous weight did not reach threshold
// to ensure this is the first time the threshold has been reached
let previous_weight = self
.config
.genesis()
.validators
.weight_from_msgs(by_proposal_before.entry(proposal).or_default());
// to ensure this is the first time the threshold has been reached
debug_assert!(previous_weight < threshold);

// ----------- Update the state machine --------------
Expand Down
4 changes: 2 additions & 2 deletions node/libs/roles/src/validator/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Setup {
/// New `Setup` with a given `fork`.
pub fn new_with_fork(rng: &mut impl Rng, validators: usize, fork: Fork) -> Self {
let keys: Vec<SecretKey> = (0..validators).map(|_| rng.gen()).collect();
let weight = (10000 / validators) as u32;
let weight = (ValidatorCommittee::MAX_WEIGHT / validators) as u32;
let genesis = Genesis {
validators: ValidatorCommittee::new(keys.iter().map(|k| WeightedValidator {
key: k.public(),
Expand Down Expand Up @@ -303,7 +303,7 @@ impl Distribution<ValidatorCommittee> for Standard {
let count = rng.gen_range(1..11);
let public_keys = (0..count).map(|_| WeightedValidator {
key: rng.gen(),
weight: 1000,
weight: ValidatorCommittee::MAX_WEIGHT as u32,
});
ValidatorCommittee::new(public_keys).unwrap()
}
Expand Down

0 comments on commit 8652d0e

Please sign in to comment.