|
|
|
@ -18,7 +18,7 @@ package ethash |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"encoding/json" |
|
|
|
|
"io/ioutil" |
|
|
|
|
"io" |
|
|
|
|
"math/big" |
|
|
|
|
"net/http" |
|
|
|
|
"net/http/httptest" |
|
|
|
@ -37,7 +37,7 @@ func TestRemoteNotify(t *testing.T) { |
|
|
|
|
// Start a simple web server to capture notifications.
|
|
|
|
|
sink := make(chan [3]string) |
|
|
|
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { |
|
|
|
|
blob, err := ioutil.ReadAll(req.Body) |
|
|
|
|
blob, err := io.ReadAll(req.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("failed to read miner notification: %v", err) |
|
|
|
|
} |
|
|
|
@ -80,7 +80,7 @@ func TestRemoteNotifyFull(t *testing.T) { |
|
|
|
|
// Start a simple web server to capture notifications.
|
|
|
|
|
sink := make(chan map[string]interface{}) |
|
|
|
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { |
|
|
|
|
blob, err := ioutil.ReadAll(req.Body) |
|
|
|
|
blob, err := io.ReadAll(req.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("failed to read miner notification: %v", err) |
|
|
|
|
} |
|
|
|
@ -125,7 +125,7 @@ func TestRemoteMultiNotify(t *testing.T) { |
|
|
|
|
// Start a simple web server to capture notifications.
|
|
|
|
|
sink := make(chan [3]string, 64) |
|
|
|
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { |
|
|
|
|
blob, err := ioutil.ReadAll(req.Body) |
|
|
|
|
blob, err := io.ReadAll(req.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("failed to read miner notification: %v", err) |
|
|
|
|
} |
|
|
|
@ -170,7 +170,7 @@ func TestRemoteMultiNotifyFull(t *testing.T) { |
|
|
|
|
// Start a simple web server to capture notifications.
|
|
|
|
|
sink := make(chan map[string]interface{}, 64) |
|
|
|
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { |
|
|
|
|
blob, err := ioutil.ReadAll(req.Body) |
|
|
|
|
blob, err := io.ReadAll(req.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("failed to read miner notification: %v", err) |
|
|
|
|
} |
|
|
|
|