Tests: Use currency.NewBTCUSD and NewBTCUSDT (#1895)

* Tests: Use currency.NewUSD and NewUSDT

Simple refactor to use the provided shortcut methods

* Github: Add CI check to ensure NewPair not used

Add a step to ensure NewPair(BTC, USD*) isn't used
This commit is contained in:
Gareth Kirwan
2025-05-07 03:32:06 +02:00
committed by GitHub
parent eda6015d73
commit 3caa149d8e
83 changed files with 555 additions and 542 deletions

View File

@@ -284,7 +284,7 @@ func TestCheckEventCondition(t *testing.T) {
err = em.Add(exch)
require.NoError(t, err, "ExchangeManager Add must not error")
_, err = m.Add(testExchange, ItemPrice, cond, currency.NewPair(currency.BTC, currency.USD), asset.Spot, action)
_, err = m.Add(testExchange, ItemPrice, cond, currency.NewBTCUSD(), asset.Spot, action)
require.NoError(t, err, "eventManager Add must not error")
m.m.Lock()
@@ -292,7 +292,7 @@ func TestCheckEventCondition(t *testing.T) {
assert.ErrorIs(t, err, ticker.ErrTickerNotFound)
m.m.Unlock()
_, err = exch.UpdateTicker(t.Context(), currency.NewPair(currency.BTC, currency.USD), asset.Spot)
_, err = exch.UpdateTicker(t.Context(), currency.NewBTCUSD(), asset.Spot)
require.NoError(t, err, "UpdateTicker must not error")
m.m.Lock()
@@ -310,7 +310,7 @@ func TestCheckEventCondition(t *testing.T) {
assert.ErrorIs(t, err, orderbook.ErrOrderbookNotFound)
m.m.Unlock()
_, err = exch.UpdateOrderbook(t.Context(), currency.NewPair(currency.BTC, currency.USD), asset.Spot)
_, err = exch.UpdateOrderbook(t.Context(), currency.NewBTCUSD(), asset.Spot)
require.NoError(t, err, "UpdateOrderbook must not error")
m.m.Lock()