menu-voucherlist #101

Merged
lash merged 63 commits from menu-voucherlist into master 2024-10-25 15:59:47 +02:00
Showing only changes of commit 176473aa26 - Show all commits

View File

@ -1068,7 +1068,7 @@ func (h *Handlers) CheckVouchers(ctx context.Context, sym string, input []byte)
// process voucher data
voucherSymbolList, voucherBalanceList := ProcessVouchers(vouchersResp.Result.Holdings)
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
err = prefixdb.Put(ctx, []byte("sym"), []byte(voucherSymbolList))
if err != nil {
return res, nil
@ -1108,7 +1108,7 @@ func (h *Handlers) GetVoucherList(ctx context.Context, sym string, input []byte)
// Read vouchers from the store
store := h.userdataStore
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
Alfred-mk marked this conversation as resolved Outdated
Outdated
Review

Not a very descriptive prefix?

Not a very descriptive prefix?
voucherData, err := prefixdb.Get(ctx, []byte("sym"))
if err != nil {
@ -1139,7 +1139,7 @@ func (h *Handlers) ViewVoucher(ctx context.Context, sym string, input []byte) (r
return res, nil
}
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
// Retrieve the voucher symbol list
voucherSymbolList, err := prefixdb.Get(ctx, []byte("sym"))