Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Dec 14, 2024
1 parent 49ea897 commit cdfbd3c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 22 deletions.
12 changes: 10 additions & 2 deletions crates/testing/tests/tests_1/da_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
39 changes: 26 additions & 13 deletions crates/testing/tests/tests_1/quorum_proposal_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down
12 changes: 10 additions & 2 deletions crates/testing/tests/tests_1/transaction_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,7 +59,11 @@ async fn test_transaction_task_leader_two_views_in_a_row() {
EpochNumber::new(1),
vec1::vec1![
null_block::builder_fee::<TestConsecutiveLeaderTypes, TestVersions>(
handle.hotshot.memberships.total_nodes(EpochNumber::new(0)).await,
handle
.hotshot
.memberships
.total_nodes(EpochNumber::new(0))
.await,
<TestVersions as Versions>::Base::VERSION,
*ViewNumber::new(4),
)
Expand Down
9 changes: 6 additions & 3 deletions crates/testing/tests/tests_1/upgrade_task_with_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
Expand All @@ -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),
Expand Down
6 changes: 4 additions & 2 deletions crates/testing/tests/tests_1/vid_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) = <TestBlockPayload as BlockPayload<TestTypes>>::from_transactions(
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit cdfbd3c

Please sign in to comment.