aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-bank-api.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-09-06 12:32:31 +0200
committerFlorian Dold <florian@dold.me>2023-09-06 12:32:31 +0200
commit7450bede5b5809f6a496b7e68852a454386850e5 (patch)
treece4aedaad43ad095e643d96f5897883b70616c03 /packages/taler-harness/src/integrationtests/test-bank-api.ts
parent07d71eb29704a148f7e7bb0c064cbbad056d5a50 (diff)
get rid of deprecated bank API client, change allowHttp to requireTls
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-bank-api.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-bank-api.ts28
1 files changed, 16 insertions, 12 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-bank-api.ts b/packages/taler-harness/src/integrationtests/test-bank-api.ts
index e645d60f1..afb06b61a 100644
--- a/packages/taler-harness/src/integrationtests/test-bank-api.ts
+++ b/packages/taler-harness/src/integrationtests/test-bank-api.ts
@@ -19,8 +19,7 @@
*/
import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util";
import {
- BankAccessApi,
- BankApi,
+ BankAccessApiClient,
CreditDebitIndicator,
WireGatewayApiClient,
} from "@gnu-taler/taler-wallet-core";
@@ -99,17 +98,19 @@ export async function runBankApiTest(t: GlobalTestState) {
console.log("setup done!");
- const bankUser = await BankApi.registerAccount(bank, "user1", "pw1", {});
+ const bankClient = new BankAccessApiClient(bank.bankAccessApiBaseUrl);
+
+ const bankUser = await bankClient.registerAccount("user1", "pw1");
// Make sure that registering twice results in a 409 Conflict
{
const e = await t.assertThrowsTalerErrorAsync(async () => {
- await BankApi.registerAccount(bank, "user1", "pw2", {});
+ await bankClient.registerAccount("user1", "pw1");
});
t.assertTrue(e.errorDetail.httpStatusCode === 409);
}
- let balResp = await BankAccessApi.getAccountBalance(bank, bankUser);
+ let balResp = await bankClient.getAccountBalance(bankUser.username);
console.log(balResp);
@@ -121,12 +122,15 @@ export async function runBankApiTest(t: GlobalTestState) {
const res = createEddsaKeyPair();
- const wireGatewayApiClient = new WireGatewayApiClient({
- wireGatewayApiBaseUrl: exchangeBankAccount.wireGatewayApiBaseUrl,
- accountName: exchangeBankAccount.accountName,
- accountPassword: exchangeBankAccount.accountPassword,
- allowHttp: true,
- });
+ const wireGatewayApiClient = new WireGatewayApiClient(
+ exchangeBankAccount.wireGatewayApiBaseUrl,
+ {
+ auth: {
+ username: exchangeBankAccount.accountName,
+ password: exchangeBankAccount.accountPassword,
+ },
+ },
+ );
await wireGatewayApiClient.adminAddIncoming({
amount: "TESTKUDOS:115",
@@ -134,7 +138,7 @@ export async function runBankApiTest(t: GlobalTestState) {
reservePub: encodeCrock(res.eddsaPub),
});
- balResp = await BankAccessApi.getAccountBalance(bank, bankUser);
+ balResp = await bankClient.getAccountBalance(bankUser.username);
t.assertAmountEquals(balResp.balance.amount, "TESTKUDOS:15");
t.assertTrue(
balResp.balance.credit_debit_indicator === CreditDebitIndicator.Debit,