Add getaccountaddress support to btcctl.

This commit is contained in:
Josh Rickmar 2013-12-31 13:11:01 -05:00
parent f2a2744bec
commit 426db5ae21

View file

@ -49,6 +49,7 @@ var commandHandlers = map[string]*handlerData{
"decoderawtransaction": &handlerData{1, 0, displayJSONDump, nil, makeDecodeRawTransaction, "<txhash>"}, "decoderawtransaction": &handlerData{1, 0, displayJSONDump, nil, makeDecodeRawTransaction, "<txhash>"},
"dumpprivkey": &handlerData{1, 0, displayGeneric, nil, makeDumpPrivKey, "<bitcoinaddress>"}, "dumpprivkey": &handlerData{1, 0, displayGeneric, nil, makeDumpPrivKey, "<bitcoinaddress>"},
"getaccount": &handlerData{1, 0, displayGeneric, nil, makeGetAccount, "<address>"}, "getaccount": &handlerData{1, 0, displayGeneric, nil, makeGetAccount, "<address>"},
"getaccountaddress": &handlerData{1, 0, displayGeneric, nil, makeGetAccountAddress, "<account>"},
"getbalance": &handlerData{0, 2, displayGeneric, []conversionHandler{nil, toInt}, makeGetBalance, "[account] [minconf=1]"}, "getbalance": &handlerData{0, 2, displayGeneric, []conversionHandler{nil, toInt}, makeGetBalance, "[account] [minconf=1]"},
"getbestblockhash": &handlerData{0, 0, displayGeneric, nil, makeGetBestBlockHash, ""}, "getbestblockhash": &handlerData{0, 0, displayGeneric, nil, makeGetBestBlockHash, ""},
"getblock": &handlerData{1, 2, displayJSONDump, []conversionHandler{nil, toBool, toBool}, makeGetBlock, "<blockhash>"}, "getblock": &handlerData{1, 2, displayJSONDump, []conversionHandler{nil, toBool, toBool}, makeGetBlock, "<blockhash>"},
@ -173,6 +174,12 @@ func makeGetAccount(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetAccountCmd("btcctl", args[0].(string)) return btcjson.NewGetAccountCmd("btcctl", args[0].(string))
} }
// makeGetAccountAddress generates the cmd structure for
// getaccountaddress commands.
func makeGetAccountAddress(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetAccountAddressCmd("btcctl", args[0].(string))
}
// makeGetBalance generates the cmd structure for // makeGetBalance generates the cmd structure for
// getbalance commands. // getbalance commands.
func makeGetBalance(args []interface{}) (btcjson.Cmd, error) { func makeGetBalance(args []interface{}) (btcjson.Cmd, error) {