add a CATCH when one cannot swap from the current pool
This commit is contained in:
parent
bfef77e20e
commit
9646cc2955
@ -36,7 +36,7 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
|
||||
inputStr := string(input)
|
||||
if inputStr == "0" || inputStr == "99" || inputStr == "88" || inputStr == "98" {
|
||||
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher)
|
||||
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher, flag_incorrect_pool)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -142,6 +142,7 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
|
||||
if !canSwap.CanSwapFrom { // pool issue (CATCH on .vis)
|
||||
res.FlagSet = append(res.FlagSet, flag_incorrect_pool)
|
||||
res.Content = "0"
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -199,6 +200,8 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [
|
||||
maxKshFormatted,
|
||||
)
|
||||
|
||||
res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher, flag_incorrect_pool)
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ INCMP quit 99
|
||||
LOAD get_mpesa_max_limit 89
|
||||
RELOAD get_mpesa_max_limit
|
||||
CATCH . flag_incorrect_voucher 1
|
||||
CATCH low_withdraw_mpesa_amount flag_incorrect_pool 1
|
||||
CATCH low_withdraw_mpesa_amount flag_low_swap_amount 1
|
||||
CATCH low_withdraw_mpesa_amount flag_api_call_error 1
|
||||
INCMP mpesa_max_limit *
|
||||
|
||||
Loading…
Reference in New Issue
Block a user