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
@@ -42,12 +42,12 @@ func (e *EventMeter) Call(callback string, args ...interface{}) {
}
}
type RpcClient struct {
type RPCClient struct {
Stubs map[string]interface{}
cdc *amino.Codec
}
func (c *RpcClient) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error) {
func (c *RPCClient) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error) {
s, ok := c.Stubs[method]
if !ok {
stdlog.Fatalf("Call to %s, but no stub is defined for it", method)
@@ -60,10 +60,10 @@ func (c *RpcClient) Call(method string, params map[string]interface{}, result in
return s, nil
}
func (c *RpcClient) Codec() *amino.Codec {
func (c *RPCClient) Codec() *amino.Codec {
return c.cdc
}
func (c *RpcClient) SetCodec(cdc *amino.Codec) {
func (c *RPCClient) SetCodec(cdc *amino.Codec) {
c.cdc = cdc
}
+1 -1
View File
@@ -224,7 +224,7 @@ func (m *Monitor) updateNumValidatorLoop() {
m.mtx.Lock()
nodesCount := len(m.Nodes)
m.mtx.Unlock()
if 0 == nodesCount {
if nodesCount == 0 {
time.Sleep(m.numValidatorsUpdateInterval)
continue
}
+2 -2
View File
@@ -67,9 +67,9 @@ func createValidatorNode(t *testing.T) (n *monitor.Node, emMock *mock.EventMeter
}
stubs["status"] = ctypes.ResultStatus{ValidatorInfo: ctypes.ValidatorInfo{PubKey: pubKey}}
cdc := amino.NewCodec()
rpcClientMock := &mock.RpcClient{Stubs: stubs}
rpcClientMock := &mock.RPCClient{Stubs: stubs}
rpcClientMock.SetCodec(cdc)
n = monitor.NewNodeWithEventMeterAndRpcClient("tcp://127.0.0.1:26657", emMock, rpcClientMock)
n = monitor.NewNodeWithEventMeterAndRPCClient("tcp://127.0.0.1:26657", emMock, rpcClientMock)
return
}
+3 -3
View File
@@ -50,10 +50,10 @@ func NewNode(rpcAddr string, options ...func(*Node)) *Node {
em := em.NewEventMeter(rpcAddr, UnmarshalEvent)
rpcClient := rpc_client.NewURIClient(rpcAddr) // HTTP client by default
rpcClient.SetCodec(cdc)
return NewNodeWithEventMeterAndRpcClient(rpcAddr, em, rpcClient, options...)
return NewNodeWithEventMeterAndRPCClient(rpcAddr, em, rpcClient, options...)
}
func NewNodeWithEventMeterAndRpcClient(
func NewNodeWithEventMeterAndRPCClient(
rpcAddr string,
em eventMeter,
rpcClient rpc_client.HTTPClient,
@@ -184,7 +184,7 @@ func (n *Node) RestartEventMeterBackoff() error {
attempt++
if attempt > maxRestarts {
return errors.New("Reached max restarts")
return errors.New("reached max restarts")
}
}
}
+2 -2
View File
@@ -85,10 +85,10 @@ func startValidatorNode(t *testing.T) (n *monitor.Node, emMock *mock.EventMeter)
}
stubs["status"] = ctypes.ResultStatus{ValidatorInfo: ctypes.ValidatorInfo{PubKey: pubKey}}
cdc := amino.NewCodec()
rpcClientMock := &mock.RpcClient{Stubs: stubs}
rpcClientMock := &mock.RPCClient{Stubs: stubs}
rpcClientMock.SetCodec(cdc)
n = monitor.NewNodeWithEventMeterAndRpcClient("tcp://127.0.0.1:26657", emMock, rpcClientMock)
n = monitor.NewNodeWithEventMeterAndRPCClient("tcp://127.0.0.1:26657", emMock, rpcClientMock)
err := n.Start()
require.Nil(t, err)