aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-03-18 15:32:41 +0100
committerFlorian Dold <florian@dold.me>2022-03-21 19:20:48 +0100
commitf8d12f7b0d4af1b1769b89e80c87f9c169678564 (patch)
tree2478696c7bc1efc6d090b93aa340de542a7dccd9 /packages/taler-wallet-core/src/wallet.ts
parent32cd54e11d80bde0274b3c0238f8f5bd00ff83cb (diff)
downloadwallet-core-f8d12f7b0d4af1b1769b89e80c87f9c169678564.tar.xz
wallet: t_s/d_us migration
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 329417562..bbff465a8 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -64,9 +64,7 @@ import {
durationMin,
ExchangeListItem,
ExchangesListRespose,
- getDurationRemaining,
GetExchangeTosResult,
- isTimestampExpired,
j2s,
KnownBankAccounts,
Logger,
@@ -76,11 +74,12 @@ import {
PaytoUri,
RefreshReason,
TalerErrorCode,
- Timestamp,
- timestampMin,
+ AbsoluteTime,
URL,
WalletNotification,
+ Duration,
} from "@gnu-taler/taler-util";
+import { timeStamp } from "console";
import {
DenomInfo,
ExchangeOperations,
@@ -292,7 +291,7 @@ export async function runPending(
): Promise<void> {
const pendingOpsResponse = await getPendingOperations(ws);
for (const p of pendingOpsResponse.pendingOperations) {
- if (!forceNow && !isTimestampExpired(p.timestampDue)) {
+ if (!forceNow && !AbsoluteTime.isExpired(p.timestampDue)) {
continue;
}
try {
@@ -340,10 +339,10 @@ async function runTaskLoop(
logger.trace(`pending operations: ${j2s(pending)}`);
let numGivingLiveness = 0;
let numDue = 0;
- let minDue: Timestamp = { t_ms: "never" };
+ let minDue: AbsoluteTime = AbsoluteTime.never();
for (const p of pending.pendingOperations) {
- minDue = timestampMin(minDue, p.timestampDue);
- if (isTimestampExpired(p.timestampDue)) {
+ minDue = AbsoluteTime.min(minDue, p.timestampDue);
+ if (AbsoluteTime.isExpired(p.timestampDue)) {
numDue++;
}
if (p.givesLifeness) {
@@ -377,7 +376,7 @@ async function runTaskLoop(
durationFromSpec({
seconds: 5,
}),
- getDurationRemaining(minDue),
+ Duration.getRemaining(minDue),
);
logger.trace(`waiting for at most ${dt.d_ms} ms`);
const timeout = ws.timerGroup.resolveAfter(dt);
@@ -394,7 +393,7 @@ async function runTaskLoop(
`running ${pending.pendingOperations.length} pending operations`,
);
for (const p of pending.pendingOperations) {
- if (!isTimestampExpired(p.timestampDue)) {
+ if (!AbsoluteTime.isExpired(p.timestampDue)) {
continue;
}
try {