From 1a61ea6de3e452e6e25bf19a390b65a97531e5f8 Mon Sep 17 00:00:00 2001 From: Alfred Kamanda Date: Thu, 12 Feb 2026 10:29:05 +0300 Subject: [PATCH] rename the function for reuse --- handlers/application/pool_deposit.go | 6 +++--- handlers/local.go | 2 +- services/registration/pool_deposit | 2 +- services/registration/pool_deposit.vis | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/application/pool_deposit.go b/handlers/application/pool_deposit.go index b540941..f87b9c4 100644 --- a/handlers/application/pool_deposit.go +++ b/handlers/application/pool_deposit.go @@ -12,8 +12,8 @@ import ( "gopkg.in/leonelquinteros/gotext.v1" ) -// GetPoolDepositVouchers returns a list of stable coins -func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, input []byte) (resource.Result, error) { +// GetOrderedVouchers returns a list of ordered vouchers with stables at the top +func (h *MenuHandlers) GetOrderedVouchers(ctx context.Context, sym string, input []byte) (resource.Result, error) { var res resource.Result sessionId, ok := ctx.Value("SessionId").(string) if !ok { @@ -26,7 +26,7 @@ func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, i 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) if err != nil { logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_ORDERED_VOUCHER_SYMBOLS, "error", err) diff --git a/handlers/local.go b/handlers/local.go index 5fdb600..e19fc20 100644 --- a/handlers/local.go +++ b/handlers/local.go @@ -150,7 +150,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService) ls.DbRs.AddLocalFunc("calculate_max_pay_debt", appHandlers.CalculateMaxPayDebt) ls.DbRs.AddLocalFunc("confirm_debt_removal", appHandlers.ConfirmDebtRemoval) 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("confirm_pool_deposit", appHandlers.ConfirmPoolDeposit) ls.DbRs.AddLocalFunc("initiate_pool_deposit", appHandlers.InitiatePoolDeposit) diff --git a/services/registration/pool_deposit b/services/registration/pool_deposit index 841c240..0863a44 100644 --- a/services/registration/pool_deposit +++ b/services/registration/pool_deposit @@ -1 +1 @@ -{{.get_pool_deposit_vouchers}} +{{.get_ordered_vouchers}} diff --git a/services/registration/pool_deposit.vis b/services/registration/pool_deposit.vis index 8f06be6..55f4990 100644 --- a/services/registration/pool_deposit.vis +++ b/services/registration/pool_deposit.vis @@ -1,7 +1,7 @@ CATCH no_voucher flag_no_active_voucher 1 CATCH no_stable_voucher flag_no_stable_vouchers 1 -LOAD get_pool_deposit_vouchers 0 -MAP get_pool_deposit_vouchers +LOAD get_ordered_vouchers 0 +MAP get_ordered_vouchers MOUT back 0 MOUT quit 99 MNEXT next 88