mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
tool/exchange_wrapper_coverage: fix regression and implement reflection (#837)
* cmd/tools/exchange: fix regression and implement reflection so as this can dynamically scale to our interface * exchanges: add comment and fix whoopsie * exchanges: fix linter issues * wrapper_cov_tool: add actual full interface method count to get a better perceived deployment * exchanges/tool: addr glorious nits * kraken: remove string in test * exchange_template_tool: fix tmpl issue
This commit is contained in:
@@ -107,6 +107,9 @@ func (i *ItBit) SetDefaults() {
|
||||
|
||||
// Setup sets the exchange parameters from exchange config
|
||||
func (i *ItBit) Setup(exch *config.Exchange) error {
|
||||
if err := exch.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
if !exch.Enabled {
|
||||
i.SetEnabled(false)
|
||||
return nil
|
||||
@@ -115,12 +118,16 @@ func (i *ItBit) Setup(exch *config.Exchange) error {
|
||||
}
|
||||
|
||||
// Start starts the ItBit go routine
|
||||
func (i *ItBit) Start(wg *sync.WaitGroup) {
|
||||
func (i *ItBit) Start(wg *sync.WaitGroup) error {
|
||||
if wg == nil {
|
||||
return fmt.Errorf("%T %w", wg, common.ErrNilPointer)
|
||||
}
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
i.Run()
|
||||
wg.Done()
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Run implements the ItBit wrapper
|
||||
@@ -505,6 +512,9 @@ func (i *ItBit) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withd
|
||||
|
||||
// GetFeeByType returns an estimate of fee based on type of transaction
|
||||
func (i *ItBit) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error) {
|
||||
if feeBuilder == nil {
|
||||
return 0, fmt.Errorf("%T %w", feeBuilder, common.ErrNilPointer)
|
||||
}
|
||||
if !i.AllowAuthenticatedRequest() && // Todo check connection status
|
||||
feeBuilder.FeeType == exchange.CryptocurrencyTradeFee {
|
||||
feeBuilder.FeeType = exchange.OfflineTradeFee
|
||||
|
||||
Reference in New Issue
Block a user