aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-19 20:42:49 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-19 20:42:49 +0100
commit0c9358c1b2bd80e25940022e86bd8daef8184ad7 (patch)
treea8c8ca0134bd886d8151633aff4c85e9513ad32c /src/wallet.ts
parent49e3b3e5b9bbf1ce356ef68f301d50c689ceecb9 (diff)
new date format, replace checkable annotations with codecs
Diffstat (limited to 'src/wallet.ts')
-rw-r--r--src/wallet.ts12
1 files changed, 6 insertions, 6 deletions
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<void> {
- 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,