diff --git a/narwhal/config/tests/config_tests.rs b/narwhal/config/tests/config_tests.rs index 46ae5829c6bc8..92bbc65792a16 100644 --- a/narwhal/config/tests/config_tests.rs +++ b/narwhal/config/tests/config_tests.rs @@ -23,8 +23,11 @@ use crypto::PublicKey; use insta::assert_json_snapshot; use multiaddr::Multiaddr; use rand::{rngs::StdRng, seq::SliceRandom, SeedableRng}; -use std::collections::{BTreeMap, HashMap}; -use std::{fs::File, io::Write}; +use std::{ + collections::{BTreeMap, HashMap}, + fs::File, + io::Write, +}; use tempfile::tempdir; use test_utils::CommitteeFixture; diff --git a/narwhal/consensus/src/tests/dag_tests.rs b/narwhal/consensus/src/tests/dag_tests.rs index bc2ff94c0a774..6ebe83b9933f1 100644 --- a/narwhal/consensus/src/tests/dag_tests.rs +++ b/narwhal/consensus/src/tests/dag_tests.rs @@ -7,8 +7,7 @@ use dag::node_dag::NodeDagError; use fastcrypto::Hash; use indexmap::IndexMap; use prometheus::Registry; -use std::collections::BTreeSet; -use std::sync::Arc; +use std::{collections::BTreeSet, sync::Arc}; use test_utils::{make_optimal_certificates, CommitteeFixture}; use types::Certificate; diff --git a/narwhal/consensus/src/tusk.rs b/narwhal/consensus/src/tusk.rs index 3ed6bbc33869c..90170775b635f 100644 --- a/narwhal/consensus/src/tusk.rs +++ b/narwhal/consensus/src/tusk.rs @@ -176,8 +176,7 @@ mod tests { use prometheus::Registry; use rand::Rng; use std::collections::BTreeSet; - use test_utils::make_consensus_store; - use test_utils::CommitteeFixture; + use test_utils::{make_consensus_store, CommitteeFixture}; use types::Certificate; #[test] diff --git a/narwhal/primary/src/proposer.rs b/narwhal/primary/src/proposer.rs index 4fd92d5220304..86a0c1c1508a1 100644 --- a/narwhal/primary/src/proposer.rs +++ b/narwhal/primary/src/proposer.rs @@ -171,7 +171,7 @@ impl Proposer { } } - let mut enough_votes = votes_for_leader >= self.committee.quorum_threshold(); + let mut enough_votes = votes_for_leader >= self.committee.validity_threshold(); if enough_votes { if let Some(leader) = self.last_leader.as_ref() { debug!( @@ -181,7 +181,7 @@ impl Proposer { ); } } - enough_votes |= no_votes >= self.committee.validity_threshold(); + enough_votes |= no_votes >= self.committee.quorum_threshold(); enough_votes } diff --git a/narwhal/worker/src/tests/batch_maker_tests.rs b/narwhal/worker/src/tests/batch_maker_tests.rs index e82b786fd32d5..36308631276f7 100644 --- a/narwhal/worker/src/tests/batch_maker_tests.rs +++ b/narwhal/worker/src/tests/batch_maker_tests.rs @@ -3,8 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 use super::*; use prometheus::Registry; -use test_utils::transaction; -use test_utils::CommitteeFixture; +use test_utils::{transaction, CommitteeFixture}; #[tokio::test] async fn make_batch() {