From 0c9358c1b2bd80e25940022e86bd8daef8184ad7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 19 Dec 2019 20:42:49 +0100 Subject: new date format, replace checkable annotations with codecs --- src/wallet.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/wallet.ts') diff --git a/src/wallet.ts b/src/wallet.ts index 407318aa2..b08122b66 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -91,7 +91,6 @@ import { getHistory } from "./operations/history"; import { getPendingOperations } from "./operations/pending"; import { getBalances } from "./operations/balance"; import { acceptTip, getTipStatus, processTip } from "./operations/tip"; -import { returnCoins } from "./operations/return"; import { payback } from "./operations/payback"; import { TimerGroup } from "./util/timer"; import { AsyncCondition } from "./util/promiseUtils"; @@ -109,6 +108,7 @@ import { getFullRefundFees, applyRefund, } from "./operations/refund"; +import { durationMin, Duration } from "./util/time"; const builtinCurrencies: CurrencyRecord[] = [ @@ -289,15 +289,15 @@ export class Wallet { numGivingLiveness++; } } - let dt; + let dt: Duration; if ( allPending.pendingOperations.length === 0 || allPending.nextRetryDelay.d_ms === Number.MAX_SAFE_INTEGER ) { // Wait for 5 seconds - dt = 5000; + dt = { d_ms: 5000 }; } else { - dt = Math.min(5000, allPending.nextRetryDelay.d_ms); + dt = durationMin({ d_ms: 5000}, allPending.nextRetryDelay); } const timeout = this.timerGroup.resolveAfter(dt); this.ws.notify({ @@ -599,7 +599,7 @@ export class Wallet { * Trigger paying coins back into the user's account. */ async returnCoins(req: ReturnCoinsRequest): Promise { - return returnCoins(this.ws, req); + throw Error("not implemented"); } /** @@ -708,7 +708,7 @@ export class Wallet { ]).amount; const totalFees = totalRefundFees; return { - contractTerms: purchase.contractTerms, + contractTerms: purchase.contractTermsRaw, hasRefund: purchase.timestampLastRefundStatus !== undefined, totalRefundAmount: totalRefundAmount, totalRefundAndRefreshFees: totalFees, -- cgit v1.2.3