summaryrefslogtreecommitdiff
path: root/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
diff options
context:
space:
mode:
authorms <ms@taler.net>2021-12-19 20:38:43 +0100
committerms <ms@taler.net>2021-12-19 20:38:43 +0100
commit915e594fc38cf21be12816c1e97fee91522e87b9 (patch)
tree5e61b5a757cf76441d65b5292b0b047ea4c7a271 /nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
parentd92208611f2cc000e6eb0bc7eb7294ba36e80096 (diff)
downloadlibeufin-915e594fc38cf21be12816c1e97fee91522e87b9.tar.gz
libeufin-915e594fc38cf21be12816c1e97fee91522e87b9.tar.bz2
libeufin-915e594fc38cf21be12816c1e97fee91522e87b9.zip
t_ms -> t_s
Diffstat (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt14
1 files changed, 4 insertions, 10 deletions
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<TalerOutgoingBankTransaction> = 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,