rpc: clean up the RPCFunc constructor signature (#7586)

Instead of taking a comma-separated string of parameter names, take each
parameter name as a separate argument. Now that we no longer have an extra flag
for caching, this fits nicely into a variadic trailer.

* Update all usage of NewRPCFunc and NewWSRPCFunc.
This commit is contained in:
M. J. Fromberger
2022-01-13 12:13:28 -08:00
committed by GitHub
parent 8ff367ad29
commit b7c19a5cd4
9 changed files with 34 additions and 39 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func TestWebsocketManagerHandler(t *testing.T) {
func newWSServer(t *testing.T, logger log.Logger) *httptest.Server {
funcMap := map[string]*RPCFunc{
"c": NewWSRPCFunc(func(ctx context.Context, s string, i int) (string, error) { return "foo", nil }, "s,i"),
"c": NewWSRPCFunc(func(ctx context.Context, s string, i int) (string, error) { return "foo", nil }, "s", "i"),
}
wm := NewWebsocketManager(logger, funcMap)