Convert TokenDecimals (uint8) to string before storing it

This commit is contained in:
Alfred Kamanda 2025-05-22 15:09:46 +03:00
parent 71496d0015
commit dcadea8737
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -175,10 +175,14 @@ func GetSwapToVoucherData(ctx context.Context, store DataStore, sessionId string
// UpdateSwapToVoucherData updates the active swap to voucher data in the DataStore.
func UpdateSwapToVoucherData(ctx context.Context, store DataStore, sessionId string, data *dataserviceapi.TokenDetails) error {
logg.TraceCtxf(ctx, "UpdateSwapToVoucherData", "data", data)
// Convert TokenDecimals (uint8) to string
tokenDecimalsStr := strconv.FormatUint(uint64(data.TokenDecimals), 10)
// Active swap to voucher data entries
activeEntries := map[storedb.DataTyp][]byte{
storedb.DATA_ACTIVE_SWAP_TO_SYM: []byte(data.TokenSymbol),
storedb.DATA_ACTIVE_SWAP_TO_DECIMAL: []byte{data.TokenDecimals},
storedb.DATA_ACTIVE_SWAP_TO_DECIMAL: []byte(tokenDecimalsStr),
storedb.DATA_ACTIVE_SWAP_TO_ADDRESS: []byte(data.TokenAddress),
}