more review comments: require instead assert & wrap errors

This commit is contained in:
Ismail Khoffi
2018-12-03 12:03:50 +01:00
parent 50ac191f9d
commit f17c04c892
5 changed files with 40 additions and 33 deletions

View File

@ -13,6 +13,8 @@ import (
"testing"
"time"
"github.com/pkg/errors"
abcicli "github.com/tendermint/tendermint/abci/client"
abci "github.com/tendermint/tendermint/abci/types"
bc "github.com/tendermint/tendermint/blockchain"
@ -74,7 +76,7 @@ func NewValidatorStub(privValidator types.PrivValidator, valIndex int) *validato
func (vs *validatorStub) signVote(voteType types.SignedMsgType, hash []byte, header types.PartSetHeader) (*types.Vote, error) {
addr, err := vs.PrivValidator.GetAddress()
if err != nil {
return nil, err
return nil, errors.Wrap(err, "Error while retrieving private validator's address")
}
vote := &types.Vote{
ValidatorIndex: vs.Index,