added some debug statements

This commit is contained in:
Alfred Kamanda 2025-10-09 13:08:22 +03:00
parent fb5eb3f24f
commit 764431ee58
Signed by: Alfred-mk
GPG Key ID: E60B2165A97F4D41

View File

@ -121,6 +121,8 @@ func (h *MenuHandlers) handleAddress(ctx context.Context, sessionId, recipient s
recipientPhoneNumber = nil
}
fmt.Println("on the address; address:", address, "publicKeyNormalized", publicKeyNormalized, "recipientPhoneNumber", recipientPhoneNumber)
if err := h.determineAndSaveTransactionType(ctx, sessionId, []byte(address), recipientPhoneNumber); err != nil {
return *res, err
}
@ -185,6 +187,8 @@ func (h *MenuHandlers) handleAlias(ctx context.Context, sessionId, recipient str
recipientPhoneNumber = nil
}
fmt.Println("on the alias; address:", aliasAddressResult, "publicKeyNormalized", publicKeyNormalized, "recipientPhoneNumber", recipientPhoneNumber)
if err := h.determineAndSaveTransactionType(ctx, sessionId, []byte(aliasAddressResult), recipientPhoneNumber); err != nil {
return *res, err
}
@ -223,6 +227,8 @@ func (h *MenuHandlers) determineAndSaveTransactionType(
txType = "normal"
}
fmt.Println("the final txtype:", txType)
// Save the transaction type
if err := store.WriteEntry(ctx, sessionId, storedb.DATA_SEND_TRANSACTION_TYPE, []byte(txType)); err != nil {
logg.ErrorCtxf(ctx, "Failed to write transaction type", "type", txType, "error", err)
@ -325,6 +331,8 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
return res, err
}
fmt.Println("the transaction type:", transactionType)
// Format the active balance amount to 2 decimal places
formattedBalance, _ := store.TruncateDecimalString(string(activeBal), 2)