remove lowercase conversion of voucher addresses

This commit is contained in:
Alfred Kamanda 2026-02-16 09:06:53 +03:00
parent 43b963995f
commit f6ecbcc79d
Signed by: Alfred-mk
GPG Key ID: E60B2165A97F4D41
3 changed files with 6 additions and 7 deletions

View File

@ -111,7 +111,6 @@ func MinMpesaWithdrawAmount() float64 {
return f
}
func MaxMpesaSendAmount() float64 {
v := env.GetEnv("MAX_MPESA_SEND_AMOUNT", "250000")
f, err := strconv.ParseFloat(v, 64)
@ -135,7 +134,7 @@ func StableVoucherAddresses() []string {
list := strings.Split(raw, ",")
for _, addr := range list {
clean := strings.ToLower(strings.TrimSpace(addr))
clean := strings.TrimSpace(addr)
if clean != "" {
parsed = append(parsed, clean)
}

View File

@ -310,7 +310,7 @@ func (h *MenuHandlers) InitiatePayDebt(ctx context.Context, sym string, input []
}
func isStableVoucher(tokenAddress string) bool {
addr := strings.ToLower(strings.TrimSpace(tokenAddress))
addr := strings.TrimSpace(tokenAddress)
for _, stable := range config.StableVoucherAddresses() {
if addr == stable {
return true

View File

@ -152,7 +152,7 @@ func (h *MenuHandlers) ManageVouchers(ctx context.Context, sym string, input []b
stablePriority := make(map[string]int)
stableAddresses := config.StableVoucherAddresses()
for i, addr := range stableAddresses {
stablePriority[strings.ToLower(addr)] = i
stablePriority[addr] = i
}
// Helper: order vouchers (stable first, priority-based)
@ -169,8 +169,8 @@ func (h *MenuHandlers) ManageVouchers(ctx context.Context, sym string, input []b
}
sort.SliceStable(stable, func(i, j int) bool {
ai := stablePriority[strings.ToLower(stable[i].TokenAddress)]
aj := stablePriority[strings.ToLower(stable[j].TokenAddress)]
ai := stablePriority[stable[i].TokenAddress]
aj := stablePriority[stable[j].TokenAddress]
return ai < aj
})