diff --git a/node/actors/bft/src/tests/unit_tests.rs b/node/actors/bft/src/tests/unit_tests.rs index f4bee76e4..2eee2ab23 100644 --- a/node/actors/bft/src/tests/unit_tests.rs +++ b/node/actors/bft/src/tests/unit_tests.rs @@ -70,7 +70,7 @@ use zksync_consensus_roles::validator::{ /// #[tokio::test] async fn replica_prepare_sanity() { - let mut util = Util::make().await; + let mut util = Util::new().await; let replica_prepare = util.make_replica_prepare(None::); let res = util.dispatch_replica_prepare(replica_prepare); @@ -79,7 +79,7 @@ async fn replica_prepare_sanity() { #[tokio::test] async fn replica_prepare_sanity_yield_leader_prepare() { - let mut util = Util::make().await; + let mut util = Util::new().await; let replica_prepare = util.make_replica_prepare(None::); let res = util.dispatch_replica_prepare(replica_prepare); @@ -89,7 +89,7 @@ async fn replica_prepare_sanity_yield_leader_prepare() { #[tokio::test] async fn replica_prepare_old_view() { - let mut util = Util::make().await; + let mut util = Util::new().await; util.set_replica_view(ViewNumber(1)); util.set_leader_view(ViewNumber(2)); @@ -109,7 +109,7 @@ async fn replica_prepare_old_view() { #[tokio::test] async fn replica_prepare_during_commit() { - let mut util = Util::make().await; + let mut util = Util::new().await; util.set_leader_phase(Phase::Commit); @@ -127,7 +127,7 @@ async fn replica_prepare_during_commit() { #[tokio::test] async fn replica_prepare_already_exists() { - let mut util = Util::make_with(2).await; + let mut util = Util::new_with(2).await; let view = ViewNumber(2); util.set_replica_view(view); @@ -156,7 +156,7 @@ async fn replica_prepare_already_exists() { #[tokio::test] async fn replica_prepare_num_received_below_threshold() { - let mut util = Util::make_with(2).await; + let mut util = Util::new_with(2).await; let view = ViewNumber(2); util.set_replica_view(view); @@ -176,7 +176,7 @@ async fn replica_prepare_num_received_below_threshold() { #[tokio::test] async fn leader_prepare_sanity() { - let mut util = Util::make().await; + let mut util = Util::new().await; let replica_prepare = util.make_replica_prepare(None::); let res = util.dispatch_replica_prepare(replica_prepare); @@ -189,7 +189,7 @@ async fn leader_prepare_sanity() { #[tokio::test] async fn leader_prepare_invalid_leader() { - let mut util = Util::make_with(2).await; + let mut util = Util::new_with(2).await; let view = ViewNumber(2); util.set_replica_view(view); @@ -233,7 +233,7 @@ async fn leader_prepare_invalid_leader() { #[tokio::test] async fn leader_prepare_invalid_sig() { - let mut util = Util::make().await; + let mut util = Util::new().await; let mut leader_prepare = util.make_leader_prepare(None::); leader_prepare.sig = util.rng().gen(); @@ -249,7 +249,7 @@ async fn leader_prepare_invalid_sig() { #[tokio::test] async fn leader_prepare_invalid_prepare_qc_different_views() { - let mut util = Util::make().await; + let mut util = Util::new().await; let replica_prepare = util.make_replica_prepare(None::); let res = util.dispatch_replica_prepare(replica_prepare.clone()); @@ -328,11 +328,11 @@ mod util { } impl Util { - pub async fn make() -> Util { - Util::make_with(1).await + pub async fn new() -> Util { + Util::new_with(1).await } - pub async fn make_with(num_validators: i32) -> Util { + pub async fn new_with(num_validators: i32) -> Util { let ctx = ctx::test_root(&ctx::RealClock); let mut rng = StdRng::seed_from_u64(6516565651); let keys: Vec<_> = (0..num_validators).map(|_| rng.gen()).collect();