diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-bank-api.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-bank-api.ts | 28 |
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, |