mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* 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>
34 lines
771 B
Go
34 lines
771 B
Go
package exchange_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
|
shared "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
|
|
)
|
|
|
|
type mockEx struct {
|
|
shared.CustomEx
|
|
flow chan int
|
|
}
|
|
|
|
func (m *mockEx) UpdateTradablePairs(context.Context) error {
|
|
m.flow <- 42
|
|
return nil
|
|
}
|
|
|
|
func TestBootstrap(t *testing.T) {
|
|
m := &mockEx{
|
|
shared.CustomEx{},
|
|
make(chan int, 1),
|
|
}
|
|
m.Features.Enabled.AutoPairUpdates = true
|
|
err := exchange.Bootstrap(t.Context(), m)
|
|
require.NoError(t, err, "Bootstrap must not error")
|
|
require.Len(t, m.flow, 1)
|
|
assert.Equal(t, 42, <-m.flow, "UpdateTradablePairs should be called on the exchange")
|
|
}
|