[NOD-294] Fix golint in deploy.sh and fix all lint warnings (#380)

* [NOD-294] Fix golint in deploy.sh and fixed all lint errors

* [NOD-294] Fix typos in comments

* [NOD-294] Convert VirtualForTest into alias of *virtualBlock

* [NOD-294] Fixed some more typos in comments
This commit is contained in:
Svarog
2019-08-27 12:00:23 +03:00
committed by Ori Newman
parent c72b914050
commit 480b2ca07c
20 changed files with 60 additions and 28 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
@@ -48,7 +47,7 @@ func (s *server) start() error {
rpcClient, err := rpcclient.New(s.rpcConnConfig, nil)
if err != nil {
return errors.New(fmt.Sprintf("failed to create RPC client: %s", err))
return fmt.Errorf("failed to create RPC client: %s", err)
}
s.rpcClient = rpcClient
@@ -103,18 +102,18 @@ func (s *server) forwardRequest(request *http.Request) ([]byte, error) {
requestBody, err := ioutil.ReadAll(request.Body)
if err != nil {
return nil, errors.New(fmt.Sprintf("failed to read request body: %s", err))
return nil, fmt.Errorf("failed to read request body: %s", err)
}
var jsonRPCParams []json.RawMessage
err = json.Unmarshal(requestBody, &jsonRPCParams)
if err != nil {
return nil, errors.New(fmt.Sprintf("failed to parse params: %s", err))
return nil, fmt.Errorf("failed to parse params: %s", err)
}
response, err := s.rpcClient.RawRequest(jsonRPCMethod, jsonRPCParams)
if err != nil {
return nil, errors.New(fmt.Sprintf("request to rpc server failed: %s", err))
return nil, fmt.Errorf("request to rpc server failed: %s", err)
}
return response, nil

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/daglabs/btcd/btcec"
"github.com/daglabs/btcd/dagconfig"
"github.com/daglabs/btcd/signal"
@@ -11,7 +12,7 @@ import (
)
var (
activeNetParams *dagconfig.Params = &dagconfig.DevNetParams
activeNetParams = &dagconfig.DevNetParams
p2pkhAddress util.Address
secondaryAddress util.Address
privateKey *btcec.PrivateKey