mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
currency: Fix edge case in NewCode where all string characters are digits (#1593)
* add fixes and test * glorious: nits, privatise upper case field, add item field for case sensitivity for format checks, rm dead code. * fix potential panic * gk/glorious: nits * gk: nits and other things * improve commentary lol * glorious+gk: nits and improvements (with no sillyness this time) * Update currency/pairs.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * thrasher: nitssssss * linter: fix * bye bye silly boy --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
@@ -112,7 +112,7 @@ func GetHoldings(exch string, creds *Credentials, assetType asset.Item) (Holding
|
||||
}
|
||||
assetHoldings.m.Lock()
|
||||
currencyBalances = append(currencyBalances, Balance{
|
||||
Currency: currency.Code{Item: mapKey.Currency, UpperCase: true},
|
||||
Currency: mapKey.Currency.Currency().Upper(),
|
||||
Total: assetHoldings.total,
|
||||
Hold: assetHoldings.hold,
|
||||
Free: assetHoldings.free,
|
||||
|
||||
@@ -1177,9 +1177,14 @@ func (b *Bitfinex) GetHistoricCandlesExtended(ctx context.Context, pair currency
|
||||
}
|
||||
|
||||
func (b *Bitfinex) fixCasing(in currency.Pair, a asset.Item) (string, error) {
|
||||
if in.IsEmpty() || in.Base.IsEmpty() {
|
||||
if in.Base.IsEmpty() {
|
||||
return "", currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
|
||||
// Convert input to lowercase to ensure consistent formatting.
|
||||
// Required for currencies that start with T or F eg tTNBUSD
|
||||
in = in.Lower()
|
||||
|
||||
var checkString [2]byte
|
||||
if a == asset.Spot || a == asset.Margin {
|
||||
checkString[0] = 't'
|
||||
|
||||
Reference in New Issue
Block a user