taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 76763e47a084e43101635a8b3cca53cf2523fcdb
parent c69f35188924af63652e9e01bddf2ea44dfa3a84
Author: Florian Dold <florian@dold.me>
Date:   Wed, 11 Dec 2024 13:51:17 +0100

harness: do KYC transfer to temporarily work around exchange bug

Diffstat:
Mpackages/taler-harness/src/harness/environments.ts | 27+++++++++++++++++++++------
Mpackages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts | 29+++++++++++++++++++++++++----
Mpackages/taler-util/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 @@ -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 @@ -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 @@ -827,6 +827,11 @@ export interface TransactionDeposit extends TransactionCommon { amountRaw: AmountString; /** + * Deposit account public key. + */ + accountPub: string; + + /** * Effective amount that is being deposited */ amountEffective: AmountString;