mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
chore: Improve code comments clarity (#2135)
Signed-off-by: stringscut <stringscut@outlook.jp>
This commit is contained in:
@@ -499,7 +499,7 @@ func (bt *BackTest) setupExchangeSettings(cfg *config.Config) (*exchange.Exchang
|
||||
if bt.LiveDataHandler == nil {
|
||||
err = bt.Funding.AddUSDTrackingData(klineData)
|
||||
if err != nil &&
|
||||
!errors.Is(err, trackingcurrencies.ErrCurrencyDoesNotContainsUSD) &&
|
||||
!errors.Is(err, trackingcurrencies.ErrCurrencyDoesNotContainUSD) &&
|
||||
!errors.Is(err, funding.ErrUSDTrackingDisabled) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@ import (
|
||||
var (
|
||||
// ErrCurrencyContainsUSD is raised when the currency already contains a USD equivalent
|
||||
ErrCurrencyContainsUSD = errors.New("currency already contains a USD equivalent")
|
||||
// ErrCurrencyDoesNotContainsUSD is raised when the currency does not contain a USD equivalent
|
||||
ErrCurrencyDoesNotContainsUSD = errors.New("currency does not contains a USD equivalent")
|
||||
errNilPairs = errors.New("cannot assess with nil available pairs")
|
||||
errNoMatchingPairUSDFound = errors.New("currency pair has no USD backed equivalent, cannot track price")
|
||||
errCurrencyNotFoundInPairs = errors.New("currency does not exist in available pairs")
|
||||
errNoMatchingBaseUSDFound = errors.New("base currency has no USD back equivalent, cannot track price")
|
||||
errNoMatchingQuoteUSDFound = errors.New("quote currency has no USD back equivalent, cannot track price")
|
||||
errNilPairsReceived = errors.New("nil tracking pairs received")
|
||||
errExchangeManagerRequired = errors.New("exchange manager required")
|
||||
// ErrCurrencyDoesNotContainUSD is raised when the currency does not contain a USD equivalent
|
||||
ErrCurrencyDoesNotContainUSD = errors.New("currency does not contain a USD equivalent")
|
||||
errNilPairs = errors.New("cannot assess with nil available pairs")
|
||||
errNoMatchingPairUSDFound = errors.New("currency pair has no USD backed equivalent, cannot track price")
|
||||
errCurrencyNotFoundInPairs = errors.New("currency does not exist in available pairs")
|
||||
errNoMatchingBaseUSDFound = errors.New("base currency has no USD back equivalent, cannot track price")
|
||||
errNoMatchingQuoteUSDFound = errors.New("quote currency has no USD back equivalent, cannot track price")
|
||||
errNilPairsReceived = errors.New("nil tracking pairs received")
|
||||
errExchangeManagerRequired = errors.New("exchange manager required")
|
||||
)
|
||||
|
||||
// rankedUSDs is a slice of USD tracked currencies
|
||||
|
||||
@@ -613,8 +613,8 @@ var unsupportedAssets = []asset.Item{
|
||||
var unsupportedExchangeNames = []string{
|
||||
"testexch",
|
||||
"bitflyer", // Bitflyer has many "ErrNotYetImplemented, which is true, but not what we care to test for here
|
||||
"btse", // TODO rm once timeout issues resolved
|
||||
"poloniex", // outdated API // TODO rm once updated
|
||||
"btse", // TODO rm once timeout issues resolved
|
||||
"poloniex", // outdated API // TODO rm once updated
|
||||
}
|
||||
|
||||
// cryptoChainPerExchange holds the deposit address chain per exchange
|
||||
|
||||
@@ -198,7 +198,7 @@ func StringSliceContainsInsensitive(haystack []string, needle string) bool {
|
||||
})
|
||||
}
|
||||
|
||||
// IsEnabled takes in a boolean param and returns a string if it is enabled
|
||||
// IsEnabled takes in a boolean param and returns a string if it is enabled
|
||||
// or disabled
|
||||
func IsEnabled(isEnabled bool) string {
|
||||
if isEnabled {
|
||||
|
||||
@@ -300,7 +300,7 @@ func (c *Coinmarketcap) GetCryptocurrencyOHLCLatest(currencyID int64) (Cryptocur
|
||||
return resp.Data, nil
|
||||
}
|
||||
|
||||
// GetCryptocurrencyLatestQuotes returns the latest market quote for 1 or more
|
||||
// GetCryptocurrencyLatestQuotes returns the latest market quote for 1 or more
|
||||
// cryptocurrencies.
|
||||
//
|
||||
// currencyID - refers to the coinmarketcap currency id
|
||||
|
||||
Reference in New Issue
Block a user