From d504571014809aec228a43fccb34da30b13e674d Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 20 Mar 2025 15:07:02 +0300 Subject: [PATCH] Added debug logs --- handlers/application/menuhandler.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index 639d59f..8a8d6ed 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -1979,10 +1979,14 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input // Scale down the balance scaledBalance := store.ScaleDownBalance(defaultBal, defaultDec) + logg.InfoCtxf(ctx, "firstVoucher data", "defaultSym", defaultSym, "defaultBal", defaultBal, "defaultDec", defaultDec, "defaultAddr", defaultAddr) + // TODO: implement atomic transaction // set the active symbol err = userStore.WriteEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM, []byte(defaultSym)) if err != nil { + logg.InfoCtxf(ctx, "got an error in writing DATA_ACTIVE_SYM", "defaultSym", defaultSym) + logg.ErrorCtxf(ctx, "failed to write defaultSym entry with", "key", storedb.DATA_ACTIVE_SYM, "value", defaultSym, "error", err) return res, err } @@ -2075,7 +2079,6 @@ func (h *MenuHandlers) CheckVouchers(ctx context.Context, sym string, input []by } } - activeBal, _ := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_BAL) activeAddr, _ := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_ADDRESS) @@ -2083,7 +2086,7 @@ func (h *MenuHandlers) CheckVouchers(ctx context.Context, sym string, input []by data := store.ProcessVouchers(vouchersResp) - logg.InfoCtxf(ctx, "The data in CheckVouchers:", "data", data) + logg.InfoCtxf(ctx, "The data in CheckVouchers:", "data", data) // Store all voucher data dataMap := map[storedb.DataTyp]string{