fix method for getaccountaddress.
and test dumpprivkey, dumpwallet, encryptwallet, getaccount and getaccountaddress
This commit is contained in:
parent
bac5600145
commit
77316a003a
2 changed files with 56 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue