rename the function for reuse
This commit is contained in:
parent
50c2aff79e
commit
1a61ea6de3
@ -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)
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
{{.get_pool_deposit_vouchers}}
|
{{.get_ordered_vouchers}}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user