revert is_spent changes because booleans suddenly have a single state

present (doesn't matter if true or false) and missing.
TIL /s
This commit is contained in:
Niko Storni 2021-04-13 00:29:18 +02:00
parent e00cdd0237
commit ed51ece75c
2 changed files with 6 additions and 8 deletions

View file

@ -220,7 +220,7 @@ func (d *Client) AddressUnused(account *string) (*AddressUnusedResponse, error)
})
}
func (d *Client) ChannelList(account *string, page uint64, pageSize uint64, wid *string, isSpent bool) (*ChannelListResponse, error) {
func (d *Client) ChannelList(account *string, page uint64, pageSize uint64, wid *string) (*ChannelListResponse, error) {
if page == 0 {
return nil, errors.Err("pages start from 1")
}
@ -228,7 +228,6 @@ func (d *Client) ChannelList(account *string, page uint64, pageSize uint64, wid
return response, d.call(response, "channel_list", map[string]interface{}{
"account_id": account,
"page": page,
"is_spent": isSpent,
"page_size": pageSize,
"include_protobuf": true,
"wallet_id": wid,
@ -438,12 +437,11 @@ func (d *Client) AddressList(account *string, address *string, page uint64, page
return response, d.call(response, "address_list", structs.Map(args))
}
func (d *Client) StreamList(account *string, page uint64, pageSize uint64, isSpent bool) (*StreamListResponse, error) {
func (d *Client) StreamList(account *string, page uint64, pageSize uint64) (*StreamListResponse, error) {
response := new(StreamListResponse)
err := d.call(response, "stream_list", map[string]interface{}{
"account_id": account,
"include_protobuf": true,
"is_spent": isSpent,
"page": page,
"page_size": pageSize,
})

View file

@ -107,7 +107,7 @@ func TestClient_AddressUnused(t *testing.T) {
func TestClient_ChannelList(t *testing.T) {
d := NewClient("")
got, err := d.ChannelList(nil, 1, 50, nil, false)
got, err := d.ChannelList(nil, 1, 50, nil)
if err != nil {
t.Error(err)
return
@ -293,7 +293,7 @@ func TestClient_ClaimList(t *testing.T) {
func TestClient_StreamList(t *testing.T) {
_ = os.Setenv("BLOCKCHAIN_NAME", "lbrycrd_regtest")
d := NewClient("")
got, err := d.StreamList(nil, 1, 20, false)
got, err := d.StreamList(nil, 1, 20)
if err != nil {
t.Error(err)
return
@ -648,7 +648,7 @@ func TestClient_ChannelImport(t *testing.T) {
if err != nil {
t.Error(err)
}
channels, err := d.ChannelList(nil, 1, 50, nil, false)
channels, err := d.ChannelList(nil, 1, 50, nil)
if err != nil {
t.Error(err)
}
@ -690,7 +690,7 @@ func TestClient_ChannelImportWithWalletID(t *testing.T) {
if err != nil {
t.Error(err)
}
channels, err := d.ChannelList(nil, 1, 50, &wallet.ID, false)
channels, err := d.ChannelList(nil, 1, 50, &wallet.ID)
if err != nil {
t.Error(err)
}