Skip to content

Commit

Permalink
Update node/actors/bft/src/testonly/ut_harness.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoffranca authored Nov 30, 2023
1 parent 6eba0bc commit c33a3b6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions node/actors/bft/src/testonly/ut_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,16 @@ impl UTHarness {

pub(crate) fn new_unfinalized_replica_prepare(&self) -> Signed<ConsensusMsg> {
self.new_current_replica_prepare(|msg| {
msg.high_qc = self.new_commit_qc(|high_qc| {
// Set view to the previous view since it needs to belong to an earlier view.
high_qc.view = msg.view.prev();
// Increment high_qc proposal number to create a discrepancy between the high_qc and the high_vote.
high_qc.proposal.number = high_qc.proposal.number.next();
let mut high_vote = ReplicaCommit {
protocol_version: validator::ProtocolVersion::EARLIEST,
view: self.consensus.replica.view.next(),
proposal: self.consensus.replica.high_qc.message.proposal,
};

high_vote.proposal.parent = high_vote.proposal.hash();
high_vote.proposal.number = high_vote.proposal.number.next();

msg.high_vote = high_vote;
});
})
}
Expand Down

0 comments on commit c33a3b6

Please sign in to comment.