Compare commits
No commits in common. "4011597d9c9d6653c35cb569970aba62066b59e9" and "5f1ee396d84d069c25a5ca5d71bccbad855e373f" have entirely different histories.
4011597d9c
...
5f1ee396d8
@ -640,12 +640,8 @@ func (h *Handlers) CheckBalance(ctx context.Context, sym string, input []byte) (
|
|||||||
// get the active sym and active balance
|
// get the active sym and active balance
|
||||||
activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM)
|
activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if db.IsNotFound(err) {
|
res.Content = "0.00"
|
||||||
res.Content = "0.00"
|
return res, nil
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return res, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
activeBal, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_BAL)
|
activeBal, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_BAL)
|
||||||
@ -1072,7 +1068,7 @@ func (h *Handlers) CheckVouchers(ctx context.Context, sym string, input []byte)
|
|||||||
// process voucher data
|
// process voucher data
|
||||||
voucherSymbolList, voucherBalanceList := ProcessVouchers(vouchersResp.Result.Holdings)
|
voucherSymbolList, voucherBalanceList := ProcessVouchers(vouchersResp.Result.Holdings)
|
||||||
|
|
||||||
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
|
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
|
||||||
err = prefixdb.Put(ctx, []byte("sym"), []byte(voucherSymbolList))
|
err = prefixdb.Put(ctx, []byte("sym"), []byte(voucherSymbolList))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, nil
|
return res, nil
|
||||||
@ -1112,7 +1108,7 @@ func (h *Handlers) GetVoucherList(ctx context.Context, sym string, input []byte)
|
|||||||
|
|
||||||
// Read vouchers from the store
|
// Read vouchers from the store
|
||||||
store := h.userdataStore
|
store := h.userdataStore
|
||||||
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
|
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
|
||||||
|
|
||||||
voucherData, err := prefixdb.Get(ctx, []byte("sym"))
|
voucherData, err := prefixdb.Get(ctx, []byte("sym"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1143,7 +1139,7 @@ func (h *Handlers) ViewVoucher(ctx context.Context, sym string, input []byte) (r
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
prefixdb := storage.NewSubPrefixDb(store, []byte("vouchers"))
|
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
|
||||||
|
|
||||||
// Retrieve the voucher symbol list
|
// Retrieve the voucher symbol list
|
||||||
voucherSymbolList, err := prefixdb.Get(ctx, []byte("sym"))
|
voucherSymbolList, err := prefixdb.Get(ctx, []byte("sym"))
|
||||||
|
Loading…
Reference in New Issue
Block a user