Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcrjson: Remove balance type from getbalance API #548

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions dcrjson/walletsvrcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,19 @@ 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
// getbalance JSON-RPC command.
//
// 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,
}
}

Expand Down
6 changes: 3 additions & 3 deletions dcrjson/walletsvrcmds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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{
Expand Down