From 321252040efdb0712a38b3488297a7a802c5cb59 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 22 Apr 2023 22:17:08 +0200 Subject: -fix test-exchange-deposit --- .../integrationtests/test-age-restrictions-merchant.ts | 15 ++++++++++++--- .../taler-harness/src/integrationtests/test-bank-api.ts | 10 ++++++++-- .../src/integrationtests/test-exchange-deposit.ts | 13 ++++++------- .../taler-harness/src/integrationtests/test-tipping.ts | 15 ++++++++++++--- .../src/integrationtests/test-withdrawal-manual.ts | 15 ++++++++++++--- 5 files changed, 50 insertions(+), 18 deletions(-) (limited to 'packages/taler-harness/src/integrationtests') 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, -- cgit v1.2.3