Files
gocryptotrader/exchanges/binance/binance_live_test.go
Ryan O'Hara-Reid 9f8b783c20 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>
2025-09-22 12:20:23 +10:00

50 lines
1.4 KiB
Go

//go:build mock_test_off
// This will build if build tag mock_test_off is parsed and will do live testing
// using all tests in (exchange)_test.go
package binance
import (
"context"
"log"
"os"
"testing"
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
"github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
testexch "github.com/thrasher-corp/gocryptotrader/internal/testing/exchange"
)
var mockTests = false
func TestMain(m *testing.M) {
e = new(Exchange)
if err := testexch.Setup(e); err != nil {
log.Fatalf("Binance Setup error: %s", err)
}
if apiKey != "" && apiSecret != "" {
e.API.AuthenticatedSupport = true
e.API.CredentialsValidator.RequiresBase64DecodeSecret = false
e.SetCredentials(apiKey, apiSecret, "", "", "", "")
}
if useTestNet {
for k, v := range map[exchange.URL]string{
exchange.RestUSDTMargined: testnetFutures,
exchange.RestCoinMargined: testnetFutures,
exchange.RestSpot: testnetSpotURL,
} {
if err := e.API.Endpoints.SetRunningURL(k.String(), v); err != nil {
log.Fatalf("Binance SetRunningURL error: %s", err)
}
}
}
e.Websocket.DataHandler = sharedtestvalues.GetWebsocketInterfaceChannelOverride()
log.Printf(sharedtestvalues.LiveTesting, e.Name)
if err := e.UpdateTradablePairs(context.Background()); err != nil {
log.Fatalf("Binance UpdateTradablePairs error: %s", err)
}
os.Exit(m.Run())
}