diff options
author | Florian Dold <florian@dold.me> | 2023-09-06 12:32:31 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-06 12:32:31 +0200 |
commit | 7450bede5b5809f6a496b7e68852a454386850e5 (patch) | |
tree | ce4aedaad43ad095e643d96f5897883b70616c03 /packages/taler-harness/src/harness | |
parent | 07d71eb29704a148f7e7bb0c064cbbad056d5a50 (diff) |
get rid of deprecated bank API client, change allowHttp to requireTls
Diffstat (limited to 'packages/taler-harness/src/harness')
-rw-r--r-- | packages/taler-harness/src/harness/harness.ts | 51 | ||||
-rw-r--r-- | packages/taler-harness/src/harness/helpers.ts | 11 | ||||
-rw-r--r-- | packages/taler-harness/src/harness/libeufin-apis.ts | 5 |
3 files changed, 22 insertions, 45 deletions
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts index df3c9b215..d0719b4f7 100644 --- a/packages/taler-harness/src/harness/harness.ts +++ b/packages/taler-harness/src/harness/harness.ts @@ -25,62 +25,46 @@ * Imports */ import { + AccountAddDetails, AmountJson, Amounts, - AmountString, - codecForMerchantOrderPrivateStatusResponse, - codecForMerchantPostOrderResponse, - codecForMerchantReserveCreateConfirmation, Configuration, CoreApiResponse, - createEddsaKeyPair, Duration, - eddsaGetPublic, EddsaKeyPair, + Logger, + MerchantInstanceConfig, + PartialMerchantInstanceConfig, + TalerError, + WalletNotification, + createEddsaKeyPair, + eddsaGetPublic, encodeCrock, hash, j2s, - Logger, - MerchantInstancesResponse, - MerchantOrderPrivateStatusResponse, - MerchantPostOrderRequest, - MerchantPostOrderResponse, - MerchantReserveCreateConfirmation, - MerchantTemplateAddDetails, parsePaytoUri, stringToBytes, - TalerError, - TalerProtocolDuration, - RewardCreateConfirmation, - RewardCreateRequest, - TippingReserveStatus, - WalletNotification, - codecForAny, - AccountAddDetails, - MerchantInstanceConfig, - PartialMerchantInstanceConfig, } from "@gnu-taler/taler-util"; import { createPlatformHttpLib, expectSuccessResponseOrThrow, - readSuccessResponseJsonOrThrow, } from "@gnu-taler/taler-util/http"; import { - BankApi, + BankAccessApiClient, BankServiceHandle, HarnessExchangeBankAccount, - openPromise, WalletCoreApiClient, WalletCoreRequestType, WalletCoreResponseType, WalletOperations, + openPromise, } from "@gnu-taler/taler-wallet-core"; import { + RemoteWallet, + WalletNotificationWaiter, createRemoteWallet, getClientFromRemoteWallet, makeNotificationWaiter, - RemoteWallet, - WalletNotificationWaiter, } from "@gnu-taler/taler-wallet-core/remote"; import { deepStrictEqual } from "assert"; import { ChildProcess, spawn } from "child_process"; @@ -594,7 +578,7 @@ export class FakebankService { proc: ProcessWrapper | undefined; - http = createPlatformHttpLib({ allowHttp: true, enableThrottling: false }); + http = createPlatformHttpLib({ enableThrottling: false }); // We store "created" accounts during setup and // register them after startup. @@ -702,13 +686,9 @@ export class FakebankService "bank", ); await this.pingUntilAvailable(); + const bankClient = new BankAccessApiClient(this.bankAccessApiBaseUrl); for (const acc of this.accounts) { - await BankApi.registerAccount( - this, - acc.accountName, - acc.accountPassword, - {}, - ); + await bankClient.registerAccount(acc.accountName, acc.accountPassword); } } @@ -1351,7 +1331,6 @@ export interface MerchantServiceInterface { * Default HTTP client handle for the integration test harness. */ export const harnessHttpLib = createPlatformHttpLib({ - allowHttp: true, enableThrottling: false, }); diff --git a/packages/taler-harness/src/harness/helpers.ts b/packages/taler-harness/src/harness/helpers.ts index 7b2f7d8f1..f92fd4dd9 100644 --- a/packages/taler-harness/src/harness/helpers.ts +++ b/packages/taler-harness/src/harness/helpers.ts @@ -36,8 +36,7 @@ import { MerchantApiClient, } from "@gnu-taler/taler-util"; import { - BankAccessApi, - BankApi, + BankAccessApiClient, HarnessExchangeBankAccount, WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; @@ -563,8 +562,10 @@ export async function withdrawViaBankV2( ): Promise<WithdrawViaBankResult> { const { walletClient: wallet, bank, exchange, amount } = p; - const user = await BankApi.createRandomBankUser(bank); - const wop = await BankAccessApi.createWithdrawalOperation(bank, user, amount); + const bankClient = new BankAccessApiClient(bank.bankAccessApiBaseUrl); + + const user = await bankClient.createRandomBankUser(); + const wop = await bankClient.createWithdrawalOperation(user.username, amount); // Hand it to the wallet @@ -593,7 +594,7 @@ export async function withdrawViaBankV2( // Confirm it - await BankApi.confirmWithdrawalOperation(bank, user, wop); + await bankClient.confirmWithdrawalOperation(user.username, wop); return { withdrawalFinishedCond, diff --git a/packages/taler-harness/src/harness/libeufin-apis.ts b/packages/taler-harness/src/harness/libeufin-apis.ts index 0553223cb..0193f9252 100644 --- a/packages/taler-harness/src/harness/libeufin-apis.ts +++ b/packages/taler-harness/src/harness/libeufin-apis.ts @@ -176,10 +176,7 @@ export interface LibeufinSandboxAddIncomingRequest { direction: string; } -const libeufinHarnessHttpLib = createPlatformHttpLib({ - allowHttp: true, - enableThrottling: false, -}); +const libeufinHarnessHttpLib = createPlatformHttpLib(); /** * APIs spread across Legacy and Access, it is therefore |