Fixed RPC tests. Changed some names.

This commit is contained in:
Jae Kwon
2015-04-01 13:23:20 -07:00
parent 25ab73a51a
commit bfb61fb539
9 changed files with 475 additions and 534 deletions

View File

@ -18,7 +18,7 @@ import (
)
func TestJSONStatus(t *testing.T) {
s := rpc.JSONRPC{
s := rpc.RPCRequest{
JSONRPC: "2.0",
Method: "status",
Params: []interface{}{},
@ -43,7 +43,7 @@ func TestJSONStatus(t *testing.T) {
Result core.ResponseStatus `json:"result"`
Error string `json:"error"`
Id string `json:"id"`
JSONRPC int `json:"jsonrpc"`
JSONRPC string `json:"jsonrpc"`
}
binary.ReadJSON(&response, body, &err)
if err != nil {
@ -56,7 +56,7 @@ func TestJSONStatus(t *testing.T) {
}
func TestJSONGenPriv(t *testing.T) {
s := rpc.JSONRPC{
s := rpc.RPCRequest{
JSONRPC: "2.0",
Method: "unsafe/gen_priv_account",
Params: []interface{}{},
@ -83,7 +83,7 @@ func TestJSONGenPriv(t *testing.T) {
Result core.ResponseGenPrivAccount `json:"result"`
Error string `json:"error"`
Id string `json:"id"`
JSONRPC int `json:"jsonrpc"`
JSONRPC string `json:"jsonrpc"`
}
binary.ReadJSON(&response, body, &err)
if err != nil {
@ -146,7 +146,7 @@ func TestJSONBroadcastTx(t *testing.T) {
Result core.ResponseBroadcastTx `json:"result"`
Error string `json:"error"`
Id string `json:"id"`
JSONRPC int `json:"jsonrpc"`
JSONRPC string `json:"jsonrpc"`
}
requestResponse(t, "broadcast_tx", url.Values{"tx": {string(b)}}, &response)
if response.Error != "" {