Compare commits
4 Commits
0791eb1f11
...
e832f46d22
Author | SHA1 | Date | |
---|---|---|---|
e832f46d22 | |||
039117f40e | |||
3532f72fbd | |||
04c7e20457 |
@ -1403,7 +1403,7 @@ func (h *MenuHandlers) CheckAccountStatus(ctx context.Context, sym string, input
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
res.FlagSet = append(res.FlagSet, flag_api_error)
|
res.FlagSet = append(res.FlagSet, flag_api_error)
|
||||||
logg.ErrorCtxf(ctx, "failed on TrackAccountStatus", "error", err)
|
logg.ErrorCtxf(ctx, "failed on TrackAccountStatus", "error", err)
|
||||||
return res, err
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
res.FlagReset = append(res.FlagReset, flag_api_error)
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
@ -1569,6 +1569,7 @@ func (h *MenuHandlers) ValidateRecipient(ctx context.Context, sym string, input
|
|||||||
}
|
}
|
||||||
flag_invalid_recipient, _ := h.flagManager.GetFlag("flag_invalid_recipient")
|
flag_invalid_recipient, _ := h.flagManager.GetFlag("flag_invalid_recipient")
|
||||||
flag_invalid_recipient_with_invite, _ := h.flagManager.GetFlag("flag_invalid_recipient_with_invite")
|
flag_invalid_recipient_with_invite, _ := h.flagManager.GetFlag("flag_invalid_recipient_with_invite")
|
||||||
|
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
||||||
|
|
||||||
recipient := string(input)
|
recipient := string(input)
|
||||||
|
|
||||||
@ -1642,10 +1643,13 @@ func (h *MenuHandlers) ValidateRecipient(ctx context.Context, sym string, input
|
|||||||
logg.InfoCtxf(ctx, "Resolving with fqdn alias", "alias", fqdn)
|
logg.InfoCtxf(ctx, "Resolving with fqdn alias", "alias", fqdn)
|
||||||
AliasAddress, err = h.accountService.CheckAliasAddress(ctx, fqdn)
|
AliasAddress, err = h.accountService.CheckAliasAddress(ctx, fqdn)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
AliasAddressResult = AliasAddress.Address
|
AliasAddressResult = AliasAddress.Address
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_api_error)
|
||||||
logg.ErrorCtxf(ctx, "failed to resolve alias", "alias", recipient, "error_alias_check", err)
|
logg.ErrorCtxf(ctx, "failed to resolve alias", "alias", recipient, "error_alias_check", err)
|
||||||
|
return res, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2038,6 +2042,7 @@ func (h *MenuHandlers) CheckVouchers(ctx context.Context, sym string, input []by
|
|||||||
if !ok {
|
if !ok {
|
||||||
return res, fmt.Errorf("missing session")
|
return res, fmt.Errorf("missing session")
|
||||||
}
|
}
|
||||||
|
flag_api_error, _ := h.flagManager.GetFlag("flag_api_call_error")
|
||||||
|
|
||||||
userStore := h.userdataStore
|
userStore := h.userdataStore
|
||||||
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
||||||
@ -2049,8 +2054,10 @@ func (h *MenuHandlers) CheckVouchers(ctx context.Context, sym string, input []by
|
|||||||
// Fetch vouchers from the API using the public key
|
// Fetch vouchers from the API using the public key
|
||||||
vouchersResp, err := h.accountService.FetchVouchers(ctx, string(publicKey))
|
vouchersResp, err := h.accountService.FetchVouchers(ctx, string(publicKey))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_api_error)
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
|
|
||||||
logg.InfoCtxf(ctx, "fetched user vouchers", "public_key", string(publicKey), "vouchers", vouchersResp)
|
logg.InfoCtxf(ctx, "fetched user vouchers", "public_key", string(publicKey), "vouchers", vouchersResp)
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ MOUT back 0
|
|||||||
HALT
|
HALT
|
||||||
LOAD validate_amount 64
|
LOAD validate_amount 64
|
||||||
RELOAD validate_amount
|
RELOAD validate_amount
|
||||||
CATCH api_failure flag_api_call_error 1
|
|
||||||
CATCH invalid_amount flag_invalid_amount 1
|
CATCH invalid_amount flag_invalid_amount 1
|
||||||
INCMP _ 0
|
INCMP _ 0
|
||||||
LOAD get_recipient 0
|
LOAD get_recipient 0
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
MOUT retry 1
|
MOUT retry 1
|
||||||
MOUT quit 9
|
MOUT quit 9
|
||||||
HALT
|
HALT
|
||||||
INCMP _ 1
|
INCMP ^ 1
|
||||||
INCMP quit 9
|
INCMP quit 9
|
||||||
|
@ -4,6 +4,7 @@ LOAD set_default_voucher 8
|
|||||||
RELOAD set_default_voucher
|
RELOAD set_default_voucher
|
||||||
LOAD check_vouchers 10
|
LOAD check_vouchers 10
|
||||||
RELOAD check_vouchers
|
RELOAD check_vouchers
|
||||||
|
CATCH api_failure flag_api_call_error 1
|
||||||
LOAD check_balance 128
|
LOAD check_balance 128
|
||||||
RELOAD check_balance
|
RELOAD check_balance
|
||||||
CATCH api_failure flag_api_call_error 1
|
CATCH api_failure flag_api_call_error 1
|
||||||
|
@ -5,6 +5,7 @@ MOUT back 0
|
|||||||
HALT
|
HALT
|
||||||
LOAD validate_recipient 50
|
LOAD validate_recipient 50
|
||||||
RELOAD validate_recipient
|
RELOAD validate_recipient
|
||||||
|
CATCH api_failure flag_api_call_error 1
|
||||||
CATCH invalid_recipient flag_invalid_recipient 1
|
CATCH invalid_recipient flag_invalid_recipient 1
|
||||||
CATCH invite_recipient flag_invalid_recipient_with_invite 1
|
CATCH invite_recipient flag_invalid_recipient_with_invite 1
|
||||||
INCMP _ 0
|
INCMP _ 0
|
||||||
|
Loading…
Reference in New Issue
Block a user