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

@@ -38,7 +38,7 @@ func TestSubscribeTicker(t *testing.T) {
t.Error("error cannot be nil")
}
p := currency.NewPair(currency.BTC, currency.USD)
p := currency.NewBTCUSD()
// force error
service.mux = nil
@@ -104,7 +104,7 @@ func TestSubscribeToExchangeTickers(t *testing.T) {
t.Error("error cannot be nil")
}
p := currency.NewPair(currency.BTC, currency.USD)
p := currency.NewBTCUSD()
err = ProcessTicker(&Price{
Pair: p,
@@ -279,7 +279,7 @@ func TestProcessTicker(t *testing.T) { // non-appending function to tickers
err = ProcessTicker(&Price{
ExchangeName: "Bitfinex",
Pair: currency.NewPair(currency.BTC, currency.USD),
Pair: currency.NewBTCUSD(),
AssetType: asset.Margin,
Bid: 1337,
Ask: 1337,
@@ -288,7 +288,7 @@ func TestProcessTicker(t *testing.T) { // non-appending function to tickers
err = ProcessTicker(&Price{
ExchangeName: "Bitfinex",
Pair: currency.NewPair(currency.BTC, currency.USD),
Pair: currency.NewBTCUSD(),
AssetType: asset.Margin,
Bid: 1338,
Ask: 1336,
@@ -299,7 +299,7 @@ func TestProcessTicker(t *testing.T) { // non-appending function to tickers
err = ProcessTicker(&Price{
ExchangeName: "Bitfinex",
Pair: currency.NewPair(currency.BTC, currency.USD),
Pair: currency.NewBTCUSD(),
AssetType: asset.MarginFunding,
Bid: 1338,
Ask: 1336,