remove lowercase conversion of voucher addresses
This commit is contained in:
parent
43b963995f
commit
f6ecbcc79d
@ -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)
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
})
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user