Closed MarinX closed 1 year ago
Is there a test that can updated/added to verify this and ensure that we don't have any regressions in the future? (also need to fix the conflict)
Going to close this PR request because it's wrong.
The difference between jsonrpc 1 and jsonrpc 2 is that params may be omitted
The package rpc/v2/json2 contains a client which omits that field (readme also points rpc/v2 support for JSON-RPC 2.0 Specification
) .
I was just using the wrong client (1.0) instead of the correct one(2.0)
Fixes #54
Summary of Changes
When calling method with args nil, the interface marshals into
null
, which gives usparams: [null]
and RPC server that does not require parameter will yield error. This fix sets the params only if args are not nil, otherwise it will be an empty interface which will give usparams: []