summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-29 22:58:15 +0100
committerFlorian Dold <florian@dold.me>2024-01-29 22:58:15 +0100
commit609919027c85ac4bf33a176a51b013db85450d7e (patch)
treeeb0fd23d8d54569f919d7419ee408f0f28b038b8 /packages/taler-wallet-core/src/operations
parent95e87d8f4863f3db37504e78913381f775f8f73a (diff)
downloadwallet-core-609919027c85ac4bf33a176a51b013db85450d7e.tar.gz
wallet-core-609919027c85ac4bf33a176a51b013db85450d7e.tar.bz2
wallet-core-609919027c85ac4bf33a176a51b013db85450d7e.zip
wallet-core: also create deposit in runIntegrationTestV2
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/deposits.ts1
-rw-r--r--packages/taler-wallet-core/src/operations/testing.ts28
2 files changed, 29 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts
index 4a6791922..3619ac4f4 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -949,6 +949,7 @@ async function processDepositGroupPendingDeposit(
cancellationToken?.throwIfCancelled();
const url = new URL(`batch-deposit`, exchangeUrl);
logger.info(`depositing to ${url}`);
+ logger.trace(`deposit request: ${j2s(batchReq)}`);
const httpResp = await ws.http.fetch(url.href, {
method: "POST",
body: batchReq,
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts
index 92ce504fe..4c2cfae2c 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -25,6 +25,7 @@
*/
import {
AbsoluteTime,
+ addPaytoQueryParams,
Amounts,
AmountString,
CheckPaymentResponse,
@@ -37,6 +38,7 @@ import {
j2s,
Logger,
NotificationType,
+ parsePaytoUri,
PreparePayResultType,
TalerCorebankApiClient,
TestPayArgs,
@@ -79,6 +81,7 @@ import { initiatePeerPushDebit } from "./pay-peer-push-debit.js";
import { getPendingOperations } from "./pending.js";
import { getTransactionById, getTransactions } from "./transactions.js";
import { acceptWithdrawalFromUri } from "./withdraw.js";
+import { createDepositGroup } from "./deposits.js";
const logger = new Logger("operations/testing.ts");
@@ -92,6 +95,11 @@ export interface WithdrawTestBalanceResult {
* Transaction ID of the newly created withdrawal transaction.
*/
transactionId: string;
+
+ /**
+ * Account of the user registered for the withdrawal.
+ */
+ accountPaytoUri: string;
}
export async function withdrawTestBalance(
@@ -130,6 +138,7 @@ export async function withdrawTestBalance(
return {
transactionId: acceptResp.transactionId,
+ accountPaytoUri: bankUser.accountPaytoUri,
};
}
@@ -876,6 +885,25 @@ export async function runIntegrationTest2(
peerPushInit.transactionId,
);
+ let depositPayto = withdrawalRes.accountPaytoUri;
+
+ const parsedPayto = parsePaytoUri(depositPayto);
+ if (!parsedPayto) {
+ throw Error("invalid payto");
+ }
+
+ // Work around libeufin-bank bug where receiver-name is missing
+ if (!parsedPayto.params["receiver-name"]) {
+ depositPayto = addPaytoQueryParams(depositPayto, {
+ "receiver-name": "Test",
+ });
+ }
+
+ await createDepositGroup(ws, {
+ amount: `${currency}:5` as AmountString,
+ depositPaytoUri: depositPayto,
+ });
+
logger.trace("integration test: all done!");
}