From cd8f76db61f4a1ab1a8a8a4d29b2f3e863b59854 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 26 May 2023 12:19:32 +0200 Subject: taler-util,wallet-core: implement TalerPreciseTimestamp Fixes #7703 --- packages/taler-wallet-core/src/operations/transactions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/transactions.ts') diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 894becca7..481ffe8bb 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -30,6 +30,7 @@ import { stringifyPayPullUri, stringifyPayPushUri, TalerErrorCode, + TalerPreciseTimestamp, TalerProtocolTimestamp, Transaction, TransactionByIdRequest, @@ -472,7 +473,7 @@ function buildTransactionForPeerPullCredit( amountRaw: Amounts.stringify(wsr.instructedAmount), exchangeBaseUrl: wsr.exchangeBaseUrl, // Old transactions don't have it! - timestamp: pullCredit.mergeTimestamp ?? TalerProtocolTimestamp.now(), + timestamp: pullCredit.mergeTimestamp ?? TalerPreciseTimestamp.now(), info: { expiration: wsr.wgInfo.contractTerms.purse_expiration, summary: wsr.wgInfo.contractTerms.summary, @@ -1171,8 +1172,8 @@ export async function getTransactions( const txCmp = (h1: Transaction, h2: Transaction) => { const tsCmp = AbsoluteTime.cmp( - AbsoluteTime.fromTimestamp(h1.timestamp), - AbsoluteTime.fromTimestamp(h2.timestamp), + AbsoluteTime.fromPreciseTimestamp(h1.timestamp), + AbsoluteTime.fromPreciseTimestamp(h2.timestamp), ); if (tsCmp === 0) { return Math.sign(txOrder[h1.type] - txOrder[h2.type]); -- cgit v1.2.3