return error if power is negative

Refs #1893
This commit is contained in:
Anton Kaliaev
2018-07-04 13:21:29 +04:00
parent dda8b67f37
commit c1aeb08e4b
2 changed files with 14 additions and 0 deletions

View File

@ -201,6 +201,16 @@ func TestUpdateValidators(t *testing.T) {
types.NewValidatorSet([]*types.Validator{val1}),
true,
},
{
"adding a validator with negative power results in error",
types.NewValidatorSet([]*types.Validator{val1}),
[]abci.Validator{{[]byte{}, types.TM2PB.PubKey(pubkey2), -100}},
types.NewValidatorSet([]*types.Validator{val1}),
true,
},
}
for _, tc := range testCases {