all: linter (#532)

* add additional linters

* fixes

* rm action
This commit is contained in:
Federico Kunze Küllmer
2021-09-05 11:03:06 +00:00
committed by GitHub
parent c7554e96aa
commit 26c5eabb18
61 changed files with 150 additions and 194 deletions
-1
View File
@@ -581,7 +581,6 @@ func TestEth_GetTransactionReceipt_ContractDeployment(t *testing.T) {
require.NotEqual(t, common.Address{}.String(), receipt["contractAddress"].(string))
require.NotNil(t, receipt["logs"])
}
func getTransactionReceipt(t *testing.T, hash hexutil.Bytes) map[string]interface{} {
+4 -7
View File
@@ -2,6 +2,7 @@ package rpc
import (
"bytes"
"context"
"encoding/hex"
"encoding/json"
"fmt"
@@ -35,9 +36,7 @@ type Response struct {
Result json.RawMessage `json:"result,omitempty"`
}
var (
HOST = os.Getenv("HOST")
)
var HOST = os.Getenv("HOST")
func GetAddress() ([]byte, error) {
rpcRes, err := CallWithError("eth_accounts", []string{})
@@ -69,12 +68,11 @@ func Call(t *testing.T, method string, params interface{}) *Response {
var rpcRes *Response
time.Sleep(1 * time.Second)
/* #nosec */
if HOST == "" {
HOST = "http://localhost:8545"
}
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req)) // nolint:gosec
res, err := http.NewRequestWithContext(context.Background(), "POST", HOST, bytes.NewBuffer(req))
require.NoError(t, err)
decoder := json.NewDecoder(res.Body)
@@ -97,12 +95,11 @@ func CallWithError(method string, params interface{}) (*Response, error) {
var rpcRes *Response
time.Sleep(1 * time.Second)
/* #nosec */
if HOST == "" {
HOST = "http://localhost:8545"
}
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req)) // nolint:gosec
res, err := http.NewRequestWithContext(context.Background(), "POST", HOST, bytes.NewBuffer(req))
if err != nil {
return nil, err
}