mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-05 15:47:07 +00:00
Errorf -> fmt.Errorf
This commit is contained in:
+2
-1
@@ -3,6 +3,7 @@ package state
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/account"
|
||||
. "github.com/tendermint/tendermint/common"
|
||||
@@ -20,7 +21,7 @@ func ExecBlock(s *State, block *types.Block, blockPartsHeader types.PartSetHeade
|
||||
// State.Hash should match block.StateHash
|
||||
stateHash := s.Hash()
|
||||
if !bytes.Equal(stateHash, block.StateHash) {
|
||||
return Errorf("Invalid state hash. Expected %X, got %X",
|
||||
return fmt.Errorf("Invalid state hash. Expected %X, got %X",
|
||||
stateHash, block.StateHash)
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -225,11 +225,11 @@ func (valSet *ValidatorSet) VerifyValidation(hash []byte, parts types.PartSetHea
|
||||
|
||||
// Validate
|
||||
if _, seen := seenValidators[string(val.Address)]; seen {
|
||||
return Errorf("Duplicate validator for commit %v for Validation %v", commit, v)
|
||||
return fmt.Errorf("Duplicate validator for commit %v for Validation %v", commit, v)
|
||||
}
|
||||
|
||||
if !val.PubKey.VerifyBytes(commitSignBytes, commit.Signature) {
|
||||
return Errorf("Invalid signature for commit %v for Validation %v", commit, v)
|
||||
return fmt.Errorf("Invalid signature for commit %v for Validation %v", commit, v)
|
||||
}
|
||||
|
||||
// Tally
|
||||
@@ -240,7 +240,7 @@ func (valSet *ValidatorSet) VerifyValidation(hash []byte, parts types.PartSetHea
|
||||
if talliedVotingPower > valSet.TotalVotingPower()*2/3 {
|
||||
return nil
|
||||
} else {
|
||||
return Errorf("insufficient voting power %v, needed %v",
|
||||
return fmt.Errorf("insufficient voting power %v, needed %v",
|
||||
talliedVotingPower, (valSet.TotalVotingPower()*2/3 + 1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user