mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
exchanges: shift GetDefaultConfig wrapper function to exchange.go (#1472)
* Shift wrapper function GetDefaultConfig to exchange.Base method definition, to ensure set defaults doesn't get called twice and to reduce code * rm alphapoint bootstrap method as is defined as exchange.Base method * add tests * glorious: make it a function and make it IBOTEXCHANGE --------- Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -36,29 +36,6 @@ const wsRateLimitMillisecond = 1000
|
||||
|
||||
var errNotEnoughPairs = errors.New("at least one currency is required to fetch order history")
|
||||
|
||||
// GetDefaultConfig returns a default exchange config
|
||||
func (b *Bithumb) GetDefaultConfig(ctx context.Context) (*config.Exchange, error) {
|
||||
b.SetDefaults()
|
||||
exchCfg, err := b.GetStandardConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = b.SetupDefaults(exchCfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.Features.Supports.RESTCapabilities.AutoPairUpdates {
|
||||
err = b.UpdateTradablePairs(ctx, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return exchCfg, nil
|
||||
}
|
||||
|
||||
// SetDefaults sets the basic defaults for Bithumb
|
||||
func (b *Bithumb) SetDefaults() {
|
||||
b.Name = "Bithumb"
|
||||
|
||||
Reference in New Issue
Block a user