Skip to content

Commit

Permalink
Merge pull request #190 from line/fix/set_proposer_selected_in_vrf_to…
Browse files Browse the repository at this point in the history
…_block

Add a test case to confirm that the selected Proposer matches the VRF-selected one
  • Loading branch information
torao authored Feb 24, 2021
2 parents 20e5c02 + d9d01ed commit cf85d26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1918,6 +1918,11 @@ func proposeBlock(t *testing.T, cs *State, round int, vssMap map[crypto.PubKey]*
if err := cs.SetProposalAndBlock(proposal, newBlock, blockParts, "some peer"); err != nil {
t.Fatal(err)
}

assert.Equal(t,
cs.Validators.SelectProposer(cs.state.LastProofHash, cs.Height, round).Address,
newBlock.ProposerAddress)

return types.BlockID{Hash: newBlock.Hash(), PartsHeader: blockParts.Header()}
}

Expand Down

0 comments on commit cf85d26

Please sign in to comment.