Skip to content

Commit

Permalink
fixup! Kucoin: Add Subscription batching
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Jul 12, 2024
1 parent b0133ff commit 4fe7234
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exchanges/subscription/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ func (m *mockEx) GetPairFormat(_ asset.Item, _ bool) (currency.PairFormat, error
return currency.PairFormat{Uppercase: true}, m.errFormat
}

func (m *mockEx) GetSubscriptionTemplate(_ *Subscription) (*template.Template, error) {
func (m *mockEx) GetSubscriptionTemplate(s *Subscription) (*template.Template, error) {
if s.Channel == "nil" {
return nil, nil
}
return template.New(m.tpl).
Funcs(template.FuncMap{
"assetName": func(a asset.Item) string {
Expand Down
3 changes: 3 additions & 0 deletions exchanges/subscription/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ func TestExpandTemplates(t *testing.T) {
require.Len(t, got, 1, "Must get back the one sub")
assert.Equal(t, "already happy", l[0].QualifiedChannel, "Should get back the one sub")
assert.NotSame(t, got, l, "Should get back a different actual list")

_, err = List{{Channel: "nil"}}.ExpandTemplates(e)
assert.ErrorIs(t, err, errInvalidTemplate, "Should get correct error on nil template")
}

0 comments on commit 4fe7234

Please sign in to comment.