Compare commits
10 Commits
v1.4.4-rc.
...
cached_sym
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
398610924b
|
||
|
|
3fdb0e3426
|
||
| c18d40286e | |||
|
|
c2cf8e91e5
|
||
|
|
20cfb47940
|
||
|
|
03d6cbd429
|
||
|
|
ee41f73347
|
||
|
|
bafe3cc04e
|
||
|
|
308dc93a91
|
||
|
|
8d29c364c3
|
@@ -204,7 +204,7 @@ func (h *MenuHandlers) SwapMaxLimit(ctx context.Context, sym string, input []byt
|
||||
if err != nil {
|
||||
res.FlagSet = append(res.FlagSet, flag_api_call_error)
|
||||
logg.ErrorCtxf(ctx, "failed on GetSwapFromTokenMaxLimit", "error", err)
|
||||
return res, err
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// Scale down the amount
|
||||
|
||||
@@ -335,11 +335,12 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
|
||||
// Format the active balance amount to 2 decimal places
|
||||
formattedBalance, _ := store.TruncateDecimalString(string(activeBal), 2)
|
||||
|
||||
// If normal transaction, or if the sym is max_amount, return balance
|
||||
if string(transactionType) == "normal" || sym == "max_amount" {
|
||||
// If normal transaction, or if the sym is send_max_amount, return balance
|
||||
if string(transactionType) == "normal" || sym == "send_max_amount" {
|
||||
res.FlagReset = append(res.FlagReset, flag_swap_transaction)
|
||||
|
||||
res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym))
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ func TestMaxAmount(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
res, err := h.MaxAmount(ctx, "max_amount", []byte(""))
|
||||
res, err := h.MaxAmount(ctx, "send_max_amount", []byte(""))
|
||||
|
||||
if tt.expectedError {
|
||||
assert.Error(t, err)
|
||||
|
||||
@@ -85,7 +85,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
|
||||
ls.DbRs.AddLocalFunc("validate_recipient", appHandlers.ValidateRecipient)
|
||||
ls.DbRs.AddLocalFunc("transaction_reset", appHandlers.TransactionReset)
|
||||
ls.DbRs.AddLocalFunc("invite_valid_recipient", appHandlers.InviteValidRecipient)
|
||||
ls.DbRs.AddLocalFunc("max_amount", appHandlers.MaxAmount)
|
||||
ls.DbRs.AddLocalFunc("send_max_amount", appHandlers.MaxAmount)
|
||||
ls.DbRs.AddLocalFunc("credit_max_amount", appHandlers.MaxAmount)
|
||||
ls.DbRs.AddLocalFunc("validate_amount", appHandlers.ValidateAmount)
|
||||
ls.DbRs.AddLocalFunc("reset_transaction_amount", appHandlers.ResetTransactionAmount)
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{.max_amount}}
|
||||
{{.send_max_amount}}
|
||||
@@ -1,7 +1,8 @@
|
||||
LOAD reset_transaction_amount 10
|
||||
LOAD max_amount 160
|
||||
RELOAD max_amount
|
||||
MAP max_amount
|
||||
RELOAD reset_transaction_amount
|
||||
LOAD send_max_amount 0
|
||||
RELOAD send_max_amount
|
||||
MAP send_max_amount
|
||||
MOUT back 0
|
||||
HALT
|
||||
LOAD validate_amount 64
|
||||
@@ -9,7 +10,7 @@ RELOAD validate_amount
|
||||
CATCH api_failure flag_api_call_error 1
|
||||
CATCH invalid_amount flag_invalid_amount 1
|
||||
INCMP _ 0
|
||||
LOAD get_recipient 0
|
||||
LOAD get_recipient 100
|
||||
LOAD get_sender 64
|
||||
LOAD get_amount 32
|
||||
INCMP transaction_pin *
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{.max_amount}}
|
||||
{{.send_max_amount}}
|
||||
1
services/registration/swap_menu_swa
Normal file
1
services/registration/swap_menu_swa
Normal file
@@ -0,0 +1 @@
|
||||
Badilisha
|
||||
@@ -1,2 +1,2 @@
|
||||
Chagua nambari au ishara ya sarafu kubadilisha KWENDA:
|
||||
Chagua nambari au ishara ya sarafu unayotaka kupokea.
|
||||
{{.swap_to_list}}
|
||||
Reference in New Issue
Block a user