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:
Ryan O'Hara-Reid
2023-09-18 11:45:02 +10:00
committed by GitHub
parent ade2d9c5d2
commit 1adbc99526
33 changed files with 430 additions and 345 deletions

View File

@@ -31,12 +31,12 @@ import (
// GetDefaultConfig returns a default exchange config
func (e *EXMO) GetDefaultConfig(ctx context.Context) (*config.Exchange, error) {
e.SetDefaults()
exchCfg := new(config.Exchange)
exchCfg.Name = e.Name
exchCfg.HTTPTimeout = exchange.DefaultHTTPTimeout
exchCfg.BaseCurrencies = e.BaseCurrencies
exchCfg, err := e.GetStandardConfig()
if err != nil {
return nil, err
}
err := e.SetupDefaults(exchCfg)
err = e.SetupDefaults(exchCfg)
if err != nil {
return nil, err
}