forked from cerc-io/laconicd-deprecated
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user