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:
@@ -398,9 +398,7 @@ func (d *dataChecker) FetchLatestData() (bool, error) {
|
||||
if !d.hasUpdatedFunding {
|
||||
err = d.UpdateFunding(false)
|
||||
if err != nil {
|
||||
if err != nil {
|
||||
log.Errorln(common.LiveStrategy, err)
|
||||
}
|
||||
log.Errorln(common.LiveStrategy, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,14 +145,16 @@ func (bt *BackTest) SetupFromConfig(cfg *config.Config, templatePath, output str
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
exch.SetDefaults()
|
||||
exchBase := exch.GetBase()
|
||||
exchBase.Verbose = cfg.DataSettings.VerboseExchangeRequests
|
||||
|
||||
var dc *gctconfig.Exchange
|
||||
dc, err = exch.GetDefaultConfig(context.TODO())
|
||||
dc, err = gctexchange.GetDefaultConfig(context.TODO(), exch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
exchBase := exch.GetBase()
|
||||
exchBase.Verbose = cfg.DataSettings.VerboseExchangeRequests
|
||||
|
||||
err = exch.Setup(dc)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user