aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-09-13 16:08:51 +0200
committerFlorian Dold <florian@dold.me>2023-09-14 19:18:01 +0200
commitf4587c44fd6a6d76384cd671550890255c3fe650 (patch)
treef3eab7032e7ec4a6e49ffdf85ea57e3874b84130 /packages/taler-wallet-core/src/operations/exchanges.ts
parent59ef010b0e1f1eaf938a20a46f52d7c94af7b10d (diff)
downloadwallet-core-f4587c44fd6a6d76384cd671550890255c3fe650.tar.xz
wallet-core: use typed microsecond timestamps in DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index 43a08ed3b..60d55252a 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -74,6 +74,7 @@ import {
ExchangeEntryDbRecordStatus,
ExchangeEntryDbUpdateStatus,
isWithdrawableDenom,
+ timestampPreciseToDb,
WalletDbReadWriteTransaction,
} from "../index.js";
import { InternalWalletState, TrustInfo } from "../internal-wallet-state.js";
@@ -174,7 +175,7 @@ export async function acceptExchangeTermsOfService(
if (d) {
d.tosAccepted = {
etag: etag || d.tosCurrentEtag,
- timestamp: TalerPreciseTimestamp.now(),
+ timestamp: timestampPreciseToDb(TalerPreciseTimestamp.now()),
};
await tx.exchangeDetails.put(d);
}
@@ -753,7 +754,7 @@ export async function updateExchangeFromUrlHandler(
if (existingDetails?.rowId) {
newDetails.rowId = existingDetails.rowId;
}
- r.lastUpdate = TalerPreciseTimestamp.now();
+ r.lastUpdate = timestampPreciseToDb(TalerPreciseTimestamp.now());
r.nextUpdateStampMs = AbsoluteTime.toStampMs(
AbsoluteTime.fromProtocolTimestamp(keysInfo.expiry),
);
@@ -763,7 +764,7 @@ export async function updateExchangeFromUrlHandler(
r.detailsPointer = {
currency: newDetails.currency,
masterPublicKey: newDetails.masterPublicKey,
- updateClock: TalerPreciseTimestamp.now(),
+ updateClock: timestampPreciseToDb(TalerPreciseTimestamp.now()),
};
}
await tx.exchanges.put(r);