aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-12-18 13:53:15 +0100
committerFlorian Dold <florian@dold.me>2023-12-18 13:53:15 +0100
commita488ce70d6dbfe08845eccaeb2375b367f7c307a (patch)
tree25ab6b81f69e3a33ef0ec0907e4542d0287310a7 /packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
parent44f52cfad7158ca59115cdbf4b87824f98a06150 (diff)
downloadwallet-core-a488ce70d6dbfe08845eccaeb2375b367f7c307a.tar.xz
wallet-core: use getAll instead of iter to query denominations
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
index 3eed52b91..da779a07d 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
@@ -31,18 +31,14 @@ import {
TalerPreciseTimestamp,
TalerProtocolTimestamp,
TalerProtocolViolationError,
- TalerUriAction,
TransactionAction,
TransactionMajorState,
TransactionMinorState,
TransactionState,
TransactionType,
- decodeCrock,
encodeCrock,
getRandomBytes,
- hash,
j2s,
- stringifyTalerUri,
} from "@gnu-taler/taler-util";
import {
HttpResponse,
@@ -89,6 +85,9 @@ export async function checkPeerPushDebit(
req: CheckPeerPushDebitRequest,
): Promise<CheckPeerPushDebitResponse> {
const instructedAmount = Amounts.parseOrThrow(req.amount);
+ logger.trace(
+ `checking peer push debit for ${Amounts.stringify(instructedAmount)}`,
+ );
const coinSelRes = await selectPeerCoins(ws, { instructedAmount });
if (coinSelRes.type === "failure") {
throw TalerError.fromDetail(
@@ -98,10 +97,12 @@ export async function checkPeerPushDebit(
},
);
}
+ logger.trace(`selected peer coins (len=${coinSelRes.result.coins.length})`);
const totalAmount = await getTotalPeerPaymentCost(
ws,
coinSelRes.result.coins,
);
+ logger.trace("computed total peer payment cost");
return {
exchangeBaseUrl: coinSelRes.result.exchangeBaseUrl,
amountEffective: Amounts.stringify(totalAmount),
@@ -243,10 +244,6 @@ async function processPeerPushDebitCreateReserve(
encryptContractRequest,
);
- const econtractHash = encodeCrock(
- hash(decodeCrock(econtractResp.econtract.econtract)),
- );
-
const createPurseUrl = new URL(
`purses/${peerPushInitiation.pursePub}/create`,
peerPushInitiation.exchangeBaseUrl,