mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-19 08:01:22 +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=varcheck \
|
||||||
./...
|
./...
|
||||||
|
|
||||||
#--enable=aligncheck \
|
#--enable=maligned \
|
||||||
#--enable=dupl \
|
#--enable=dupl \
|
||||||
#--enable=errcheck \
|
#--enable=errcheck \
|
||||||
#--enable=goconst \
|
#--enable=goconst \
|
||||||
|
@ -272,7 +272,7 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var nn int
|
var nn int
|
||||||
var res *TimedWALMessage
|
var res *TimedWALMessage // nolint: gosimple
|
||||||
res = wire.ReadBinary(&TimedWALMessage{}, bytes.NewBuffer(data), int(length), &nn, &err).(*TimedWALMessage)
|
res = wire.ReadBinary(&TimedWALMessage{}, bytes.NewBuffer(data), int(length), &nn, &err).(*TimedWALMessage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to decode data: %v", err)
|
return nil, fmt.Errorf("failed to decode data: %v", err)
|
||||||
|
@ -34,7 +34,7 @@ const (
|
|||||||
ValDir = "validators"
|
ValDir = "validators"
|
||||||
CheckDir = "checkpoints"
|
CheckDir = "checkpoints"
|
||||||
dirPerm = os.FileMode(0755)
|
dirPerm = os.FileMode(0755)
|
||||||
filePerm = os.FileMode(0644)
|
//filePerm = os.FileMode(0644)
|
||||||
)
|
)
|
||||||
|
|
||||||
type provider struct {
|
type provider struct {
|
||||||
|
@ -216,19 +216,17 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
msg := <-cl.ResponsesCh
|
||||||
case msg := <-cl.ResponsesCh:
|
if msg.Error != nil {
|
||||||
if msg.Error != nil {
|
return "", err
|
||||||
return "", err
|
|
||||||
|
|
||||||
}
|
|
||||||
result := new(ResultEcho)
|
|
||||||
err = json.Unmarshal(msg.Result, result)
|
|
||||||
if err != nil {
|
|
||||||
return "", nil
|
|
||||||
}
|
|
||||||
return result.Value, nil
|
|
||||||
}
|
}
|
||||||
|
result := new(ResultEcho)
|
||||||
|
err = json.Unmarshal(msg.Result, result)
|
||||||
|
if err != nil {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
return result.Value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
||||||
@ -240,19 +238,17 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
|
|||||||
return []byte{}, err
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
msg := <-cl.ResponsesCh
|
||||||
case msg := <-cl.ResponsesCh:
|
if msg.Error != nil {
|
||||||
if msg.Error != nil {
|
return []byte{}, msg.Error
|
||||||
return []byte{}, msg.Error
|
|
||||||
|
|
||||||
}
|
|
||||||
result := new(ResultEchoBytes)
|
|
||||||
err = json.Unmarshal(msg.Result, result)
|
|
||||||
if err != nil {
|
|
||||||
return []byte{}, nil
|
|
||||||
}
|
|
||||||
return result.Value, nil
|
|
||||||
}
|
}
|
||||||
|
result := new(ResultEchoBytes)
|
||||||
|
err = json.Unmarshal(msg.Result, result)
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, nil
|
||||||
|
}
|
||||||
|
return result.Value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func testWithWSClient(t *testing.T, cl *client.WSClient) {
|
func testWithWSClient(t *testing.T, cl *client.WSClient) {
|
||||||
@ -333,6 +329,11 @@ func TestWSNewWSRPCFunc(t *testing.T) {
|
|||||||
got := result.Value
|
got := result.Value
|
||||||
assert.Equal(t, got, val)
|
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) {
|
func TestWSHandlesArrayParams(t *testing.T) {
|
||||||
@ -358,6 +359,11 @@ func TestWSHandlesArrayParams(t *testing.T) {
|
|||||||
got := result.Value
|
got := result.Value
|
||||||
assert.Equal(t, got, val)
|
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
|
// TestWSClientPingPong checks that a client & server exchange pings
|
||||||
|
@ -11,7 +11,7 @@ type TxIndexer interface {
|
|||||||
|
|
||||||
// AddBatch analyzes, indexes or stores a batch of transactions.
|
// AddBatch analyzes, indexes or stores a batch of transactions.
|
||||||
// NOTE: We do not specify Index method for analyzing a single transaction
|
// 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.
|
// support batching.
|
||||||
AddBatch(b *Batch) error
|
AddBatch(b *Batch) error
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
|
|
||||||
"github.com/tendermint/tendermint/state/txindex"
|
"github.com/tendermint/tendermint/state/txindex"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
db "github.com/tendermint/tmlibs/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).
|
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).
|
||||||
|
Reference in New Issue
Block a user