From fdff70c14cd455f8995262bd2e13faa1a3ada514 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Tue, 24 Mar 2020 21:48:00 +0100 Subject: [PATCH] fixed some TODOs --- cmd/geth/retesteth.go | 2 +- node/node.go | 2 +- rpc/endpoints.go | 2 -- rpc/http.go | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/geth/retesteth.go b/cmd/geth/retesteth.go index c5286d4355..43cb8191fb 100644 --- a/cmd/geth/retesteth.go +++ b/cmd/geth/retesteth.go @@ -848,7 +848,7 @@ func splitAndTrim(input string) []string { return result } -func retesteth(ctx *cli.Context) error { // TODO uncomment and fix test +func retesteth(ctx *cli.Context) error { log.Info("Welcome to retesteth!") // register signer API with server var ( diff --git a/node/node.go b/node/node.go index 4e75087a34..14a53d24ed 100644 --- a/node/node.go +++ b/node/node.go @@ -372,12 +372,12 @@ func (n *Node) startHTTP(endpoint string, apis []rpc.API, modules []string, cors srv := rpc.NewServer() - // TODO put this stuff in a separate function // Generate the whitelist based on the allowed modules whitelist := make(map[string]bool) for _, module := range modules { whitelist[module] = true } + // Register all the APIs exposed by the services for _, api := range apis { if whitelist[api.Namespace] || (len(whitelist) == 0 && api.Public) { diff --git a/rpc/endpoints.go b/rpc/endpoints.go index 30fbbb0033..a749735b47 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -58,7 +58,6 @@ func StartHTTPEndpoint(endpoint string, apis []API, modules []string, timeouts H return nil, err } - // TODO put timeout registration in separate function // Make sure timeout values are meaningful if timeouts.ReadTimeout < time.Second { log.Warn("Sanitizing invalid HTTP read timeout", "provided", timeouts.ReadTimeout, "updated", DefaultHTTPTimeouts.ReadTimeout) @@ -82,7 +81,6 @@ func StartHTTPEndpoint(endpoint string, apis []API, modules []string, timeouts H } go httpSrv.Serve(listener) - // go NewHTTPServer(cors, vhosts, timeouts, handler, handler.WebsocketHandler(wsOrigins)).Serve(listener) // TODO REMOVE return listener, err } diff --git a/rpc/http.go b/rpc/http.go index 3e5892c9a7..5ac3c689cf 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -298,7 +298,7 @@ func validateRequest(r *http.Request) (int, error) { return http.StatusUnsupportedMediaType, err } -// NewHTTPHandlerStack TODO document +// NewHTTPHandlerStack returns wrapped http-related handlers func NewHTTPHandlerStack(srv *Server, cors []string, vhosts []string) http.Handler { // Wrap the CORS-handler within a host-handler handler := newCorsHandler(srv, cors)