From 45158f8b8ff6904a6862995daf58c6e80386bc7d Mon Sep 17 00:00:00 2001 From: Javed Khan Date: Mon, 10 Nov 2014 22:06:27 +0530 Subject: [PATCH] Updated to add createnewaccount, renameaccount --- cmd/btcctl/btcctl.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/btcctl/btcctl.go b/cmd/btcctl/btcctl.go index dbf2b91b..a284b8cb 100644 --- a/cmd/btcctl/btcctl.go +++ b/cmd/btcctl/btcctl.go @@ -51,6 +51,7 @@ var commandHandlers = map[string]*handlerData{ "addmultisigaddress": {2, 1, displayGeneric, []conversionHandler{toInt, nil, nil}, makeAddMultiSigAddress, " <[\"pubkey\",...]> [account]"}, "addnode": {2, 0, displayJSONDump, nil, makeAddNode, " "}, "createencryptedwallet": {1, 0, displayGeneric, nil, makeCreateEncryptedWallet, ""}, + "createnewaccount": {1, 0, displayGeneric, nil, makeCreateNewAccount, ""}, "createrawtransaction": {2, 0, displayGeneric, nil, makeCreateRawTransaction, outpointArrayStr + " " + "\"{\"address\":amount,...}\""}, "debuglevel": {1, 0, displayGeneric, nil, makeDebugLevel, ""}, "decoderawtransaction": {1, 0, displayJSONDump, nil, makeDecodeRawTransaction, ""}, @@ -103,6 +104,7 @@ var commandHandlers = map[string]*handlerData{ "listunspent": {0, 3, displayJSONDump, []conversionHandler{toInt, toInt, nil}, makeListUnspent, "[minconf=1] [maxconf=9999999] [jsonaddressarray]"}, "lockunspent": {1, 2, displayJSONDump, []conversionHandler{toBool, nil}, makeLockUnspent, " " + outpointArrayStr}, "ping": {0, 0, displayGeneric, nil, makePing, ""}, + "renameaccount": {2, 0, displayGeneric, nil, makeRenameAccount, " "}, "sendfrom": {3, 3, displayGeneric, []conversionHandler{nil, nil, toSatoshi, toInt, nil, nil}, makeSendFrom, "
[minconf=1] [comment] [comment-to]"}, "sendmany": {2, 2, displayGeneric, []conversionHandler{nil, nil, toInt, nil}, makeSendMany, " <{\"address\":amount,...}> [minconf=1] [comment]"}, @@ -241,6 +243,12 @@ func makeCreateEncryptedWallet(args []interface{}) (btcjson.Cmd, error) { return btcws.NewCreateEncryptedWalletCmd("btcctl", args[0].(string)), nil } +// makeCreateNewAccount generates the cmd structure for +// createnewaccount commands. +func makeCreateNewAccount(args []interface{}) (btcjson.Cmd, error) { + return btcws.NewCreateNewAccountCmd("btcctl", args[0].(string)), nil +} + // makeCreateRawTransaction generates the cmd structure for createrawtransaction // commands. func makeCreateRawTransaction(args []interface{}) (btcjson.Cmd, error) { @@ -715,6 +723,13 @@ func makePing(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewPingCmd("btcctl") } +// makeRenameAccount generates the cmd structure for +// renameaccount commands. +func makeRenameAccount(args []interface{}) (btcjson.Cmd, error) { + return btcws.NewRenameAccountCmd("btcctl", args[0].(string), + args[1].(string)), nil +} + // makeSendFrom generates the cmd structure for sendfrom commands. func makeSendFrom(args []interface{}) (btcjson.Cmd, error) { var optargs = make([]interface{}, 0, 3)