mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
deleting whitespace and re-ordering args for test function
This commit is contained in:
parent
6e135ec0dc
commit
19f658d2ad
3 changed files with 4 additions and 7 deletions
|
|
@ -887,14 +887,12 @@ func retesteth(ctx *cli.Context) error {
|
|||
}
|
||||
vhosts := splitAndTrim(ctx.GlobalString(utils.RPCVirtualHostsFlag.Name))
|
||||
cors := splitAndTrim(ctx.GlobalString(utils.RPCCORSDomainFlag.Name))
|
||||
|
||||
// register apis and create handler stack
|
||||
srv := rpc.NewServer()
|
||||
|
||||
err := node.RegisterApisFromWhitelist(rpcAPI, []string{"test", "eth", "debug", "web3"}, srv, false)
|
||||
if err != nil {
|
||||
utils.Fatalf("Could not register RPC apis: %w", err)
|
||||
}
|
||||
|
||||
handler := node.NewHTTPHandlerStack(srv, cors, vhosts)
|
||||
// start http server
|
||||
var RetestethHTTPTimeouts = rpc.HTTPTimeouts{
|
||||
|
|
|
|||
|
|
@ -707,7 +707,6 @@ func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server
|
|||
if err := srv.RegisterName(api.Namespace, api.Service); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debug("HTTP registered", "namespace", api.Namespace)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -615,7 +615,7 @@ func TestWebsocketHTTPOnSamePort_WebsocketRequest(t *testing.T) {
|
|||
wsReq.Header.Set("Sec-Websocket-Key", "SGVsbG8sIHdvcmxkIQ==")
|
||||
|
||||
wsResponses := make(chan *http.Response)
|
||||
go doHTTPRequest(wsResponses, wsReq, t)
|
||||
go doHTTPRequest(t, wsResponses, wsReq)
|
||||
wsResponse := <-wsResponses
|
||||
|
||||
assert.Equal(t, "websocket", wsResponse.Header.Get("Upgrade"))
|
||||
|
|
@ -632,7 +632,7 @@ func TestWebsocketHTTPOnSamePort_HTTPRequest(t *testing.T) {
|
|||
httpReq.Header.Set("Accept-Encoding", "gzip")
|
||||
|
||||
httpResponses := make(chan *http.Response)
|
||||
go doHTTPRequest(httpResponses, httpReq, t)
|
||||
go doHTTPRequest(t, httpResponses, httpReq)
|
||||
httpResponse := <-httpResponses
|
||||
|
||||
assert.Equal(t, "gzip", httpResponse.Header.Get("Content-Encoding"))
|
||||
|
|
@ -653,7 +653,7 @@ func startHTTP(t *testing.T) *Node {
|
|||
return node
|
||||
}
|
||||
|
||||
func doHTTPRequest(responses chan *http.Response, req *http.Request, t *testing.T) {
|
||||
func doHTTPRequest(t *testing.T, responses chan *http.Response, req *http.Request) {
|
||||
client := &http.Client{}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
|
|
|
|||
Loading…
Reference in a new issue