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) {