mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 07:26:48 +00:00
exchanges: improves GetDefaultConfig method (#1245)
* exchanges: Add function to get standard config * exchanges: add tests (cherry-pick here and above) * after pick stuff * cleanup --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -38,12 +38,12 @@ var errNotEnoughPairs = errors.New("at least one currency is required to fetch o
|
||||
// GetDefaultConfig returns a default exchange config
|
||||
func (b *Bithumb) GetDefaultConfig(ctx context.Context) (*config.Exchange, error) {
|
||||
b.SetDefaults()
|
||||
exchCfg := new(config.Exchange)
|
||||
exchCfg.Name = b.Name
|
||||
exchCfg.HTTPTimeout = exchange.DefaultHTTPTimeout
|
||||
exchCfg.BaseCurrencies = b.BaseCurrencies
|
||||
exchCfg, err := b.GetStandardConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err := b.SetupDefaults(exchCfg)
|
||||
err = b.SetupDefaults(exchCfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -179,14 +179,13 @@ func (b *Bithumb) Setup(exch *config.Exchange) error {
|
||||
return err
|
||||
}
|
||||
err = b.Websocket.Setup(&stream.WebsocketSetup{
|
||||
ExchangeConfig: exch,
|
||||
DefaultURL: wsEndpoint,
|
||||
RunningURL: ePoint,
|
||||
Connector: b.WsConnect,
|
||||
Subscriber: b.Subscribe,
|
||||
GenerateSubscriptions: b.GenerateSubscriptions,
|
||||
ConnectionMonitorDelay: exch.ConnectionMonitorDelay,
|
||||
Features: &b.Features.Supports.WebsocketCapabilities,
|
||||
ExchangeConfig: exch,
|
||||
DefaultURL: wsEndpoint,
|
||||
RunningURL: ePoint,
|
||||
Connector: b.WsConnect,
|
||||
Subscriber: b.Subscribe,
|
||||
GenerateSubscriptions: b.GenerateSubscriptions,
|
||||
Features: &b.Features.Supports.WebsocketCapabilities,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user