mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 23:16:53 +00:00
exchanges: Refactor UpdateTradablePairs method to remove forceUpdate parameter (#2043)
* Refactor UpdateTradablePairs method to remove forceUpdate parameter - Updated the signature of UpdateTradablePairs in multiple exchange wrappers to remove the forceUpdate boolean parameter. - Adjusted related test cases to reflect the change in method signature. - Ensured that the UpdatePairs method calls within UpdateTradablePairs no longer reference the removed parameter. * update exchange wrapper template * linter: fix * glorious: nits * thrasher/glorious: nits * Update exchanges/exchange_test.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/exchange_test.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/exchange_test.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * fix things * misc: fix * Update exchanges/exchange_test.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> --------- Co-authored-by: shazbert <ryan.oharareid@thrasher.io> Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
This commit is contained in:
@@ -48,7 +48,7 @@ func instantiateTradablePairs() {
|
||||
}
|
||||
}
|
||||
|
||||
err := e.UpdateTradablePairs(context.Background(), true)
|
||||
err := e.UpdateTradablePairs(context.Background())
|
||||
handleError("unable to UpdateTradablePairs", err)
|
||||
|
||||
setTradablePair := func(assetType asset.Item, p *currency.Pair) {
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestMain(m *testing.M) {
|
||||
log.Fatalf("Bybit MockHTTPInstance error: %s", err)
|
||||
}
|
||||
|
||||
if err := e.UpdateTradablePairs(context.Background(), true); err != nil {
|
||||
if err := e.UpdateTradablePairs(context.Background()); err != nil {
|
||||
log.Fatalf("Bybit unable to UpdateTradablePairs: %s", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -500,15 +500,14 @@ func getCategoryName(a asset.Item) string {
|
||||
|
||||
// UpdateTradablePairs updates the exchanges available pairs and stores
|
||||
// them in the exchanges config
|
||||
func (e *Exchange) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error {
|
||||
func (e *Exchange) UpdateTradablePairs(ctx context.Context) error {
|
||||
assetTypes := e.GetAssetTypes(true)
|
||||
for i := range assetTypes {
|
||||
pairs, err := e.FetchTradablePairs(ctx, assetTypes[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = e.UpdatePairs(pairs, assetTypes[i], false, forceUpdate)
|
||||
if err != nil {
|
||||
if err := e.UpdatePairs(pairs, assetTypes[i], false); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user