Skip to content

Commit 5728dd3

Browse files
committed
rpc: fix success response encoding for null return value
The "result" field of JSON-RPC 2.0 responses was omitted if the result was nil, causing exceptions in web3.js.
1 parent 63e7648 commit 5728dd3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎rpc/json.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type JSONRequest struct {
4848
type JSONSuccessResponse struct {
4949
Version string `json:"jsonrpc"`
5050
Id int64 `json:"id"`
51-
Result interface{} `json:"result,omitempty"`
51+
Result interface{} `json:"result"`
5252
}
5353

5454
// JSON-RPC error object

0 commit comments

Comments
 (0)