Correct addnode's required argument type.

This commit is contained in:
John C. Vernaleo 2013-10-21 13:22:52 -04:00
parent 31489c15b3
commit 440f336d34
2 changed files with 4 additions and 4 deletions

View file

@ -283,7 +283,7 @@ func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([
}
finalMessage, err = jsonWithArgs(message, id, args)
// Two required strings
case "setaccount", "signmessage", "walletpassphrasechange":
case "setaccount", "signmessage", "walletpassphrasechange", "addnode":
if len(args) != 2 {
err = fmt.Errorf("Missing arguments for %s", message)
return finalMessage, err
@ -374,7 +374,7 @@ func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([
}
finalMessage, err = jsonWithArgs(message, id, args)
// One required string, one optional int
case "addnode", "getrawtransaction", "getreceivedbyaddress":
case "getrawtransaction", "getreceivedbyaddress":
if len(args) > 2 || len(args) == 0 {
err = fmt.Errorf("Wrong number of argument for %s", message)
return finalMessage, err

View file

@ -78,9 +78,9 @@ var cmdtests = []struct {
{"getbalance", []interface{}{1}, false},
{"addnode", nil, false},
{"addnode", []interface{}{1, 2, 3}, false},
{"addnode", []interface{}{"test"}, true},
{"addnode", []interface{}{"test", "test"}, true},
{"addnode", []interface{}{1}, false},
{"addnode", []interface{}{"test", 1}, true},
{"addnode", []interface{}{"test", 1}, false},
{"addnode", []interface{}{"test", 1.0}, false},
{"listreceivedbyaccount", nil, true},
{"listreceivedbyaccount", []interface{}{1, 2, 3}, false},