aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-22 22:17:08 +0200
committerFlorian Dold <florian@dold.me>2023-04-22 22:17:08 +0200
commit321252040efdb0712a38b3488297a7a802c5cb59 (patch)
tree0ef4933afe3e8502246183a2e5bcf8c9a1e7c909 /packages/taler-harness
parent15a1b8d0966783033947588cdb27850fe6811405 (diff)
downloadwallet-core-321252040efdb0712a38b3488297a7a802c5cb59.tar.xz
-fix test-exchange-deposit
Diffstat (limited to 'packages/taler-harness')
-rw-r--r--packages/taler-harness/src/integrationtests/test-age-restrictions-merchant.ts15
-rw-r--r--packages/taler-harness/src/integrationtests/test-bank-api.ts10
-rw-r--r--packages/taler-harness/src/integrationtests/test-exchange-deposit.ts13
-rw-r--r--packages/taler-harness/src/integrationtests/test-tipping.ts15
-rw-r--r--packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts15
5 files changed, 50 insertions, 18 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-age-restrictions-merchant.ts b/packages/taler-harness/src/integrationtests/test-age-restrictions-merchant.ts
index ff589dd79..561a10e6d 100644
--- a/packages/taler-harness/src/integrationtests/test-age-restrictions-merchant.ts
+++ b/packages/taler-harness/src/integrationtests/test-age-restrictions-merchant.ts
@@ -17,7 +17,11 @@
/**
* Imports.
*/
-import { BankApi, WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import {
+ BankApi,
+ WalletApiOperation,
+ WireGatewayApiClient,
+} from "@gnu-taler/taler-wallet-core";
import { defaultCoinConfig } from "../harness/denomStructures.js";
import {
getWireMethodForTest,
@@ -158,10 +162,15 @@ export async function runAgeRestrictionsMerchantTest(t: GlobalTestState) {
exchangeBankAccount.accountPaytoUri,
);
- await BankApi.adminAddIncoming(bank, {
+ const wireGatewayApiClient = new WireGatewayApiClient({
+ wireGatewayApiBaseUrl: exchangeBankAccount.wireGatewayApiBaseUrl,
+ accountName: exchangeBankAccount.accountName,
+ accountPassword: exchangeBankAccount.accountPassword,
+ });
+
+ await wireGatewayApiClient.adminAddIncoming({
amount: "TESTKUDOS:10",
debitAccountPayto: mbu.accountPaytoUri,
- exchangeBankAccount,
reservePub: tipReserveResp.reserve_pub,
});
diff --git a/packages/taler-harness/src/integrationtests/test-bank-api.ts b/packages/taler-harness/src/integrationtests/test-bank-api.ts
index c7a23d3ce..d97860a2c 100644
--- a/packages/taler-harness/src/integrationtests/test-bank-api.ts
+++ b/packages/taler-harness/src/integrationtests/test-bank-api.ts
@@ -32,6 +32,7 @@ import {
BankApi,
BankAccessApi,
CreditDebitIndicator,
+ WireGatewayApiClient,
} from "@gnu-taler/taler-wallet-core";
/**
@@ -121,10 +122,15 @@ export async function runBankApiTest(t: GlobalTestState) {
const res = createEddsaKeyPair();
- await BankApi.adminAddIncoming(bank, {
+ const wireGatewayApiClient = new WireGatewayApiClient({
+ wireGatewayApiBaseUrl: exchangeBankAccount.wireGatewayApiBaseUrl,
+ accountName: exchangeBankAccount.accountName,
+ accountPassword: exchangeBankAccount.accountPassword,
+ });
+
+ await wireGatewayApiClient.adminAddIncoming({
amount: "TESTKUDOS:115",
debitAccountPayto: bankUser.accountPaytoUri,
- exchangeBankAccount: exchangeBankAccount,
reservePub: encodeCrock(res.eddsaPub),
});
diff --git a/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts b/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts
index 7df1047ea..18a3c172a 100644
--- a/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts
+++ b/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts
@@ -59,14 +59,13 @@ export async function runExchangeDepositTest(t: GlobalTestState) {
const reserveKeyPair = await cryptoApi.createEddsaKeypair({});
- await topupReserveWithDemobank(
+ await topupReserveWithDemobank({
http,
- reserveKeyPair.pub,
- bank.baseUrl,
- bank.bankAccessApiBaseUrl,
+ amount: "TESTKUDOS:10",
+ bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
exchangeInfo,
- "TESTKUDOS:10",
- );
+ reservePub: reserveKeyPair.pub,
+ });
await exchange.runWirewatchOnce();
@@ -126,7 +125,7 @@ export async function runExchangeDepositTest(t: GlobalTestState) {
});
} catch (e) {
if (e instanceof TalerError && e.errorDetail.code === 7005) {
- if (e.errorDetail.httpStatusCode === 400) {
+ if (e.errorDetail.httpStatusCode === 409) {
console.log("got expected error response from exchange");
console.log(e);
console.log(j2s(e.errorDetail));
diff --git a/packages/taler-harness/src/integrationtests/test-tipping.ts b/packages/taler-harness/src/integrationtests/test-tipping.ts
index d31e0c06b..69afad6fd 100644
--- a/packages/taler-harness/src/integrationtests/test-tipping.ts
+++ b/packages/taler-harness/src/integrationtests/test-tipping.ts
@@ -17,7 +17,11 @@
/**
* Imports.
*/
-import { WalletApiOperation, BankApi } from "@gnu-taler/taler-wallet-core";
+import {
+ WalletApiOperation,
+ BankApi,
+ WireGatewayApiClient,
+} from "@gnu-taler/taler-wallet-core";
import {
GlobalTestState,
MerchantPrivateApi,
@@ -53,10 +57,15 @@ export async function runTippingTest(t: GlobalTestState) {
exchangeBankAccount.accountPaytoUri,
);
- await BankApi.adminAddIncoming(bank, {
+ const wireGatewayApiClient = new WireGatewayApiClient({
+ wireGatewayApiBaseUrl: exchangeBankAccount.wireGatewayApiBaseUrl,
+ accountName: exchangeBankAccount.accountName,
+ accountPassword: exchangeBankAccount.accountPassword,
+ });
+
+ await wireGatewayApiClient.adminAddIncoming({
amount: "TESTKUDOS:10",
debitAccountPayto: mbu.accountPaytoUri,
- exchangeBankAccount,
reservePub: tipReserveResp.reserve_pub,
});
diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts
index 260972498..4a79d2c21 100644
--- a/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts
+++ b/packages/taler-harness/src/integrationtests/test-withdrawal-manual.ts
@@ -19,7 +19,11 @@
*/
import { GlobalTestState } from "../harness/harness.js";
import { createSimpleTestkudosEnvironment } from "../harness/helpers.js";
-import { WalletApiOperation, BankApi } from "@gnu-taler/taler-wallet-core";
+import {
+ WalletApiOperation,
+ BankApi,
+ WireGatewayApiClient,
+} from "@gnu-taler/taler-wallet-core";
import { AbsoluteTime, j2s, Logger } from "@gnu-taler/taler-util";
const logger = new Logger("test-withdrawal-manual.ts");
@@ -65,8 +69,13 @@ export async function runWithdrawalManualTest(t: GlobalTestState) {
const reservePub: string = wres.reservePub;
- await BankApi.adminAddIncoming(bank, {
- exchangeBankAccount,
+ const wireGatewayApiClient = new WireGatewayApiClient({
+ wireGatewayApiBaseUrl: exchangeBankAccount.wireGatewayApiBaseUrl,
+ accountName: exchangeBankAccount.accountName,
+ accountPassword: exchangeBankAccount.accountPassword,
+ });
+
+ await wireGatewayApiClient.adminAddIncoming({
amount: "TESTKUDOS:10",
debitAccountPayto: user.accountPaytoUri,
reservePub: reservePub,