Tests: Various race fixes and move TestFixtureToDataHandler (#1534)

* Tests: Move and simplify TestFixtureToDataHandler

* Currency: Fix PairsManager.Load breaking matcher

* Tests: Add multi-instance cache to UpdatePairsOnce

* Kraken: Fix TestUpdateTickers race error

Calling StorePairs on global instance can lead to race

* Bitfinex: Fix TestUpdateTickers racing intermittently

* Currency: Fix concurrent access to PM formats

* Currency: Fix SupportsAsset implementation

This should delegate entirely to PairManager's IsAssetSupported

* Okx: Fix PM intrusion, rm GetPairFromInstrumentID

* Exchange: Fix SetGlobalPairsManager to set asset enabled

* Bitflyer: Fix race on set TestGetCurrURL

TestGetCurrencyTradeURL would fail sometimes due to sequencing of
enabling futures but not having pairs for it.

* Tests: Simplify usage pattern for FixtureToDH
This commit is contained in:
Gareth Kirwan
2024-05-16 06:09:26 +02:00
committed by GitHub
parent 34ef09dad6
commit 7d1eecfa7e
19 changed files with 584 additions and 693 deletions

View File

@@ -3753,8 +3753,12 @@ func (g *Gateio) IsValidPairString(currencyPair string) bool {
if len(currencyPair) < 3 {
return false
}
if strings.Contains(currencyPair, g.CurrencyPairs.RequestFormat.Delimiter) {
result := strings.Split(currencyPair, g.CurrencyPairs.RequestFormat.Delimiter)
pf, err := g.CurrencyPairs.GetFormat(asset.Spot, true)
if err != nil {
return false
}
if strings.Contains(currencyPair, pf.Delimiter) {
result := strings.Split(currencyPair, pf.Delimiter)
return len(result) >= 2
}
return false