diff --git a/node/node.go b/node/node.go index c1696207ae..b60cb9681c 100644 --- a/node/node.go +++ b/node/node.go @@ -372,7 +372,7 @@ func (n *Node) startHTTP(endpoint string, apis []rpc.API, modules []string, cors srv := rpc.NewServer() err := RegisterApisFromWhitelist(apis, modules, srv, false) if err != nil { - return err // TODO this should return upon failure, right? + return err } handler := NewHTTPHandlerStack(srv, cors, vhosts) // wrap handler in websocket handler only if websocket port is the same as http rpc @@ -422,7 +422,7 @@ func (n *Node) startWS(endpoint string, apis []rpc.API, modules []string, wsOrig handler := srv.WebsocketHandler(wsOrigins) err := RegisterApisFromWhitelist(apis, modules, srv, exposeAll) if err != nil { - return err // TODO this should return upon failure, right? + return err } listener, err := startWSEndpoint(endpoint, handler) if err != nil { diff --git a/node/node_test.go b/node/node_test.go index f1edb32202..63ba07cf56 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -604,7 +604,7 @@ func TestAPIGather(t *testing.T) { func TestWebsocketHTTPOnSamePort_WebsocketRequest(t *testing.T) { startHTTP(t) - wsReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8545", nil) + wsReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:7453", nil) if err != nil { t.Error("could not issue new http request ", err) } @@ -623,7 +623,7 @@ func TestWebsocketHTTPOnSamePort_WebsocketRequest(t *testing.T) { func TestWebsocketHTTPOnSamePort_HTTPRequest(t *testing.T) { startHTTP(t) - httpReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8545", nil) + httpReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:7453", nil) if err != nil { t.Error("could not issue new http request ", err) } @@ -637,13 +637,13 @@ func TestWebsocketHTTPOnSamePort_HTTPRequest(t *testing.T) { } func startHTTP(t *testing.T) { - conf := &Config{HTTPPort: 8545, WSPort: 8545} + conf := &Config{HTTPPort: 7453, WSPort: 7453} node, err := New(conf) if err != nil { t.Error("could not create a new node ", err) } - err = node.startHTTP("127.0.0.1:8545", []rpc.API{}, []string{}, []string{}, []string{}, rpc.HTTPTimeouts{}, []string{}) + err = node.startHTTP("127.0.0.1:7453", []rpc.API{}, []string{}, []string{}, []string{}, rpc.HTTPTimeouts{}, []string{}) if err != nil { t.Error("could not start http service on node ", err) }