fix lint failures with 1.31 (#5489)

This commit is contained in:
Marko
2020-10-22 13:36:08 +02:00
committed by Erik Grinaker
parent 51b8d3a153
commit 9379bc92fd
58 changed files with 98 additions and 144 deletions
-4
View File
@@ -38,9 +38,7 @@ const (
EventVote = "Vote"
)
///////////////////////////////////////////////////////////////////////////////
// ENCODING / DECODING
///////////////////////////////////////////////////////////////////////////////
// TMEventData implements events.EventData.
type TMEventData interface {
@@ -127,9 +125,7 @@ type EventDataValidatorSetUpdates struct {
ValidatorUpdates []*Validator `json:"validator_updates"`
}
///////////////////////////////////////////////////////////////////////////////
// PUBSUB
///////////////////////////////////////////////////////////////////////////////
const (
// EventTypeKey is a reserved composite key for event name.
+1 -1
View File
@@ -35,7 +35,7 @@ func TestBasicPartSet(t *testing.T) {
assert.True(t, partSet2.HasHeader(partSet.Header()))
for i := 0; i < int(partSet.Total()); i++ {
part := partSet.GetPart(i)
//t.Logf("\n%v", part)
// t.Logf("\n%v", part)
added, err := partSet2.AddPart(part)
if !added || err != nil {
t.Errorf("failed to add part %v, error: %v", i, err)
+1 -3
View File
@@ -39,9 +39,7 @@ func (pvs PrivValidatorsByAddress) Less(i, j int) bool {
}
func (pvs PrivValidatorsByAddress) Swap(i, j int) {
it := pvs[i]
pvs[i] = pvs[j]
pvs[j] = it
pvs[i], pvs[j] = pvs[j], pvs[i]
}
//----------------------------------------
-3
View File
@@ -708,9 +708,7 @@ func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID,
return nil
}
///////////////////////////////////////////////////////////////////////////////
// LIGHT CLIENT VERIFICATION METHODS
///////////////////////////////////////////////////////////////////////////////
// VerifyCommitLight verifies +2/3 of the set had signed the given commit.
//
@@ -1026,7 +1024,6 @@ func RandValidatorSet(numValidators int, votingPower int64) (*ValidatorSet, []Pr
return NewValidatorSet(valz), privValidators
}
///////////////////////////////////////////////////////////////////////////////
// safe addition/subtraction/multiplication
func safeAdd(a, b int64) (int64, bool) {
+2 -6
View File
@@ -1658,9 +1658,7 @@ func (valz validatorsByPriority) Less(i, j int) bool {
}
func (valz validatorsByPriority) Swap(i, j int) {
it := valz[i]
valz[i] = valz[j]
valz[j] = it
valz[i], valz[j] = valz[j], valz[i]
}
//-------------------------------------
@@ -1679,9 +1677,7 @@ func (tvals testValsByVotingPower) Less(i, j int) bool {
}
func (tvals testValsByVotingPower) Swap(i, j int) {
it := tvals[i]
tvals[i] = tvals[j]
tvals[j] = it
tvals[i], tvals[j] = tvals[j], tvals[i]
}
//-------------------------------------
+1 -1
View File
@@ -220,7 +220,7 @@ func (vote *Vote) ToProto() *tmproto.Vote {
}
}
//FromProto converts a proto generetad type to a handwritten type
// FromProto converts a proto generetad type to a handwritten type
// return type, nil if everything converts safely, otherwise nil, error
func VoteFromProto(pv *tmproto.Vote) (*Vote, error) {
if pv == nil {