Skip to content

Commit

Permalink
Kraken: Add TestEnforceStandardChannelNames
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Aug 14, 2024
1 parent 8b5c377 commit b46a993
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions exchanges/kraken/kraken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1706,3 +1706,16 @@ func TestErrorResponse(t *testing.T) {
})
}
}

func TestEnforceStandardChannelNames(t *testing.T) {
for _, n := range []string{
krakenWsSpread, krakenWsTicker, subscription.TickerChannel, subscription.OrderbookChannel, subscription.CandlesChannel,
subscription.AllTradesChannel, subscription.MyTradesChannel, subscription.MyOrdersChannel,
} {
assert.NoError(t, enforceStandardChannelNames(&subscription.Subscription{Channel: n}), "Standard channel names and bespoke names should not error")
}
for _, n := range []string{krakenWsOrderbook, krakenWsOHLC, krakenWsTrade, krakenWsOwnTrades, krakenWsOpenOrders, krakenWsOrderbook + "-5"} {
err := enforceStandardChannelNames(&subscription.Subscription{Channel: n})
assert.ErrorIsf(t, err, subscription.ErrPrivateChannelName, "Private channel names should not be allowed for %s", n)
}
}

0 comments on commit b46a993

Please sign in to comment.