Running goimports gofmt, gosimple, uncovert to fix lint issues

This commit is contained in:
Jitendra Bhurat 2020-06-03 11:48:38 -04:00
parent 26421dd4df
commit 164d32caf2
11 changed files with 33 additions and 34 deletions

View File

@ -17,7 +17,6 @@
package core
import (
"github.com/ethereum/go-ethereum/consensus/istanbul"
"math/big"
"reflect"
"sync"
@ -25,6 +24,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/istanbul"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
@ -327,19 +327,19 @@ func TestProcessBacklog(t *testing.T) {
roundChangePayload, _ := Encode(roundChange)
msgs := []*message{
&message{
{
Code: msgPreprepare,
Msg: prepreparePayload,
},
&message{
{
Code: msgPrepare,
Msg: subjectPayload,
},
&message{
{
Code: msgCommit,
Msg: subjectPayload,
},
&message{
{
Code: msgRoundChange,
Msg: roundChangePayload,
},

View File

@ -204,7 +204,7 @@ OUTER:
committedSeals := v0.committedMsgs[0].committedSeals
for _, validator := range r0.valSet.List() {
for _, seal := range committedSeals {
if bytes.Compare(validator.Address().Bytes(), seal[:common.AddressLength]) == 0 {
if bytes.Equal(validator.Address().Bytes(), seal[:common.AddressLength]) {
signedCount++
break
}

View File

@ -361,7 +361,7 @@ func validateMsgSignature(messages map[common.Address]*message, validateFn func(
if err != nil {
return err
}
if bytes.Compare(signerAdd.Bytes(), msg.Address.Bytes()) != 0 {
if !bytes.Equal(signerAdd.Bytes(), msg.Address.Bytes()) {
return errInvalidSigner
}
}

View File

@ -118,7 +118,7 @@ func (c *core) handleRoundChange(msg *message, src istanbul.Validator) error {
num := c.roundChangeSet.higherRoundMessages(cv.Round)
currentRoundMessages := c.roundChangeSet.getRCMessagesForGivenRound(cv.Round)
if num == int(c.valSet.F()+1) {
if num == c.valSet.F()+1 {
newRound := c.roundChangeSet.getMinRoundChange(cv.Round)
logger.Trace("Starting new Round", "round", newRound)
c.startNewRound(newRound)

View File

@ -18,13 +18,13 @@ package core
import (
"crypto/ecdsa"
"github.com/ethereum/go-ethereum/core/rawdb"
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/istanbul"
"github.com/ethereum/go-ethereum/consensus/istanbul/validator"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"

View File

@ -85,7 +85,6 @@ const (
msgPrepare
msgCommit
msgRoundChange
msgAll
)
type message struct {
@ -145,7 +144,7 @@ func (m *message) FromPayload(b []byte, validateFn func([]byte, []byte) (common.
if err != nil {
return err
}
if bytes.Compare(signerAdd.Bytes(), m.Address.Bytes()) != 0 {
if !bytes.Equal(signerAdd.Bytes(), m.Address.Bytes()) {
return errInvalidSigner
}
}