fixed some TODOs

This commit is contained in:
renaynay 2020-03-24 21:48:00 +01:00
parent 62bb958471
commit fdff70c14c
No known key found for this signature in database
GPG key ID: 731E44FAAFCD0274
4 changed files with 3 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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