From 915e594fc38cf21be12816c1e97fee91522e87b9 Mon Sep 17 00:00:00 2001 From: ms Date: Sun, 19 Dec 2021 20:38:43 +0100 Subject: t_ms -> t_s --- nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt') diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt index 60cbe80f..f7e8fd88 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt @@ -92,9 +92,7 @@ data class TalerOutgoingHistory( var outgoing_transactions: MutableList = mutableListOf() ) -data class GnunetTimestamp( - val t_ms: Long -) +data class GnunetTimestamp(val t_s: Long) /** * Sort query results in descending order for negative deltas, and ascending otherwise. @@ -228,7 +226,7 @@ private suspend fun talerTransfer(call: ApplicationCall) { * Normally should point to the next round where the background * routine will send new PAIN.001 data to the bank; work in progress.. */ - timestamp = roundTimestamp(GnunetTimestamp(System.currentTimeMillis())), + timestamp = GnunetTimestamp(System.currentTimeMillis() / 1000L), row_id = opaqueRowId ) ), @@ -237,10 +235,6 @@ private suspend fun talerTransfer(call: ApplicationCall) { ) } -fun roundTimestamp(t: GnunetTimestamp): GnunetTimestamp { - return GnunetTimestamp(t.t_ms - (t.t_ms % 1000)) -} - fun talerFilter(payment: NexusBankTransactionEntity, txDtls: TransactionDetails) { val subject = txDtls.unstructuredRemittanceInformation val debtorName = txDtls.debtor?.name @@ -402,7 +396,7 @@ private suspend fun historyOutgoing(call: ApplicationCall) { row_id = it.id.value, amount = it.amount, wtid = it.wtid, - date = GnunetTimestamp(it.preparedPayment.preparationDate), + date = GnunetTimestamp(it.preparedPayment.preparationDate / 1000L), credit_account = it.creditAccount, debit_account = buildIbanPaytoUri( subscriberBankAccount.iban, @@ -442,7 +436,7 @@ private suspend fun historyIncoming(call: ApplicationCall) { history.incoming_transactions.add( TalerIncomingBankTransaction( // Rounded timestamp - date = GnunetTimestamp((it.timestampMs / 1000) * 1000), + date = GnunetTimestamp(it.timestampMs / 1000L), row_id = it.id.value, amount = "${it.payment.currency}:${it.payment.amount}", reserve_pub = it.reservePublicKey, -- cgit v1.2.3