diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-06 03:44:30 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-06 03:44:30 +0800 |
commit | d00e2731e50f5b535e5deba63ea7f93168906712 (patch) | |
tree | ad910fd3335d5bc7b7741196b91e340d4322a503 /rpc/message.go | |
parent | db7c34a9df19d5a8a3a02a5e3d4cafcffa18dcb8 (diff) | |
parent | 429077a5a043ea6664f795ab34ad09ec2f65286f (diff) | |
download | go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar.gz go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar.bz2 go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar.lz go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar.xz go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.tar.zst go-tangerine-d00e2731e50f5b535e5deba63ea7f93168906712.zip |
Merge branch 'develop' of https://github.com/tgerring/go-ethereum into tgerring-develop
Conflicts:
rpc/http/server.go
Diffstat (limited to 'rpc/message.go')
-rw-r--r-- | rpc/message.go | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/rpc/message.go b/rpc/message.go index 0845a2239..e110bdf3e 100644 --- a/rpc/message.go +++ b/rpc/message.go @@ -33,30 +33,29 @@ const ( ErrorDecodeArgs = "Error: Could not decode arguments" ) -type ErrorResponse struct { - Error bool `json:"error"` - ErrorText string `json:"errorText"` +type RpcRequest struct { + JsonRpc string `json:"jsonrpc"` + ID int `json:"id"` + Method string `json:"method"` + Params []json.RawMessage `json:"params"` } type RpcSuccessResponse struct { ID int `json:"id"` JsonRpc string `json:"jsonrpc"` - Error bool `json:"error"` Result interface{} `json:"result"` } type RpcErrorResponse struct { - ID int `json:"id"` - JsonRpc string `json:"jsonrpc"` - Error bool `json:"error"` - ErrorText string `json:"errortext"` + ID *int `json:"id"` + JsonRpc string `json:"jsonrpc"` + Error *RpcErrorObject `json:"error"` } -type RpcRequest struct { - JsonRpc string `json:"jsonrpc"` - ID int `json:"id"` - Method string `json:"method"` - Params []json.RawMessage `json:"params"` +type RpcErrorObject struct { + Code int `json:"code"` + Message string `json:"message"` + // Data interface{} `json:"data"` } func NewErrorResponse(msg string) error { |