linters: enable stylecheck (#4153)

Refs #3262
This commit is contained in:
Anton Kaliaev
2019-11-16 19:35:39 +04:00
committed by GitHub
parent 36ba1a8494
commit 3e1516b624
137 changed files with 590 additions and 589 deletions
+4 -4
View File
@@ -316,19 +316,19 @@ func TestSerialReap(t *testing.T) {
binary.BigEndian.PutUint64(txBytes, uint64(i))
res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes})
if err != nil {
t.Errorf("Client error committing tx: %v", err)
t.Errorf("client error committing tx: %v", err)
}
if res.IsErr() {
t.Errorf("Error committing tx. Code:%v result:%X log:%v",
t.Errorf("error committing tx. Code:%v result:%X log:%v",
res.Code, res.Data, res.Log)
}
}
res, err := appConnCon.CommitSync()
if err != nil {
t.Errorf("Client error committing: %v", err)
t.Errorf("client error committing: %v", err)
}
if len(res.Data) != 8 {
t.Errorf("Error committing. Hash:%X", res.Data)
t.Errorf("error committing. Hash:%X", res.Data)
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ import (
var (
// ErrTxInCache is returned to the client if we saw tx earlier
ErrTxInCache = errors.New("Tx already exists in cache")
ErrTxInCache = errors.New("tx already exists in cache")
)
// ErrTxTooLarge means the tx is too big to be sent in a message to other peers
+1 -1
View File
@@ -112,7 +112,7 @@ func PreCheckAminoMaxBytes(maxBytes int64) PreCheckFunc {
aminoOverhead := types.ComputeAminoOverhead(tx, 1)
txSize := int64(len(tx)) + aminoOverhead
if txSize > maxBytes {
return fmt.Errorf("Tx size (including amino overhead) is too big: %d, max: %d",
return fmt.Errorf("tx size (including amino overhead) is too big: %d, max: %d",
txSize, maxBytes)
}
return nil
+5 -5
View File
@@ -80,7 +80,7 @@ func waitForTxsOnReactors(t *testing.T, txs types.Txs, reactors []*Reactor) {
close(done)
}()
timer := time.After(TIMEOUT)
timer := time.After(Timeout)
select {
case <-timer:
t.Fatal("Timed out waiting for txs")
@@ -108,8 +108,8 @@ func ensureNoTxs(t *testing.T, reactor *Reactor, timeout time.Duration) {
}
const (
NUM_TXS = 1000
TIMEOUT = 120 * time.Second // ridiculously high because CircleCI is slow
NumTxs = 1000
Timeout = 120 * time.Second // ridiculously high because CircleCI is slow
)
func TestReactorBroadcastTxMessage(t *testing.T) {
@@ -129,7 +129,7 @@ func TestReactorBroadcastTxMessage(t *testing.T) {
// send a bunch of txs to the first reactor's mempool
// and wait for them all to be received in the others
txs := checkTxs(t, reactors[0].mempool, NUM_TXS, UnknownPeerID)
txs := checkTxs(t, reactors[0].mempool, NumTxs, UnknownPeerID)
waitForTxsOnReactors(t, txs, reactors)
}
@@ -145,7 +145,7 @@ func TestReactorNoBroadcastToSender(t *testing.T) {
// send a bunch of txs to the first reactor's mempool, claiming it came from peer
// ensure peer gets no txs
checkTxs(t, reactors[0].mempool, NUM_TXS, 1)
checkTxs(t, reactors[0].mempool, NumTxs, 1)
ensureNoTxs(t, reactors[1], 100*time.Millisecond)
}