Skip to content

Commit

Permalink
add todo comments and rework the flow of test_consensus_with_vid_vote
Browse files Browse the repository at this point in the history
  • Loading branch information
dailinsubjam committed Dec 7, 2023
1 parent 830852b commit 471f6a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/task-impls/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, A: ConsensusApi<TYPES, I> +
}
}
HotShotEvent::DACRecv(cert) => {
debug!("DAC Recved for view ! {}", *cert.view_number);
debug!("DAC Received for view ! {}", *cert.view_number);
let view = cert.view_number;

self.quorum_network
Expand Down
10 changes: 8 additions & 2 deletions crates/testing/tests/consensus_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,26 @@ async fn test_consensus_with_vid_vote() {


input.push(HotShotEvent::ViewChange(ViewNumber::new(2)));
// Sishan TODO: this proposal_view2's justify_qc does not have correct view number
let proposal_view2 = build_quorum_proposal(&handle, &private_key_view2, 2).await;

// For the test of vote logic with vid
// Sishan TODO: Still need a valid DAC cert
input.push(HotShotEvent::VidDisperseRecv(vid_proposal.clone(), pub_key));

// Send a proposal, vote on said proposal, update view based on proposal QC, receive vote as next leader
input.push(HotShotEvent::QuorumProposalRecv(
proposal_view2.clone(),
public_key_view2,
));
// followings are for the test of vote logic with vid
input.push(HotShotEvent::VidDisperseRecv(vid_proposal.clone(), pub_key));

output.insert(
HotShotEvent::QuorumProposalRecv(proposal_view2.clone(), public_key_view2),
1,
);
output.insert(HotShotEvent::VidDisperseRecv(vid_proposal, pub_key), 1);

// Sishan TODO: Uncomment this after the above TODO is done
// if let GeneralConsensusMessage::Vote(vote) = build_vote(&handle, proposal_view2.data).await {
// output.insert(HotShotEvent::QuorumVoteSend(vote.clone()), 1);
// }
Expand Down

0 comments on commit 471f6a9

Please sign in to comment.