removed todos and changed http port in test once again to check travis build

This commit is contained in:
renaynay 2020-03-31 14:53:48 +02:00
parent 1772c8cbae
commit 7ce555dbd1
No known key found for this signature in database
GPG key ID: 731E44FAAFCD0274
2 changed files with 6 additions and 6 deletions

View file

@ -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 {

View file

@ -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)
}