mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-17 23:21:21 +00:00
fix new linting errors
This commit is contained in:
committed by
Ethan Buchman
parent
414a8cb0ba
commit
6f3c05545d
2
Makefile
2
Makefile
@ -97,7 +97,7 @@ metalinter_test: ensure_tools
|
||||
--enable=varcheck \
|
||||
./...
|
||||
|
||||
#--enable=aligncheck \
|
||||
#--enable=maligned \
|
||||
#--enable=dupl \
|
||||
#--enable=errcheck \
|
||||
#--enable=goconst \
|
||||
|
@ -272,7 +272,7 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
|
||||
}
|
||||
|
||||
var nn int
|
||||
var res *TimedWALMessage
|
||||
var res *TimedWALMessage // nolint: gosimple
|
||||
res = wire.ReadBinary(&TimedWALMessage{}, bytes.NewBuffer(data), int(length), &nn, &err).(*TimedWALMessage)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to decode data: %v", err)
|
||||
|
@ -34,7 +34,7 @@ const (
|
||||
ValDir = "validators"
|
||||
CheckDir = "checkpoints"
|
||||
dirPerm = os.FileMode(0755)
|
||||
filePerm = os.FileMode(0644)
|
||||
//filePerm = os.FileMode(0644)
|
||||
)
|
||||
|
||||
type provider struct {
|
||||
|
@ -216,8 +216,7 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
select {
|
||||
case msg := <-cl.ResponsesCh:
|
||||
msg := <-cl.ResponsesCh
|
||||
if msg.Error != nil {
|
||||
return "", err
|
||||
|
||||
@ -229,7 +228,6 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
|
||||
}
|
||||
return result.Value, nil
|
||||
}
|
||||
}
|
||||
|
||||
func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
||||
params := map[string]interface{}{
|
||||
@ -240,8 +238,7 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
||||
select {
|
||||
case msg := <-cl.ResponsesCh:
|
||||
msg := <-cl.ResponsesCh
|
||||
if msg.Error != nil {
|
||||
return []byte{}, msg.Error
|
||||
|
||||
@ -253,7 +250,6 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
||||
}
|
||||
return result.Value, nil
|
||||
}
|
||||
}
|
||||
|
||||
func testWithWSClient(t *testing.T, cl *client.WSClient) {
|
||||
val := "acbd"
|
||||
@ -333,6 +329,11 @@ func TestWSNewWSRPCFunc(t *testing.T) {
|
||||
got := result.Value
|
||||
assert.Equal(t, got, val)
|
||||
}
|
||||
result := new(ResultEcho)
|
||||
err = json.Unmarshal(*msg.Result, result)
|
||||
require.Nil(t, err)
|
||||
got := result.Value
|
||||
assert.Equal(t, got, val)
|
||||
}
|
||||
|
||||
func TestWSHandlesArrayParams(t *testing.T) {
|
||||
@ -358,6 +359,11 @@ func TestWSHandlesArrayParams(t *testing.T) {
|
||||
got := result.Value
|
||||
assert.Equal(t, got, val)
|
||||
}
|
||||
result := new(ResultEcho)
|
||||
err = json.Unmarshal(*msg.Result, result)
|
||||
require.Nil(t, err)
|
||||
got := result.Value
|
||||
assert.Equal(t, got, val)
|
||||
}
|
||||
|
||||
// TestWSClientPingPong checks that a client & server exchange pings
|
||||
|
@ -11,7 +11,7 @@ type TxIndexer interface {
|
||||
|
||||
// AddBatch analyzes, indexes or stores a batch of transactions.
|
||||
// NOTE: We do not specify Index method for analyzing a single transaction
|
||||
// here because it bears heavy perfomance loses. Almost all advanced indexers
|
||||
// here because it bears heavy performance losses. Almost all advanced indexers
|
||||
// support batching.
|
||||
AddBatch(b *Batch) error
|
||||
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/state/txindex"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
db "github.com/tendermint/tmlibs/db"
|
||||
)
|
||||
|
||||
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).
|
||||
|
Reference in New Issue
Block a user