Browse Source

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.
pull/7598/head
M. J. Fromberger 3 years ago
committed by GitHub
parent
commit
9409cdea55
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      test/fuzz/rpc/jsonrpc/server/handler.go

+ 4
- 1
test/fuzz/rpc/jsonrpc/server/handler.go View File

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


Loading…
Cancel
Save