summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/testing.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-06 21:15:30 +0100
committerFlorian Dold <florian@dold.me>2024-03-07 00:03:59 +0100
commit7ba1d1f3351e58a331e99337afea0fbedb6eb828 (patch)
tree60b7a485cd317c1fe55276acdc0e055cd9353bfb /packages/taler-wallet-core/src/testing.ts
parent618caa117111b9fed6a792b6816fc724483eb349 (diff)
downloadwallet-core-7ba1d1f3351e58a331e99337afea0fbedb6eb828.tar.gz
wallet-core-7ba1d1f3351e58a331e99337afea0fbedb6eb828.tar.bz2
wallet-core-7ba1d1f3351e58a331e99337afea0fbedb6eb828.zip
refactor coin selection, report maxEffectiveSpendAmount
Diffstat (limited to 'packages/taler-wallet-core/src/testing.ts')
-rw-r--r--packages/taler-wallet-core/src/testing.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/testing.ts b/packages/taler-wallet-core/src/testing.ts
index 45a29a6e3..795f963d0 100644
--- a/packages/taler-wallet-core/src/testing.ts
+++ b/packages/taler-wallet-core/src/testing.ts
@@ -77,7 +77,7 @@ import {
import { initiatePeerPushDebit } from "./pay-peer-push-debit.js";
import { getRefreshesForTransaction } from "./refresh.js";
import { getTransactionById, getTransactions } from "./transactions.js";
-import type { InternalWalletState, WalletExecutionContext } from "./wallet.js";
+import type { WalletExecutionContext } from "./wallet.js";
import { acceptWithdrawalFromUri } from "./withdraw.js";
const logger = new Logger("operations/testing.ts");
@@ -883,7 +883,11 @@ export async function testPay(
"taler://fulfillment-success/thank+you",
);
logger.trace("created new order with order ID", orderResp.orderId);
- const checkPayResp = await checkPayment(wex.http, merchant, orderResp.orderId);
+ const checkPayResp = await checkPayment(
+ wex.http,
+ merchant,
+ orderResp.orderId,
+ );
const talerPayUri = checkPayResp.taler_pay_uri;
if (!talerPayUri) {
console.error("fatal: no taler pay URI received from backend");
@@ -908,6 +912,6 @@ export async function testPay(
});
checkLogicInvariant(!!purchase);
return {
- payCoinSelection: purchase.payInfo?.payCoinSelection!,
+ numCoins: purchase.payInfo?.payCoinSelection.coinContributions.length ?? 0,
};
}