diff --git a/jsoncmd.go b/jsoncmd.go index 276ec907..be067c2e 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -2476,7 +2476,7 @@ func (cmd *GetNetworkHashPSCmd) UnmarshalJSON(b []byte) error { // unmarshaling of getnewaddress JSON RPC commands. type GetNewAddressCmd struct { id interface{} - Address string + Account string } // Enforce that GetNewAddressCmd satisifies the Cmd interface. @@ -2484,17 +2484,17 @@ var _ Cmd = &GetNewAddressCmd{} // NewGetNewAddressCmd creates a new GetNewAddressCmd. func NewGetNewAddressCmd(id interface{}, optArgs ...string) (*GetNewAddressCmd, error) { - var address string + var account string if len(optArgs) > 0 { if len(optArgs) > 1 { return nil, ErrTooManyOptArgs } - address = optArgs[0] + account = optArgs[0] } return &GetNewAddressCmd{ id: id, - Address: address, + Account: account, }, nil } @@ -2518,8 +2518,8 @@ func (cmd *GetNewAddressCmd) MarshalJSON() ([]byte, error) { Params: []interface{}{}, } - if cmd.Address != "" { - raw.Params = append(raw.Params, cmd.Address) + if cmd.Account != "" { + raw.Params = append(raw.Params, cmd.Account) } return json.Marshal(raw) } diff --git a/jsoncmd_test.go b/jsoncmd_test.go index f8206c16..48d97a9a 100644 --- a/jsoncmd_test.go +++ b/jsoncmd_test.go @@ -479,11 +479,11 @@ var jsoncmdtests = []struct { { name: "basic getnewaddress", f: func() (Cmd, error) { - return NewGetNewAddressCmd(float64(1), "address") + return NewGetNewAddressCmd(float64(1), "account") }, result: &GetNewAddressCmd{ id: float64(1), - Address: "address", + Account: "account", }, }, {