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

@@ -12,7 +12,7 @@ import (
func testSetup() Base {
return Base{
Exchange: "a",
Pair: currency.NewPair(currency.BTC, currency.USD),
Pair: currency.NewBTCUSD(),
Asks: []Tranche{
{Price: 7000, Amount: 1},
{Price: 7001, Amount: 2},

View File

@@ -31,7 +31,7 @@ func TestSubscribeToExchangeOrderbooks(t *testing.T) {
_, err := SubscribeToExchangeOrderbooks("")
assert.ErrorIs(t, err, ErrOrderbookNotFound)
p := currency.NewPair(currency.BTC, currency.USD)
p := currency.NewBTCUSD()
b := Base{
Pair: p,
@@ -51,7 +51,7 @@ func TestVerify(t *testing.T) {
b := Base{
Exchange: "TestExchange",
Asset: asset.Spot,
Pair: currency.NewPair(currency.BTC, currency.USD),
Pair: currency.NewBTCUSD(),
VerifyOrderbook: true,
}

View File

@@ -24,7 +24,7 @@ func TestSimulate(t *testing.T) {
},
}
o, err := b.UpdateOrderbook(t.Context(),
currency.NewPair(currency.BTC, currency.USD), asset.Spot)
currency.NewBTCUSD(), asset.Spot)
if err != nil {
t.Fatal(err)
}