aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/harness
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-07-03 12:44:20 -0300
committerSebastian <sebasjm@gmail.com>2023-07-03 12:44:20 -0300
commitf407ab202317c188085cce4df90c3e24da3d4e31 (patch)
tree1bf72bc41fbdf20b8c305ad5764bea0b5eef8b0d /packages/taler-harness/src/harness
parent545bf16cdfa824778c1450e64eaea236b9d81c49 (diff)
downloadwallet-core-f407ab202317c188085cce4df90c3e24da3d4e31.tar.xz
fix #7741
add integration test
Diffstat (limited to 'packages/taler-harness/src/harness')
-rw-r--r--packages/taler-harness/src/harness/harness.ts47
-rw-r--r--packages/taler-harness/src/harness/helpers.ts20
2 files changed, 24 insertions, 43 deletions
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts
index 1120eae84..940e4258a 100644
--- a/packages/taler-harness/src/harness/harness.ts
+++ b/packages/taler-harness/src/harness/harness.ts
@@ -28,6 +28,8 @@ import {
AmountJson,
Amounts,
AmountString,
+ codecForMerchantOrderPrivateStatusResponse,
+ codecForMerchantPostOrderResponse,
codecForMerchantReserveCreateConfirmation,
Configuration,
CoreApiResponse,
@@ -39,28 +41,42 @@ import {
hash,
j2s,
Logger,
+ MerchantInstancesResponse,
+ MerchantOrderPrivateStatusResponse,
+ MerchantPostOrderRequest,
+ MerchantPostOrderResponse,
MerchantReserveCreateConfirmation,
MerchantTemplateAddDetails,
- NotificationType,
parsePaytoUri,
stringToBytes,
TalerError,
TalerProtocolDuration,
- TransactionMajorState,
+ TipCreateConfirmation,
+ TipCreateRequest,
+ TippingReserveStatus,
WalletNotification,
} from "@gnu-taler/taler-util";
import {
+ createPlatformHttpLib,
+ readSuccessResponseJsonOrThrow,
+} from "@gnu-taler/taler-util/http";
+import {
BankApi,
BankServiceHandle,
HarnessExchangeBankAccount,
- OpenedPromise,
openPromise,
- WalletApiOperation,
WalletCoreApiClient,
WalletCoreRequestType,
WalletCoreResponseType,
WalletOperations,
} from "@gnu-taler/taler-wallet-core";
+import {
+ createRemoteWallet,
+ getClientFromRemoteWallet,
+ makeNotificationWaiter,
+ RemoteWallet,
+ WalletNotificationWaiter,
+} from "@gnu-taler/taler-wallet-core/remote";
import { deepStrictEqual } from "assert";
import axiosImp, { AxiosError } from "axios";
import { ChildProcess, spawn } from "child_process";
@@ -72,29 +88,6 @@ import * as readline from "readline";
import { URL } from "url";
import { CoinConfig } from "./denomStructures.js";
import { LibeufinNexusApi, LibeufinSandboxApi } from "./libeufin-apis.js";
-import {
- codecForMerchantOrderPrivateStatusResponse,
- codecForMerchantPostOrderResponse,
- MerchantInstancesResponse,
- MerchantOrderPrivateStatusResponse,
- MerchantPostOrderRequest,
- MerchantPostOrderResponse,
- TipCreateConfirmation,
- TipCreateRequest,
- TippingReserveStatus,
-} from "@gnu-taler/taler-util";
-import {
- createRemoteWallet,
- getClientFromRemoteWallet,
- makeNotificationWaiter,
- RemoteWallet,
- WalletNotificationWaiter,
-} from "@gnu-taler/taler-wallet-core/remote";
-import {
- createPlatformHttpLib,
- readSuccessResponseJsonOrErrorCode,
- readSuccessResponseJsonOrThrow,
-} from "@gnu-taler/taler-util/http";
const logger = new Logger("harness.ts");
diff --git a/packages/taler-harness/src/harness/helpers.ts b/packages/taler-harness/src/harness/helpers.ts
index 8c62aef37..3e91c8bd9 100644
--- a/packages/taler-harness/src/harness/helpers.ts
+++ b/packages/taler-harness/src/harness/helpers.ts
@@ -298,22 +298,10 @@ export async function createSimpleTestkudosEnvironmentV2(
),
});
- const walletService = new WalletService(t, {
- name: "wallet",
- });
- await walletService.start();
- await walletService.pingUntilAvailable();
-
- const walletClient = new WalletClient({
- unixPath: walletService.socketPath,
- onNotification(n) {
- console.log("got notification", n);
- },
- });
- await walletClient.connect();
- await walletClient.client.call(WalletApiOperation.InitWallet, {
- skipDefaults: true,
- });
+ const { walletClient, walletService } = await createWalletDaemonWithClient(
+ t,
+ { name: "wallet" },
+ );
console.log("setup done!");