From cdfbd3ca0c8757693a38d0662717667d14dafe23 Mon Sep 17 00:00:00 2001 From: imabdulbasit Date: Sat, 14 Dec 2024 20:30:24 +0500 Subject: [PATCH] lint --- crates/testing/tests/tests_1/da_task.rs | 12 +++++- .../tests/tests_1/quorum_proposal_task.rs | 39 ++++++++++++------- .../testing/tests/tests_1/transaction_task.rs | 12 +++++- .../tests_1/upgrade_task_with_proposal.rs | 9 +++-- crates/testing/tests/tests_1/vid_task.rs | 6 ++- 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/crates/testing/tests/tests_1/da_task.rs b/crates/testing/tests/tests_1/da_task.rs index 742c27f23d..a068616736 100644 --- a/crates/testing/tests/tests_1/da_task.rs +++ b/crates/testing/tests/tests_1/da_task.rs @@ -48,7 +48,11 @@ async fn test_da_task() { let encoded_transactions = Arc::from(TestTransaction::encode(&transactions)); let (payload_commit, precompute) = precompute_vid_commitment( &encoded_transactions, - handle.hotshot.memberships.total_nodes(EpochNumber::new(0)).await, + handle + .hotshot + .memberships + .total_nodes(EpochNumber::new(0)) + .await, ); let mut generator = TestViewGenerator::generate(membership.clone()); @@ -156,7 +160,11 @@ async fn test_da_task_storage_failure() { let encoded_transactions = Arc::from(TestTransaction::encode(&transactions)); let (payload_commit, precompute) = precompute_vid_commitment( &encoded_transactions, - handle.hotshot.memberships.total_nodes(EpochNumber::new(0)).await, + handle + .hotshot + .memberships + .total_nodes(EpochNumber::new(0)) + .await, ); let mut generator = TestViewGenerator::generate(membership.clone()); diff --git a/crates/testing/tests/tests_1/quorum_proposal_task.rs b/crates/testing/tests/tests_1/quorum_proposal_task.rs index 12c0ce24b3..4652fb3b97 100644 --- a/crates/testing/tests/tests_1/quorum_proposal_task.rs +++ b/crates/testing/tests/tests_1/quorum_proposal_task.rs @@ -57,7 +57,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_1() { &membership, ViewNumber::new(node_id), EpochNumber::new(1), - ).await; + ) + .await; let mut generator = TestViewGenerator::generate(membership.clone()); @@ -196,7 +197,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_gt_1() { &membership, ViewNumber::new(1), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), TestMetadata { num_transactions: 0 @@ -215,7 +217,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_gt_1() { &membership, ViewNumber::new(2), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[0].data.block_header.metadata, ViewNumber::new(2), @@ -232,7 +235,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_gt_1() { &membership, ViewNumber::new(3), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[1].data.block_header.metadata, ViewNumber::new(3), @@ -249,7 +253,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_gt_1() { &membership, ViewNumber::new(4), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[2].data.block_header.metadata, ViewNumber::new(4), @@ -266,7 +271,8 @@ async fn test_quorum_proposal_task_quorum_proposal_view_gt_1() { &membership, ViewNumber::new(5), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment, proposals[3].data.block_header.metadata, ViewNumber::new(5), @@ -314,7 +320,8 @@ async fn test_quorum_proposal_task_qc_timeout() { &membership, ViewNumber::new(node_id), EpochNumber::new(1), - ).await; + ) + .await; let builder_commitment = BuilderCommitment::from_raw_digest(sha2::Sha256::new().finalize()); let mut generator = TestViewGenerator::generate(membership.clone()); @@ -403,7 +410,8 @@ async fn test_quorum_proposal_task_view_sync() { &membership, ViewNumber::new(node_id), EpochNumber::new(1), - ).await; + ) + .await; let builder_commitment = BuilderCommitment::from_raw_digest(sha2::Sha256::new().finalize()); let mut generator = TestViewGenerator::generate(membership.clone()); @@ -536,7 +544,8 @@ async fn test_quorum_proposal_task_liveness_check() { &membership, ViewNumber::new(1), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), TestMetadata { num_transactions: 0 @@ -555,7 +564,8 @@ async fn test_quorum_proposal_task_liveness_check() { &membership, ViewNumber::new(2), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[0].data.block_header.metadata, ViewNumber::new(2), @@ -572,7 +582,8 @@ async fn test_quorum_proposal_task_liveness_check() { &membership, ViewNumber::new(3), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[1].data.block_header.metadata, ViewNumber::new(3), @@ -589,7 +600,8 @@ async fn test_quorum_proposal_task_liveness_check() { &membership, ViewNumber::new(4), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[2].data.block_header.metadata, ViewNumber::new(4), @@ -606,7 +618,8 @@ async fn test_quorum_proposal_task_liveness_check() { &membership, ViewNumber::new(5), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment, proposals[3].data.block_header.metadata, ViewNumber::new(5), diff --git a/crates/testing/tests/tests_1/transaction_task.rs b/crates/testing/tests/tests_1/transaction_task.rs index 7a1c0a02fc..747e40e29d 100644 --- a/crates/testing/tests/tests_1/transaction_task.rs +++ b/crates/testing/tests/tests_1/transaction_task.rs @@ -42,7 +42,11 @@ async fn test_transaction_task_leader_two_views_in_a_row() { let (_, precompute_data) = precompute_vid_commitment( &[], - handle.hotshot.memberships.total_nodes(EpochNumber::new(0)).await, + handle + .hotshot + .memberships + .total_nodes(EpochNumber::new(0)) + .await, ); // current view @@ -55,7 +59,11 @@ async fn test_transaction_task_leader_two_views_in_a_row() { EpochNumber::new(1), vec1::vec1![ null_block::builder_fee::( - handle.hotshot.memberships.total_nodes(EpochNumber::new(0)).await, + handle + .hotshot + .memberships + .total_nodes(EpochNumber::new(0)) + .await, ::Base::VERSION, *ViewNumber::new(4), ) diff --git a/crates/testing/tests/tests_1/upgrade_task_with_proposal.rs b/crates/testing/tests/tests_1/upgrade_task_with_proposal.rs index 9656aac169..4de636ba0b 100644 --- a/crates/testing/tests/tests_1/upgrade_task_with_proposal.rs +++ b/crates/testing/tests/tests_1/upgrade_task_with_proposal.rs @@ -156,7 +156,8 @@ async fn test_upgrade_task_with_proposal() { &membership, ViewNumber::new(1), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), TestMetadata { num_transactions: 0 @@ -175,7 +176,8 @@ async fn test_upgrade_task_with_proposal() { &membership, ViewNumber::new(2), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[0].data.block_header.metadata, ViewNumber::new(2), @@ -193,7 +195,8 @@ async fn test_upgrade_task_with_proposal() { &membership, ViewNumber::new(3), EpochNumber::new(1) - ).await, + ) + .await, builder_commitment.clone(), proposals[1].data.block_header.metadata, ViewNumber::new(3), diff --git a/crates/testing/tests/tests_1/vid_task.rs b/crates/testing/tests/tests_1/vid_task.rs index 1aaaa066d4..25e9e4c559 100644 --- a/crates/testing/tests/tests_1/vid_task.rs +++ b/crates/testing/tests/tests_1/vid_task.rs @@ -51,7 +51,8 @@ async fn test_vid_task() { &membership, ViewNumber::new(0), EpochNumber::new(0), - ).await; + ) + .await; let transactions = vec![TestTransaction::new(vec![0])]; let (payload, metadata) = >::from_transactions( @@ -91,7 +92,8 @@ async fn test_vid_task() { vid_disperse, &membership, EpochNumber::new(0), - ).await; + ) + .await; let vid_proposal = Proposal { data: vid_disperse.clone(),