aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/json.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-06-11 18:58:17 +0800
committerGitHub <noreply@github.com>2018-06-11 18:58:17 +0800
commit9f7592c802838b5be7b95b3b8b063178813bb3bb (patch)
tree4447ef6273f11e11653beb316b8904c5d9ef0851 /rpc/json.go
parent1d666cf27ec366a967d9afa0e8a370cb4cf33481 (diff)
parent99483e85b92e07078291442bf1cd4c0db22a262d (diff)
downloaddexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar.gz
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar.bz2
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar.lz
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar.xz
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.tar.zst
dexon-9f7592c802838b5be7b95b3b8b063178813bb3bb.zip
Merge pull request #16942 from karalabe/rpc-nil-reply
rpc: support returning nil pointer big.Ints (null)
Diffstat (limited to 'rpc/json.go')
-rw-r--r--rpc/json.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/rpc/json.go b/rpc/json.go
index 837011f51..a523eeb8e 100644
--- a/rpc/json.go
+++ b/rpc/json.go
@@ -320,9 +320,6 @@ func parsePositionalArguments(rawArgs json.RawMessage, types []reflect.Type) ([]
// CreateResponse will create a JSON-RPC success response with the given id and reply as result.
func (c *jsonCodec) CreateResponse(id interface{}, reply interface{}) interface{} {
- if isHexNum(reflect.TypeOf(reply)) {
- return &jsonSuccessResponse{Version: jsonrpcVersion, Id: id, Result: fmt.Sprintf(`%#x`, reply)}
- }
return &jsonSuccessResponse{Version: jsonrpcVersion, Id: id, Result: reply}
}
@@ -340,11 +337,6 @@ func (c *jsonCodec) CreateErrorResponseWithInfo(id interface{}, err Error, info
// CreateNotification will create a JSON-RPC notification with the given subscription id and event as params.
func (c *jsonCodec) CreateNotification(subid, namespace string, event interface{}) interface{} {
- if isHexNum(reflect.TypeOf(event)) {
- return &jsonNotification{Version: jsonrpcVersion, Method: namespace + notificationMethodSuffix,
- Params: jsonSubscription{Subscription: subid, Result: fmt.Sprintf(`%#x`, event)}}
- }
-
return &jsonNotification{Version: jsonrpcVersion, Method: namespace + notificationMethodSuffix,
Params: jsonSubscription{Subscription: subid, Result: event}}
}