Skip to content

Commit

Permalink
fixup! Config: Move assetEnabled upgrade to Version management
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Dec 9, 2024
1 parent db3521a commit 7ebe68e
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions backtester/eventhandlers/exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,32 +245,22 @@ func TestExecuteOrder(t *testing.T) {
em := engine.NewExchangeManager()
const testExchange = "binanceus"
exch, err := em.NewExchangeByName(testExchange)
if err != nil {
t.Fatal(err)
}
require.NoError(t, err, "NewExchangeByName must not error")
exch.SetDefaults()
exchB := exch.GetBase()
exchB.States = currencystate.NewCurrencyStates()
err = em.Add(exch)
if !errors.Is(err, nil) {
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
require.NoError(t, err, "ExchangeManager.Add exchange must not error")
bot.OrderManager, err = engine.SetupOrderManager(em, &engine.CommunicationManager{}, &bot.ServicesWG, &gctconfig.OrderManager{})
if !errors.Is(err, nil) {
t.Errorf("received: %v, expected: %v", err, nil)
}
require.NoError(t, err, "engine.SetupOrderManager must not error")
err = bot.OrderManager.Start()
if !errors.Is(err, nil) {
t.Errorf("received: %v, expected: %v", err, nil)
}
require.NoError(t, err, "OrderManager.Start must not error")

p := currency.NewPair(currency.BTC, currency.USDT)
a := asset.Spot
require.NoError(t, exchB.CurrencyPairs.SetAssetEnabled(a, true), "SetAssetEnabled must not error")
_, err = exch.FetchOrderbook(context.Background(), p, asset.Spot)
if err != nil {
t.Fatal(err)
}
require.NoError(t, err, "FetchOrderbook must not error")
f := &binanceus.Binanceus{}
f.Name = testExchange
cs := Settings{
Expand Down

0 comments on commit 7ebe68e

Please sign in to comment.