From c8d0ada25ff374def9db7974355f1c03a4537124 Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 23 Jan 2017 14:05:18 -0500 Subject: [PATCH] dcrjson: Remove balance type from getbalance API --- dcrjson/walletsvrcmds.go | 13 +++++-------- dcrjson/walletsvrcmds_test.go | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dcrjson/walletsvrcmds.go b/dcrjson/walletsvrcmds.go index e526610824..0c75646020 100644 --- a/dcrjson/walletsvrcmds.go +++ b/dcrjson/walletsvrcmds.go @@ -123,9 +123,8 @@ func NewGetAddressesByAccountCmd(account string) *GetAddressesByAccountCmd { // GetBalanceCmd defines the getbalance JSON-RPC command. type GetBalanceCmd struct { - Account *string - MinConf *int `jsonrpcdefault:"1"` - BalanceType *string + Account *string + MinConf *int `jsonrpcdefault:"1"` } // NewGetBalanceCmd returns a new instance which can be used to issue a @@ -133,12 +132,10 @@ type GetBalanceCmd struct { // // The parameters which are pointers indicate they are optional. Passing nil // for optional parameters will use the default value. -func NewGetBalanceCmd(account *string, minConf *int, balType *string) *GetBalanceCmd { - +func NewGetBalanceCmd(account *string, minConf *int) *GetBalanceCmd { return &GetBalanceCmd{ - Account: account, - MinConf: minConf, - BalanceType: balType, + Account: account, + MinConf: minConf, } } diff --git a/dcrjson/walletsvrcmds_test.go b/dcrjson/walletsvrcmds_test.go index fe2f1d2a25..4a788487a2 100644 --- a/dcrjson/walletsvrcmds_test.go +++ b/dcrjson/walletsvrcmds_test.go @@ -174,7 +174,7 @@ func TestWalletSvrCmds(t *testing.T) { return dcrjson.NewCmd("getbalance") }, staticCmd: func() interface{} { - return dcrjson.NewGetBalanceCmd(nil, nil, nil) + return dcrjson.NewGetBalanceCmd(nil, nil) }, marshalled: `{"jsonrpc":"1.0","method":"getbalance","params":[],"id":1}`, unmarshalled: &dcrjson.GetBalanceCmd{ @@ -188,7 +188,7 @@ func TestWalletSvrCmds(t *testing.T) { return dcrjson.NewCmd("getbalance", "acct") }, staticCmd: func() interface{} { - return dcrjson.NewGetBalanceCmd(dcrjson.String("acct"), nil, nil) + return dcrjson.NewGetBalanceCmd(dcrjson.String("acct"), nil) }, marshalled: `{"jsonrpc":"1.0","method":"getbalance","params":["acct"],"id":1}`, unmarshalled: &dcrjson.GetBalanceCmd{ @@ -202,7 +202,7 @@ func TestWalletSvrCmds(t *testing.T) { return dcrjson.NewCmd("getbalance", "acct", 6) }, staticCmd: func() interface{} { - return dcrjson.NewGetBalanceCmd(dcrjson.String("acct"), dcrjson.Int(6), nil) + return dcrjson.NewGetBalanceCmd(dcrjson.String("acct"), dcrjson.Int(6)) }, marshalled: `{"jsonrpc":"1.0","method":"getbalance","params":["acct",6],"id":1}`, unmarshalled: &dcrjson.GetBalanceCmd{