mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-03-18 06:09:10 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user