mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 15:10:40 +00:00
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:
@@ -29,9 +29,9 @@ import (
|
||||
)
|
||||
|
||||
// GetDefaultConfig returns a default exchange config
|
||||
func (i *ItBit) GetDefaultConfig() (*config.ExchangeConfig, error) {
|
||||
func (i *ItBit) GetDefaultConfig() (*config.Exchange, error) {
|
||||
i.SetDefaults()
|
||||
exchCfg := new(config.ExchangeConfig)
|
||||
exchCfg := new(config.Exchange)
|
||||
exchCfg.Name = i.Name
|
||||
exchCfg.HTTPTimeout = exchange.DefaultHTTPTimeout
|
||||
exchCfg.BaseCurrencies = i.BaseCurrencies
|
||||
@@ -106,7 +106,7 @@ func (i *ItBit) SetDefaults() {
|
||||
}
|
||||
|
||||
// Setup sets the exchange parameters from exchange config
|
||||
func (i *ItBit) Setup(exch *config.ExchangeConfig) error {
|
||||
func (i *ItBit) Setup(exch *config.Exchange) error {
|
||||
if !exch.Enabled {
|
||||
i.SetEnabled(false)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user