debt-menu #115

Open
Alfred-mk wants to merge 74 commits from debt-menu into master
3 changed files with 20 additions and 20 deletions
Showing only changes of commit ea71c08143 - Show all commits

View File

@ -27,9 +27,9 @@ func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, i
userStore := h.userdataStore userStore := h.userdataStore
// Read stable vouchers from the store // Read stable vouchers from the store
voucherData, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_STABLE_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_STABLE_VOUCHER_SYMBOLS, "error", err) logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_ORDERED_VOUCHER_SYMBOLS, "error", err)
return res, err return res, err
} }
@ -37,9 +37,9 @@ func (h *MenuHandlers) GetPoolDepositVouchers(ctx context.Context, sym string, i
return res, nil return res, nil
} }
voucherBalances, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_STABLE_VOUCHER_BALANCES) voucherBalances, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ORDERED_VOUCHER_BALANCES)
if err != nil { if err != nil {
logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_STABLE_VOUCHER_BALANCES, "error", err) logg.ErrorCtxf(ctx, "failed to read stable voucherData entires with", "key", storedb.DATA_ORDERED_VOUCHER_BALANCES, "error", err)
return res, err return res, err
} }

View File

@ -104,14 +104,14 @@ const (
DATA_VOUCHER_DECIMALS DATA_VOUCHER_DECIMALS
// List of voucher EVM addresses for vouchers valid in the user context. // List of voucher EVM addresses for vouchers valid in the user context.
DATA_VOUCHER_ADDRESSES DATA_VOUCHER_ADDRESSES
// List of stable voucher symbols in the user context. // List of ordered voucher symbols in the user context.
DATA_STABLE_VOUCHER_SYMBOLS DATA_ORDERED_VOUCHER_SYMBOLS
// List of stable voucher decimal counts for vouchers valid in the user context. // List of ordered voucher balances in the user context.
DATA_STABLE_VOUCHER_BALANCES DATA_ORDERED_VOUCHER_BALANCES
// List of stable voucher decimal counts for vouchers valid in the user context. // List of ordered voucher decimals in the user context.
DATA_STABLE_VOUCHER_DECIMALS DATA_ORDERED_VOUCHER_DECIMALS
// List of stable voucher EVM addresses for vouchers valid in the user context. // List of ordered voucher EVM addresses in the user context.
DATA_STABLE_VOUCHER_ADDRESSES DATA_ORDERED_VOUCHER_ADDRESSES
) )
const ( const (

View File

@ -123,10 +123,10 @@ func GetVoucherData(ctx context.Context, store DataStore, sessionId string, inpu
// GetStableVoucherData retrieves and matches stable voucher data // GetStableVoucherData retrieves and matches stable voucher data
func GetStableVoucherData(ctx context.Context, store DataStore, sessionId string, input string) (*dataserviceapi.TokenHoldings, error) { func GetStableVoucherData(ctx context.Context, store DataStore, sessionId string, input string) (*dataserviceapi.TokenHoldings, error) {
keys := []storedb.DataTyp{ keys := []storedb.DataTyp{
storedb.DATA_STABLE_VOUCHER_SYMBOLS, storedb.DATA_ORDERED_VOUCHER_SYMBOLS,
storedb.DATA_STABLE_VOUCHER_BALANCES, storedb.DATA_ORDERED_VOUCHER_BALANCES,
storedb.DATA_STABLE_VOUCHER_DECIMALS, storedb.DATA_ORDERED_VOUCHER_DECIMALS,
storedb.DATA_STABLE_VOUCHER_ADDRESSES, storedb.DATA_ORDERED_VOUCHER_ADDRESSES,
} }
data := make(map[storedb.DataTyp]string) data := make(map[storedb.DataTyp]string)
@ -139,10 +139,10 @@ func GetStableVoucherData(ctx context.Context, store DataStore, sessionId string
} }
symbol, balance, decimal, address := MatchVoucher(input, symbol, balance, decimal, address := MatchVoucher(input,
data[storedb.DATA_STABLE_VOUCHER_SYMBOLS], data[storedb.DATA_ORDERED_VOUCHER_SYMBOLS],
data[storedb.DATA_STABLE_VOUCHER_BALANCES], data[storedb.DATA_ORDERED_VOUCHER_BALANCES],
data[storedb.DATA_STABLE_VOUCHER_DECIMALS], data[storedb.DATA_ORDERED_VOUCHER_DECIMALS],
data[storedb.DATA_STABLE_VOUCHER_ADDRESSES], data[storedb.DATA_ORDERED_VOUCHER_ADDRESSES],
) )
if symbol == "" { if symbol == "" {