summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-05-26 13:52:00 +0200
committerFlorian Dold <florian@dold.me>2023-05-26 13:52:00 +0200
commit96d9ea3840626f71efe38018b75748d8338565fa (patch)
treed1f04ecbb58750af79b3d0cb0420ba4fdf6d05a2 /packages/taler-wallet-core/src
parentcd8f76db61f4a1ab1a8a8a4d29b2f3e863b59854 (diff)
downloadwallet-core-96d9ea3840626f71efe38018b75748d8338565fa.tar.gz
wallet-core-96d9ea3840626f71efe38018b75748d8338565fa.tar.bz2
wallet-core-96d9ea3840626f71efe38018b75748d8338565fa.zip
taler-util,wallet-core: make AbsoluteTime opaque
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/db.ts2
-rw-r--r--packages/taler-wallet-core/src/operations/attention.ts4
-rw-r--r--packages/taler-wallet-core/src/util/denominations.ts4
-rw-r--r--packages/taler-wallet-core/src/util/retries.ts4
4 files changed, 7 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
index 12e799c71..82ad54a20 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -2074,8 +2074,10 @@ export interface UserAttentionRecord {
info: AttentionInfo;
entityId: string;
+
/**
* When the notification was created.
+ * FIXME: This should be a TalerPreciseTimestamp
*/
createdMs: number;
diff --git a/packages/taler-wallet-core/src/operations/attention.ts b/packages/taler-wallet-core/src/operations/attention.ts
index b802b15cd..7d84b43ef 100644
--- a/packages/taler-wallet-core/src/operations/attention.ts
+++ b/packages/taler-wallet-core/src/operations/attention.ts
@@ -74,9 +74,7 @@ export async function getUserAttentions(
return;
pending.push({
info: x.info,
- when: {
- t_ms: x.createdMs,
- },
+ when: TalerPreciseTimestamp.fromMilliseconds(x.createdMs),
read: x.read !== undefined,
});
});
diff --git a/packages/taler-wallet-core/src/util/denominations.ts b/packages/taler-wallet-core/src/util/denominations.ts
index ecf8c5671..2b2faa458 100644
--- a/packages/taler-wallet-core/src/util/denominations.ts
+++ b/packages/taler-wallet-core/src/util/denominations.ts
@@ -132,10 +132,10 @@ export function createPairTimeline(
//check which start after, add gap so both list starts at the same time
// one list may be empty
const leftStartTime: AbsoluteTime = leftGroupIsEmpty
- ? { t_ms: "never" }
+ ? AbsoluteTime.never()
: left[li].from;
const rightStartTime: AbsoluteTime = rightGroupIsEmpty
- ? { t_ms: "never" }
+ ? AbsoluteTime.never()
: right[ri].from;
//first time cut is the smallest time
diff --git a/packages/taler-wallet-core/src/util/retries.ts b/packages/taler-wallet-core/src/util/retries.ts
index d4bd1c05f..e85eb0a6b 100644
--- a/packages/taler-wallet-core/src/util/retries.ts
+++ b/packages/taler-wallet-core/src/util/retries.ts
@@ -129,7 +129,7 @@ function updateTimeout(
throw Error("assertion failed");
}
if (p.backoffDelta.d_ms === "forever") {
- r.nextRetry = { t_ms: "never" };
+ r.nextRetry = AbsoluteTime.never();
return;
}
@@ -141,7 +141,7 @@ function updateTimeout(
(p.maxTimeout.d_ms === "forever"
? nextIncrement
: Math.min(p.maxTimeout.d_ms, nextIncrement));
- r.nextRetry = { t_ms: t };
+ r.nextRetry = AbsoluteTime.fromMilliseconds(t);
}
export namespace RetryInfo {