diff --git a/jsonapi.go b/jsonapi.go index 68bb4045..0752a702 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -201,7 +201,7 @@ func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([ "getdifficulty", "getgenerate", "gethashespersec", "getinfo", "getmininginfo", "getpeerinfo", "getrawmempool", "keypoolrefill", "listaddressgroupings", "listlockunspent", - "stop", "walletlock": + "stop", "walletlock", "getbestblockhash": if len(args) > 0 { err = fmt.Errorf("Too many arguments for %s", message) return finalMessage, err @@ -246,7 +246,8 @@ func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([ } finalMessage, err = jsonWithArgs(message, id, args) // One optional string - case "getmemorypool", "getnewaddress", "getwork", "help": + case "getmemorypool", "getnewaddress", "getwork", "help", + "getrawchangeaddress": if len(args) > 1 { err = fmt.Errorf("Too many arguments for %s", message) return finalMessage, err @@ -798,7 +799,7 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) { "getconnetioncount", "getdifficulty", "gethashespersec", "setgenerate", "stop", "settxfee", "getaccount", "getnewaddress", "sendtoaddress", "createrawtransaction", - "sendrawtransaction": + "sendrawtransaction", "getbestblockhash", "getrawchangeaddress": err = json.Unmarshal(message, &result) // For anything else put it in an interface. All the data is still // there, just a little less convenient to deal with. diff --git a/jsonapi_test.go b/jsonapi_test.go index bc9076d2..24c076ca 100644 --- a/jsonapi_test.go +++ b/jsonapi_test.go @@ -170,6 +170,11 @@ var cmdtests = []struct { {"walletpassphrase", []interface{}{"test", 1}, true}, {"walletpassphrase", []interface{}{"test"}, false}, {"walletpassphrase", []interface{}{"test", "test"}, false}, + {"getrawchangeaddress", []interface{}{}, true}, + {"getrawchangeaddress", []interface{}{"something"}, true}, + {"getrawchangeaddress", []interface{}{"something", "test"}, false}, + {"getbestblockhash", []interface{}{}, true}, + {"getbestblockhash", []interface{}{"something"}, false}, {"fakecommand", nil, false}, }