Review comments: @melekes suggestions

require instead of assert

Co-Authored-By: Liamsi <Ismail.Khoffi@gmail.com>
This commit is contained in:
Anton Kaliaev 2018-12-01 11:58:40 +01:00 committed by GitHub
parent 394edc9230
commit db04ff4896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ func TestStateProposerSelection2(t *testing.T) {
for i := 0; i < len(vss); i++ { for i := 0; i < len(vss); i++ {
prop := cs1.GetRoundState().Validators.GetProposer() prop := cs1.GetRoundState().Validators.GetProposer()
addr, err := vss[(i+round)%len(vss)].GetAddress() addr, err := vss[(i+round)%len(vss)].GetAddress()
assert.NoError(t, err) require.NoError(t, err)
correctProposer := addr correctProposer := addr
if !bytes.Equal(prop.Address, correctProposer) { if !bytes.Equal(prop.Address, correctProposer) {
panic(fmt.Sprintf("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) panic(fmt.Sprintf("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address))