From 9409cdea551923cbf7ae52e12489f9dd887a556c Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Fri, 14 Jan 2022 06:41:57 -0800 Subject: [PATCH] rpc: update fuzz criteria to match the implementation (#7595) I missed this during my previous pass. Requirements for handlers: - First argument is context.Context. - Last of two results is error. --- test/fuzz/rpc/jsonrpc/server/handler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/fuzz/rpc/jsonrpc/server/handler.go b/test/fuzz/rpc/jsonrpc/server/handler.go index e6dc577d7..92b02329f 100644 --- a/test/fuzz/rpc/jsonrpc/server/handler.go +++ b/test/fuzz/rpc/jsonrpc/server/handler.go @@ -2,6 +2,7 @@ package server import ( "bytes" + "context" "encoding/json" "io" "net/http" @@ -13,7 +14,9 @@ import ( ) var rpcFuncMap = map[string]*rs.RPCFunc{ - "c": rs.NewRPCFunc(func(s string, i int) (string, int) { return "foo", 200 }, "s", "i"), + "c": rs.NewRPCFunc(func(ctx context.Context, s string, i int) (string, error) { + return "foo", nil + }, "s", "i"), } var mux *http.ServeMux