aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/message.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-06 03:44:45 +0800
committerobscuren <geffobscura@gmail.com>2015-02-06 03:44:45 +0800
commitbcacaaa4f418d51751cd841a22a8455b165f2375 (patch)
treead910fd3335d5bc7b7741196b91e340d4322a503 /rpc/message.go
parentdb7c34a9df19d5a8a3a02a5e3d4cafcffa18dcb8 (diff)
parentd00e2731e50f5b535e5deba63ea7f93168906712 (diff)
downloaddexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar.gz
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar.bz2
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar.lz
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar.xz
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.tar.zst
dexon-bcacaaa4f418d51751cd841a22a8455b165f2375.zip
Merge branch 'tgerring-develop' into develop
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 {