stream/websocket: Consolidate fields by using exchange config pointer (#809)

* stream: add exchange config pointer to setup WebsocketSetup struct to reduce and consolidate setting of variables.

* config: reduce stutter

* config: reduce minor stutter

* glorious: nits addr.

* Update exchanges/stream/websocket.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* websocket: implement fix

* engine/helpers: fix test

* exchanges: fix after merge issues

* exchange_template: fix output

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
Ryan O'Hara-Reid
2021-10-20 15:45:06 +11:00
committed by GitHub
parent a70224d123
commit 099ffa1a60
53 changed files with 611 additions and 692 deletions

View File

@@ -29,9 +29,9 @@ import (
)
// GetDefaultConfig returns a default exchange config
func (e *EXMO) GetDefaultConfig() (*config.ExchangeConfig, error) {
func (e *EXMO) GetDefaultConfig() (*config.Exchange, error) {
e.SetDefaults()
exchCfg := new(config.ExchangeConfig)
exchCfg := new(config.Exchange)
exchCfg.Name = e.Name
exchCfg.HTTPTimeout = exchange.DefaultHTTPTimeout
exchCfg.BaseCurrencies = e.BaseCurrencies
@@ -123,7 +123,7 @@ func (e *EXMO) SetDefaults() {
}
// Setup takes in the supplied exchange configuration details and sets params
func (e *EXMO) Setup(exch *config.ExchangeConfig) error {
func (e *EXMO) Setup(exch *config.Exchange) error {
if !exch.Enabled {
e.SetEnabled(false)
return nil