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

@@ -93,7 +93,7 @@ func TestIsEvent(t *testing.T) {
func TestPair(t *testing.T) {
t.Parallel()
e := &Base{
CurrencyPair: currency.NewPair(currency.BTC, currency.USDT),
CurrencyPair: currency.NewBTCUSDT(),
}
y := e.Pair()
if y.IsEmpty() {
@@ -148,7 +148,7 @@ func TestGetBase(t *testing.T) {
func TestGetUnderlyingPair(t *testing.T) {
t.Parallel()
b1 := &Base{
UnderlyingPair: currency.NewPair(currency.BTC, currency.USDT),
UnderlyingPair: currency.NewBTCUSDT(),
}
if !b1.UnderlyingPair.Equal(b1.GetUnderlyingPair()) {
t.Errorf("expected '%v' received '%v'", b1.UnderlyingPair, b1.GetUnderlyingPair())

View File

@@ -44,7 +44,7 @@ func TestIsEmpty(t *testing.T) {
t.Parallel()
o := Order{
Base: &event.Base{
CurrencyPair: currency.NewPair(currency.BTC, currency.USDT),
CurrencyPair: currency.NewBTCUSDT(),
},
}
y := o.CurrencyPair
@@ -130,7 +130,7 @@ func TestGetSellLimit(t *testing.T) {
func TestPair(t *testing.T) {
t.Parallel()
cp := currency.NewPair(currency.BTC, currency.USDT)
cp := currency.NewBTCUSDT()
k := Order{
Base: &event.Base{
CurrencyPair: cp,