Skip to content

Commit

Permalink
Additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cranktakular committed Jun 11, 2024
1 parent 44ff400 commit eec8a5d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 521 deletions.
12 changes: 7 additions & 5 deletions currency/pairs.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ func (p Pairs) Remove(pair Pair) (Pairs, error) {
return nil, fmt.Errorf("%s %w", pair, ErrPairNotFound)
}

// Add adds a specified pair to the list of pairs if it doesn't exist
func (p Pairs) Add(pair Pair) Pairs {
if p.Contains(pair, true) {
return p
// Add adds specified pairs to the list of pairs if they don't exist
func (p Pairs) Add(pairs ...Pair) Pairs {
for x := range pairs {
if p.Contains(pairs[x], true) {
continue
}
p = append(p, pairs[x])
}
p = append(p, pair)
return p
}

Expand Down
1 change: 0 additions & 1 deletion exchanges/coinbasepro/coinbasepro.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ var (
errNoWalletForCurrency = errors.New("no wallet found for currency, address creation impossible")
errChannelNameUnknown = errors.New("unknown channel name")
errNoWalletsReturned = errors.New("no wallets returned")
errUnknownEndpointLimit = errors.New("unknown endpoint limit")
errPayMethodNotFound = errors.New("payment method not found")
errUnknownL2DataType = errors.New("unknown l2update data type")
errUnknownSide = errors.New("unknown side")
Expand Down
2 changes: 1 addition & 1 deletion exchanges/coinbasepro/coinbasepro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ func TestProcessSnapshotUpdate(t *testing.T) {
}

func TestGenerateDefaultSubscriptions(t *testing.T) {
comparison := []subscription.Subscription{{Channel: "heartbeats"}, {Channel: "status"}, {Channel: "ticker"},
comparison := subscription.List{{Channel: "heartbeats"}, {Channel: "status"}, {Channel: "ticker"},
{Channel: "ticker_batch"}, {Channel: "candles"}, {Channel: "market_trades"}, {Channel: "level2"},
{Channel: "user"}}
for i := range comparison {
Expand Down
Loading

0 comments on commit eec8a5d

Please sign in to comment.