From 77316a003a160108a06e95abd8309cde7a330a5d Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Fri, 25 Oct 2013 17:47:11 +0100 Subject: [PATCH] fix method for getaccountaddress. and test dumpprivkey, dumpwallet, encryptwallet, getaccount and getaccountaddress --- jsoncmd.go | 2 +- jsoncmd_test.go | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/jsoncmd.go b/jsoncmd.go index 0fcf1ce9..86198ff7 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -1198,7 +1198,7 @@ func (cmd *GetAccountAddressCmd) MarshalJSON() ([]byte, error) { // Fill and marshal a RawCmd. return json.Marshal(RawCmd{ Jsonrpc: "1.0", - Method: "accountaddress", + Method: "getaccountaddress", Id: cmd.id, Params: []interface{}{ cmd.Account, diff --git a/jsoncmd_test.go b/jsoncmd_test.go index 67b93e45..eb462002 100644 --- a/jsoncmd_test.go +++ b/jsoncmd_test.go @@ -135,6 +135,61 @@ var jsoncmdtests = []struct { HexTx: "thisisahexidecimaltransaction", }, }, + { + name: "basic dumpprivkey", + f: func() (Cmd, error) { + return NewDumpPrivKeyCmd(float64(1), + "address") + }, + result: &DumpPrivKeyCmd{ + id: float64(1), + Address: "address", + }, + }, + { + name: "basic dumpwallet", + f: func() (Cmd, error) { + return NewDumpWalletCmd(float64(1), + "filename") + }, + result: &DumpWalletCmd{ + id: float64(1), + Filename: "filename", + }, + }, + { + name: "basic encryptwallet", + f: func() (Cmd, error) { + return NewEncryptWalletCmd(float64(1), + "passphrase") + }, + result: &EncryptWalletCmd{ + id: float64(1), + Passphrase: "passphrase", + }, + }, + { + name: "basic getaccount", + f: func() (Cmd, error) { + return NewGetAccountCmd(float64(1), + "address") + }, + result: &GetAccountCmd{ + id: float64(1), + Address: "address", + }, + }, + { + name: "basic getaccountaddress", + f: func() (Cmd, error) { + return NewGetAccountAddressCmd(float64(1), + "account") + }, + result: &GetAccountAddressCmd{ + id: float64(1), + Account: "account", + }, + }, { name: "basic ping", f: func() (Cmd, error) {