aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/message.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-06 03:44:30 +0800
committerobscuren <geffobscura@gmail.com>2015-02-06 03:44:30 +0800
commitd00e2731e50f5b535e5deba63ea7f93168906712 (patch)
treead910fd3335d5bc7b7741196b91e340d4322a503 /rpc/message.go
parentdb7c34a9df19d5a8a3a02a5e3d4cafcffa18dcb8 (diff)
parent429077a5a043ea6664f795ab34ad09ec2f65286f (diff)
downloadgo-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.go25
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 {