diff options
author | Florian Dold <florian@dold.me> | 2024-11-07 16:56:45 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-11-07 16:56:45 +0100 |
commit | 7d801a7bb4f35ccd75dea2794b90dc0420469144 (patch) | |
tree | 744d63414123014fabda8a4fa8dc227858ece64a /packages/taler-harness/src | |
parent | 73c38b829b377797ed1cfd2d5398dce2e24e657c (diff) |
harness: use normalized payto hashing
Diffstat (limited to 'packages/taler-harness/src')
5 files changed, 17 insertions, 13 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts b/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts index 86fc96587..824378db6 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts @@ -20,7 +20,7 @@ import { encodeCrock, ExchangeWalletKycStatus, - hashPaytoUri, + hashFullPaytoUri, j2s, TalerCorebankApiClient, TransactionIdStr, @@ -247,7 +247,7 @@ export async function runKycBalanceWithdrawalTest(t: GlobalTestState) { t.assertTrue(!!kycReservePub); // FIXME: Create/user helper function for this! - const hPayto = hashPaytoUri( + const hPayto = hashFullPaytoUri( `payto://taler-reserve-http/localhost:${exchange.port}/${kycReservePub}`, ); diff --git a/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts b/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts index affdc44de..a56d82a51 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts @@ -20,7 +20,7 @@ import { encodeCrock, ExchangeWalletKycStatus, - hashPaytoUri, + hashFullPaytoUri, j2s, TalerCorebankApiClient, } from "@gnu-taler/taler-util"; @@ -30,6 +30,7 @@ import { WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js"; +import { EnvOptions, postAmlDecisionNoRules } from "../harness/environments.js"; import { BankService, DbInfo, @@ -41,7 +42,6 @@ import { WalletClient, WalletService, } from "../harness/harness.js"; -import { EnvOptions, postAmlDecisionNoRules } from "../harness/environments.js"; interface KycTestEnv { commonDb: DbInfo; @@ -225,12 +225,10 @@ export async function runKycExchangeWalletTest(t: GlobalTestState) { t.assertTrue(!!kycReservePub); // FIXME: Create/user helper function for this! - const hPayto = hashPaytoUri( + const hPayto = hashFullPaytoUri( `payto://taler-reserve-http/localhost:${exchange.port}/${kycReservePub}`, ); - console.log(`hPayto: ${hPayto}`); - await postAmlDecisionNoRules(t, { amlPriv: amlKeypair.priv, amlPub: amlKeypair.pub, diff --git a/packages/taler-harness/src/integrationtests/test-kyc-initial-decision.ts b/packages/taler-harness/src/integrationtests/test-kyc-initial-decision.ts index 529a3c282..fcfc2ade5 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc-initial-decision.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc-initial-decision.ts @@ -21,7 +21,7 @@ import { Configuration, Duration, encodeCrock, - hashPaytoUri, + hashFullPaytoUri, TalerProtocolTimestamp, } from "@gnu-taler/taler-util"; import { @@ -56,7 +56,7 @@ export async function runKycInitialDecisionTest(t: GlobalTestState) { const merchantPayto = getTestHarnessPaytoForLabel("merchant-default"); - const kycPaytoHash = encodeCrock(hashPaytoUri(merchantPayto)); + const kycPaytoHash = encodeCrock(hashFullPaytoUri(merchantPayto)); // Make a decision where the exchange doesn't know the account yet. await postAmlDecision(t, { diff --git a/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts b/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts index 3a81867a9..b2a09d080 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts @@ -22,7 +22,7 @@ import { codecForKycProcessClientInformation, codecForQueryInstancesResponse, encodeCrock, - hashPaytoUri, + hashNormalizedPaytoUri, j2s, Logger, MerchantAccountKycRedirectsResponse, @@ -38,7 +38,11 @@ import { postAmlDecisionNoRules, withdrawViaBankV3, } from "../harness/environments.js"; -import { delayMs, GlobalTestState, harnessHttpLib } from "../harness/harness.js"; +import { + delayMs, + GlobalTestState, + harnessHttpLib, +} from "../harness/harness.js"; const logger = new Logger(`test-kyc-merchant-deposit.ts`); @@ -203,7 +207,9 @@ export async function runKycMerchantDepositTest(t: GlobalTestState) { amlPriv: amlKeypair.priv, amlPub: amlKeypair.pub, exchangeBaseUrl: exchange.baseUrl, - paytoHash: encodeCrock(hashPaytoUri(kycRespTwo.kyc_data[0].payto_uri)), + paytoHash: encodeCrock( + hashNormalizedPaytoUri(kycRespTwo.kyc_data[0].payto_uri), + ), }); while (true) { diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts index 24e8a1a4e..6d6ba3b1b 100644 --- a/packages/taler-harness/src/integrationtests/testrunner.ts +++ b/packages/taler-harness/src/integrationtests/testrunner.ts @@ -312,7 +312,7 @@ export interface TestInfo { function updateCurrentSymlink(testDir: string): void { const currLink = path.join( os.tmpdir(), - `taler-integrationtests-${os.userInfo().username}-current`, + `taler-integrationtests-latest-${os.userInfo().username}`, ); try { fs.unlinkSync(currLink); |