diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-24 00:22:46 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-24 00:22:46 +0530 |
commit | 5b8924b8cfe14909b778ec096b3d893a9dde8533 (patch) | |
tree | e5ec34d1bf1e0f99be3cfdc582824de3b7cdc299 /src/operations | |
parent | 56ece296e0e13de3c796a4ac317c6ce9e4fd7c28 (diff) | |
download | wallet-core-5b8924b8cfe14909b778ec096b3d893a9dde8533.tar.xz |
logging
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/pay.ts | 4 | ||||
-rw-r--r-- | src/operations/reserves.ts | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/operations/pay.ts b/src/operations/pay.ts index 0027bf0f3..58911b4bf 100644 --- a/src/operations/pay.ts +++ b/src/operations/pay.ts @@ -783,6 +783,8 @@ export async function submitPay( coins: purchase.coinDepositPermissions, session_id: purchase.lastSessionId, }; + + logger.trace("making pay request", JSON.stringify(reqBody, undefined, 2)); const resp = await ws.http.postJson(payUrl, reqBody); @@ -791,7 +793,7 @@ export async function submitPay( codecForMerchantPayResponse(), ); - console.log("got success from pay URL", merchantResp); + logger.trace("got success from pay URL", merchantResp); const now = getTimestampNow(); diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts index 51499e448..6045b61d2 100644 --- a/src/operations/reserves.ts +++ b/src/operations/reserves.ts @@ -240,12 +240,18 @@ export async function createReserve( }, ); - ws.notify({ type: NotificationType.ReserveCreated }); + if (reserveRecord.reservePub === resp.reservePub) { + // Only emit notification when a new reserve was created. + ws.notify({ + type: NotificationType.ReserveCreated, + reservePub: reserveRecord.reservePub, + }); + } // Asynchronously process the reserve, but return // to the caller already. processReserve(ws, resp.reservePub, true).catch((e) => { - console.error("Processing reserve (after createReserve) failed:", e); + logger.error("Processing reserve (after createReserve) failed:", e); }); return resp; @@ -318,7 +324,6 @@ async function registerReserveWithBank( return; } const bankStatusUrl = bankInfo.statusUrl; - console.log("making selection"); if (reserve.timestampReserveInfoPosted) { throw Error("bank claims that reserve info selection is not done"); } @@ -788,7 +793,6 @@ export async function createTalerWithdrawReserve( // We do this here, as the reserve should be registered before we return, // so that we can redirect the user to the bank's status page. await processReserveBankStatus(ws, reserve.reservePub); - console.log("acceptWithdrawal: returning"); return { reservePub: reserve.reservePub, confirmTransferUrl: withdrawInfo.confirmTransferUrl, |