aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
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 {