rename the function for reuse

This commit is contained in:
Alfred Kamanda 2026-02-12 10:29:05 +03:00
parent 50c2aff79e
commit 1a61ea6de3
Signed by: Alfred-mk
GPG Key ID: E60B2165A97F4D41
4 changed files with 7 additions and 7 deletions

View File

@ -12,8 +12,8 @@ import (
"gopkg.in/leonelquinteros/gotext.v1" "gopkg.in/leonelquinteros/gotext.v1"
) )
// GetPoolDepositVouchers returns a list of stable coins // GetOrderedVouchers returns a list of ordered vouchers with stables at the top
func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *MenuHandlers) GetOrderedVouchers(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result var res resource.Result
sessionId, ok := ctx.Value("SessionId").(string) sessionId, ok := ctx.Value("SessionId").(string)
if !ok { if !ok {
@ -26,7 +26,7 @@ func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, i
userStore := h.userdataStore userStore := h.userdataStore
// Read stable vouchers from the store // Read ordered vouchers from the store
voucherData, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ORDERED_VOUCHER_SYMBOLS) voucherData, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ORDERED_VOUCHER_SYMBOLS)
if err != nil { if err != nil {
logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_ORDERED_VOUCHER_SYMBOLS, "error", err) logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_ORDERED_VOUCHER_SYMBOLS, "error", err)

View File

@ -150,7 +150,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
ls.DbRs.AddLocalFunc("calculate_max_pay_debt", appHandlers.CalculateMaxPayDebt) ls.DbRs.AddLocalFunc("calculate_max_pay_debt", appHandlers.CalculateMaxPayDebt)
ls.DbRs.AddLocalFunc("confirm_debt_removal", appHandlers.ConfirmDebtRemoval) ls.DbRs.AddLocalFunc("confirm_debt_removal", appHandlers.ConfirmDebtRemoval)
ls.DbRs.AddLocalFunc("initiate_pay_debt", appHandlers.InitiatePayDebt) ls.DbRs.AddLocalFunc("initiate_pay_debt", appHandlers.InitiatePayDebt)
ls.DbRs.AddLocalFunc("get_pool_deposit_vouchers", appHandlers.GetPoolDepositVouchers) ls.DbRs.AddLocalFunc("get_ordered_vouchers", appHandlers.GetOrderedVouchers)
ls.DbRs.AddLocalFunc("pool_deposit_max_amount", appHandlers.PoolDepositMaxAmount) ls.DbRs.AddLocalFunc("pool_deposit_max_amount", appHandlers.PoolDepositMaxAmount)
ls.DbRs.AddLocalFunc("confirm_pool_deposit", appHandlers.ConfirmPoolDeposit) ls.DbRs.AddLocalFunc("confirm_pool_deposit", appHandlers.ConfirmPoolDeposit)
ls.DbRs.AddLocalFunc("initiate_pool_deposit", appHandlers.InitiatePoolDeposit) ls.DbRs.AddLocalFunc("initiate_pool_deposit", appHandlers.InitiatePoolDeposit)

View File

@ -1 +1 @@
{{.get_pool_deposit_vouchers}} {{.get_ordered_vouchers}}

View File

@ -1,7 +1,7 @@
CATCH no_voucher flag_no_active_voucher 1 CATCH no_voucher flag_no_active_voucher 1
CATCH no_stable_voucher flag_no_stable_vouchers 1 CATCH no_stable_voucher flag_no_stable_vouchers 1
LOAD get_pool_deposit_vouchers 0 LOAD get_ordered_vouchers 0
MAP get_pool_deposit_vouchers MAP get_ordered_vouchers
MOUT back 0 MOUT back 0
MOUT quit 99 MOUT quit 99
MNEXT next 88 MNEXT next 88