[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/02: harness: do KYC transfer to temporarily work
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/02: harness: do KYC transfer to temporarily work around exchange bug |
Date: |
Wed, 11 Dec 2024 13:51:25 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
commit 76763e47a084e43101635a8b3cca53cf2523fcdb
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Dec 11 13:51:17 2024 +0100
harness: do KYC transfer to temporarily work around exchange bug
---
packages/taler-harness/src/harness/environments.ts | 27 +++++++++++++++-----
.../integrationtests/test-kyc-deposit-aggregate.ts | 29 +++++++++++++++++++---
.../src/types-taler-wallet-transactions.ts | 5 ++++
3 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/packages/taler-harness/src/harness/environments.ts
b/packages/taler-harness/src/harness/environments.ts
index 1ac085988..6995b89e0 100644
--- a/packages/taler-harness/src/harness/environments.ts
+++ b/packages/taler-harness/src/harness/environments.ts
@@ -47,6 +47,7 @@ import {
TransactionIdStr,
TransactionMajorState,
WalletNotification,
+ WireGatewayApiClient,
} from "@gnu-taler/taler-util";
import {
createSyncCryptoApi,
@@ -1120,6 +1121,7 @@ export interface KycTestEnv {
walletService: WalletService;
amlKeypair: EddsaKeyPairStrings;
merchant: MerchantService;
+ wireGatewayApiClient: WireGatewayApiClient;
}
export async function createKycTestkudosEnvironment(
@@ -1252,6 +1254,23 @@ export async function createKycTestkudosEnvironment(
),
});
+ const exchangeBankAccount: HarnessExchangeBankAccount = {
+ accountName: exchangeBankUsername,
+ accountPassword: exchangeBankPassword,
+ accountPaytoUri: exchangePaytoUri,
+ wireGatewayApiBaseUrl,
+ };
+
+ const wireGatewayApiClient = new WireGatewayApiClient(
+ exchangeBankAccount.wireGatewayApiBaseUrl,
+ {
+ auth: {
+ username: exchangeBankAccount.accountName,
+ password: exchangeBankAccount.accountPassword,
+ },
+ },
+ );
+
t.logStep("env-setup-done");
return {
@@ -1261,12 +1280,8 @@ export async function createKycTestkudosEnvironment(
walletClient,
walletService,
bankClient,
- exchangeBankAccount: {
- accountName: exchangeBankUsername,
- accountPassword: exchangeBankPassword,
- accountPaytoUri: exchangePaytoUri,
- wireGatewayApiBaseUrl,
- },
+ exchangeBankAccount,
merchant,
+ wireGatewayApiClient,
};
}
diff --git
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
index 4f1b03e8b..070c05971 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
@@ -21,6 +21,7 @@ import {
Configuration,
TransactionMajorState,
TransactionMinorState,
+ TransactionType,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import {
@@ -58,10 +59,15 @@ function adjustExchangeConfig(config: Configuration): void {
export async function runKycDepositAggregateTest(t: GlobalTestState) {
// Set up test environment
- const { walletClient, bankClient, exchange, amlKeypair } =
- await createKycTestkudosEnvironment(t, {
- adjustExchangeConfig,
- });
+ const {
+ walletClient,
+ bankClient,
+ exchange,
+ amlKeypair,
+ wireGatewayApiClient,
+ } = await createKycTestkudosEnvironment(t, {
+ adjustExchangeConfig,
+ });
// Withdraw digital cash into the wallet.
@@ -90,6 +96,21 @@ export async function runKycDepositAggregateTest(t:
GlobalTestState) {
},
});
+ const depositTx = await walletClient.call(
+ WalletApiOperation.GetTransactionById,
+ {
+ transactionId: depositResp.transactionId,
+ },
+ );
+
+ t.assertDeepEqual(depositTx.type, TransactionType.Deposit);
+
+ await wireGatewayApiClient.adminAddKycauth({
+ amount: "TESTKUDOS:0.1",
+ debitAccountPayto: wres.accountPaytoUri,
+ accountPub: depositTx.accountPub,
+ });
+
await exchange.runAggregatorOnceWithTimetravel({
timetravelMicroseconds: 1000 * 1000 * 60 * 60 * 3,
});
diff --git a/packages/taler-util/src/types-taler-wallet-transactions.ts
b/packages/taler-util/src/types-taler-wallet-transactions.ts
index 27c068c39..fc7f12fd2 100644
--- a/packages/taler-util/src/types-taler-wallet-transactions.ts
+++ b/packages/taler-util/src/types-taler-wallet-transactions.ts
@@ -826,6 +826,11 @@ export interface TransactionDeposit extends
TransactionCommon {
*/
amountRaw: AmountString;
+ /**
+ * Deposit account public key.
+ */
+ accountPub: string;
+
/**
* Effective amount that is being deposited
*/
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.