Added debug logs
Some checks are pending
release / docker (push) Waiting to run

This commit is contained in:
Alfred Kamanda 2025-03-20 15:23:36 +03:00
parent d504571014
commit e681c9cfca
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703
2 changed files with 5 additions and 4 deletions

View File

@ -1931,7 +1931,6 @@ func (h *MenuHandlers) InitiateTransaction(ctx context.Context, sym string, inpu
// and sets the first as the default voucher, if no active voucher is set.
func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result
var err error
userStore := h.userdataStore
sessionId, ok := ctx.Value("SessionId").(string)
@ -1943,8 +1942,9 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
// check if the user has an active sym
activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
logg.InfoCtxf(ctx, "The activeSym in SetDefaultVoucher:", "activeSym", string(activeSym))
if err != nil {
logg.ErrorCtxf(ctx, "The err", err)
logg.InfoCtxf(ctx, "Checking the data as no activeSym", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM)
if db.IsNotFound(err) {
@ -2016,8 +2016,6 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
return res, err
}
logg.InfoCtxf(ctx, "The activeSym in SetDefaultVoucher:", "activeSym", string(activeSym))
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
return res, nil

View File

@ -33,11 +33,14 @@ func (s *SubPrefixDb) toKey(k []byte) []byte {
func (s *SubPrefixDb) Get(ctx context.Context, key []byte) ([]byte, error) {
s.store.SetPrefix(db.DATATYPE_USERDATA)
key = s.toKey(key)
logg.InfoCtxf(ctx, "SubPrefixDb Get log", "key", string(key))
return s.store.Get(ctx, key)
}
func (s *SubPrefixDb) Put(ctx context.Context, key []byte, val []byte) error {
s.store.SetPrefix(db.DATATYPE_USERDATA)
key = s.toKey(key)
logg.InfoCtxf(ctx, "SubPrefixDb Put log", "key", string(key))
return s.store.Put(ctx, key, val)
}