mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 07:26:47 +00:00
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:
@@ -42,8 +42,8 @@ var testExchange = "Bitstamp"
|
||||
func CreateTestBot(tb testing.TB) *Engine {
|
||||
tb.Helper()
|
||||
cFormat := ¤cy.PairFormat{Uppercase: true}
|
||||
cp1 := currency.NewPair(currency.BTC, currency.USD)
|
||||
cp2 := currency.NewPair(currency.BTC, currency.USDT)
|
||||
cp1 := currency.NewBTCUSD()
|
||||
cp2 := currency.NewBTCUSDT()
|
||||
|
||||
pairs1 := map[asset.Item]*currency.PairStore{
|
||||
asset.Spot: {
|
||||
@@ -377,8 +377,8 @@ func TestGetSpecificAvailablePairs(t *testing.T) {
|
||||
CurrencyPairs: ¤cy.PairsManager{Pairs: map[asset.Item]*currency.PairStore{
|
||||
asset.Spot: {
|
||||
AssetEnabled: true,
|
||||
Enabled: currency.Pairs{currency.NewPair(currency.BTC, currency.USD), currency.NewPair(currency.BTC, c)},
|
||||
Available: currency.Pairs{currency.NewPair(currency.BTC, currency.USD), currency.NewPair(currency.BTC, c)},
|
||||
Enabled: currency.Pairs{currency.NewBTCUSD(), currency.NewPair(currency.BTC, c)},
|
||||
Available: currency.Pairs{currency.NewBTCUSD(), currency.NewPair(currency.BTC, c)},
|
||||
ConfigFormat: ¤cy.PairFormat{
|
||||
Uppercase: true,
|
||||
},
|
||||
@@ -390,7 +390,7 @@ func TestGetSpecificAvailablePairs(t *testing.T) {
|
||||
assetType := asset.Spot
|
||||
|
||||
result := e.GetSpecificAvailablePairs(true, true, true, true, assetType)
|
||||
btcUSD := currency.NewPair(currency.BTC, currency.USD)
|
||||
btcUSD := currency.NewBTCUSD()
|
||||
if !result.Contains(btcUSD, true) {
|
||||
t.Error("Unexpected result")
|
||||
}
|
||||
@@ -682,7 +682,7 @@ func TestMapCurrenciesByExchange(t *testing.T) {
|
||||
e := CreateTestBot(t)
|
||||
|
||||
pairs := []currency.Pair{
|
||||
currency.NewPair(currency.BTC, currency.USD),
|
||||
currency.NewBTCUSD(),
|
||||
currency.NewPair(currency.BTC, currency.EUR),
|
||||
}
|
||||
|
||||
@@ -956,11 +956,11 @@ func createDepositEngine(opts *fakeDepositExchangeOpts) *Engine {
|
||||
ps := currency.PairStore{
|
||||
AssetEnabled: true,
|
||||
Enabled: currency.Pairs{
|
||||
currency.NewPair(currency.BTC, currency.USDT),
|
||||
currency.NewBTCUSDT(),
|
||||
currency.NewPair(currency.XRP, currency.USDT),
|
||||
},
|
||||
Available: currency.Pairs{
|
||||
currency.NewPair(currency.BTC, currency.USDT),
|
||||
currency.NewBTCUSDT(),
|
||||
currency.NewPair(currency.XRP, currency.USDT),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user