diff options
author | Florian Dold <florian@dold.me> | 2022-08-24 11:11:02 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-08-24 11:11:02 +0200 |
commit | d32d2895cedad656d7130522722f40642c439de6 (patch) | |
tree | c3a718ce206715242c01f6b68a9a52a1aef84458 /packages/taler-wallet-core/src/wallet.ts | |
parent | bc434ebb83a5985a3aa33b94310eb23d694214da (diff) | |
download | wallet-core-d32d2895cedad656d7130522722f40642c439de6.tar.xz |
-get p2p pull integration test to run through
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 0d5918886..ac81660d2 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -39,6 +39,7 @@ import { codecForAny, codecForApplyRefundFromPurchaseIdRequest, codecForApplyRefundRequest, + codecForCheckPeerPullPaymentRequest, codecForCheckPeerPushPaymentRequest, codecForConfirmPayRequest, codecForCreateDepositGroupRequest, @@ -150,7 +151,9 @@ import { processPurchasePay, } from "./operations/pay.js"; import { + acceptPeerPullPayment, acceptPeerPushPayment, + checkPeerPullPayment, checkPeerPushPayment, initiatePeerRequestForPay, initiatePeerToPeerPush, @@ -728,7 +731,12 @@ async function dispatchRequestInternal( switch (operation) { case "initWallet": { ws.initCalled = true; - await fillDefaults(ws); + if (typeof payload === "object" && (payload as any).skipDefaults) { + logger.info("skipping defaults"); + } else { + logger.info("filling defaults"); + await fillDefaults(ws); + } return {}; } case "withdrawTestkudos": { @@ -1047,6 +1055,15 @@ async function dispatchRequestInternal( const req = codecForInitiatePeerPullPaymentRequest().decode(payload); return await initiatePeerRequestForPay(ws, req); } + case "checkPeerPullPayment": { + const req = codecForCheckPeerPullPaymentRequest().decode(payload); + return await checkPeerPullPayment(ws, req); + } + case "acceptPeerPullPayment": { + const req = codecForAcceptPeerPullPaymentRequest().decode(payload); + await acceptPeerPullPayment(ws, req); + return {}; + } } throw TalerError.fromDetail( TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN, @@ -1239,10 +1256,8 @@ class InternalWalletStateImpl implements InternalWalletState { const key = `${exchangeBaseUrl}:${denomPubHash}`; const cached = this.denomCache[key]; if (cached) { - logger.trace("using cached denom"); return cached; } - logger.trace("looking up denom denom"); const d = await tx.denominations.get([exchangeBaseUrl, denomPubHash]); if (d) { this.denomCache[key] = d; |