linting
This commit is contained in:
@@ -38,7 +38,7 @@ func SendDirectionForRail(rail model.Rail) SendDirection {
|
||||
}
|
||||
|
||||
func IsGatewayEligible(gw *model.GatewayInstanceDescriptor, rail model.Rail, network, currency string, action model.RailOperation, dir SendDirection, amount decimal.Decimal) error {
|
||||
return model.IsGatewayEligible(gw, rail, network, currency, action, toGatewayDirection(sendDirection(dir)), amount)
|
||||
return model.IsGatewayEligible(gw, rail, network, currency, action, toGatewayDirection(dir), amount)
|
||||
}
|
||||
|
||||
func ParseRailValue(value string) model.Rail {
|
||||
|
||||
@@ -324,7 +324,7 @@ func makeMoney(currency string, value decimal.Decimal) *moneyv1.Money {
|
||||
|
||||
func ensureCurrency(m *moneyv1.Money, targetCurrency string, quote *oraclev1.Quote) (*moneyv1.Money, error) {
|
||||
if m == nil || strings.TrimSpace(targetCurrency) == "" {
|
||||
return nil, nil
|
||||
return nil, nil //nolint:nilnil // nil means no amount available for conversion
|
||||
}
|
||||
if strings.EqualFold(m.GetCurrency(), targetCurrency) {
|
||||
return cloneProtoMoney(m), nil
|
||||
@@ -334,12 +334,12 @@ func ensureCurrency(m *moneyv1.Money, targetCurrency string, quote *oraclev1.Quo
|
||||
|
||||
func convertWithQuote(m *moneyv1.Money, quote *oraclev1.Quote, targetCurrency string) (*moneyv1.Money, error) {
|
||||
if m == nil || quote == nil || quote.GetPair() == nil || quote.GetPrice() == nil {
|
||||
return nil, nil
|
||||
return nil, nil //nolint:nilnil // nil means conversion cannot be performed with available quote
|
||||
}
|
||||
base := strings.TrimSpace(quote.GetPair().GetBase())
|
||||
qt := strings.TrimSpace(quote.GetPair().GetQuote())
|
||||
if base == "" || qt == "" || strings.TrimSpace(targetCurrency) == "" {
|
||||
return nil, nil
|
||||
return nil, nil //nolint:nilnil // nil means conversion cannot be performed with incomplete pair
|
||||
}
|
||||
price, err := decimal.NewFromString(quote.GetPrice().GetValue())
|
||||
if err != nil || price.IsZero() {
|
||||
@@ -355,7 +355,7 @@ func convertWithQuote(m *moneyv1.Money, quote *oraclev1.Quote, targetCurrency st
|
||||
case strings.EqualFold(m.GetCurrency(), qt) && strings.EqualFold(targetCurrency, base):
|
||||
return makeMoney(targetCurrency, value.Div(price)), nil
|
||||
default:
|
||||
return nil, nil
|
||||
return nil, nil //nolint:nilnil // nil means quote pair does not match requested conversion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user