Skip to content

Commit

Permalink
fix: TestStateProposerSelection0
Browse files Browse the repository at this point in the history
move `ensureProposal` before `GetRoundState`

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
  • Loading branch information
gfanton committed May 7, 2024
1 parent 51f40d5 commit f17c9b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tm2/pkg/bft/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ func TestStateProposerSelection0(t *testing.T) {
// Wait for new round so proposer is set.
ensureNewRound(newRoundCh, height, round)

// Wait for complete proposal.
ensureNewProposal(proposalCh, height, round)

// Commit a block and ensure proposer for the next height is correct.
prop := cs1.GetRoundState().Validators.GetProposer()
address := cs1.privValidator.GetPubKey().Address()
if prop.Address != address {
t.Fatalf("expected proposer to be validator %d. Got %X", 0, prop.Address)
}

// Wait for complete proposal.
ensureNewProposal(proposalCh, height, round)

rs := cs1.GetRoundState()
signAddVotes(cs1, types.PrecommitType, rs.ProposalBlock.Hash(), rs.ProposalBlockParts.Header(), vss[1:]...)

Expand Down

0 comments on commit f17c9b5

Please sign in to comment.