diff options
author | Florian Dold <florian@dold.me> | 2024-04-02 20:46:20 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-04-02 20:46:20 +0200 |
commit | 43f8ef1c31a364bd620711d2444bf162c81589c5 (patch) | |
tree | 3f4094f60d7e2c8525e972b04de24dc14022e6f9 /packages/taler-harness | |
parent | 2b2a8278844ae53818ca9845630d28dd5efde7d0 (diff) |
wallet-core: preparations for refresh-blocked test
Diffstat (limited to 'packages/taler-harness')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-denom-expire.ts | 6 | ||||
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts | 50 |
2 files changed, 53 insertions, 3 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-wallet-denom-expire.ts b/packages/taler-harness/src/integrationtests/test-wallet-denom-expire.ts index e04aea708..4ce8cde4c 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-denom-expire.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-denom-expire.ts @@ -87,6 +87,8 @@ export async function runWalletDenomExpireTest(t: GlobalTestState) { await merchant.start(); await merchant.pingUntilAvailable(); + console.log("merchant started, configuring instances"); + await merchant.addInstanceWithWireAccount({ id: "default", name: "Default Instance", @@ -126,7 +128,7 @@ export async function runWalletDenomExpireTest(t: GlobalTestState) { // into the future. console.log("applying first time travel"); await applyTimeTravelV2( - Duration.toMilliseconds(Duration.fromSpec({ days: 400 })), + Duration.toMilliseconds(Duration.fromSpec({ days: 800 })), { walletClient, exchange, @@ -134,6 +136,8 @@ export async function runWalletDenomExpireTest(t: GlobalTestState) { }, ); + t.logStep("before-wait-denom-loss"); + // Should be detected automatically, as exchange entry is surely outdated. await denomLossCond; diff --git a/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts b/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts index 806802612..8c568d190 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts @@ -17,22 +17,50 @@ /** * Imports. */ +import { j2s } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; +import { CoinConfig } from "../harness/denomStructures.js"; import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironmentV2, createWalletDaemonWithClient, + makeTestPaymentV2, withdrawViaBankV2, } from "../harness/helpers.js"; +const coinCommon = { + cipher: "RSA" as const, + durationLegal: "3 years", + durationSpend: "2 years", + durationWithdraw: "7 days", + feeDeposit: "TESTKUDOS:0", + feeRefresh: "TESTKUDOS:0", + feeRefund: "TESTKUDOS:0", + feeWithdraw: "TESTKUDOS:0", + rsaKeySize: 1024, +}; + /** * Run test for refreshe after a payment. */ export async function runWalletRefreshBlockedTest(t: GlobalTestState) { // Set up test environment + const coinConfigList: CoinConfig[] = [ + { + ...coinCommon, + name: "n1", + value: "TESTKUDOS:1", + }, + { + ...coinCommon, + name: "n5", + value: "TESTKUDOS:5", + }, + ]; + const { walletClient, bank, exchange, merchant } = - await createSimpleTestkudosEnvironmentV2(t); + await createSimpleTestkudosEnvironmentV2(t, coinConfigList); // Withdraw digital cash into the wallet. @@ -60,7 +88,25 @@ export async function runWalletRefreshBlockedTest(t: GlobalTestState) { devExperimentUri: "taler://dev-experiment/start-block-refresh", }); - // FIXME: Now force a refresh, check balance + await makeTestPaymentV2(t, { + merchant, + walletClient: w1, + order: { + summary: "test", + amount: "TESTKUDOS:2", + }, + }); + + const bal = await w1.call(WalletApiOperation.GetBalances, {}); + console.log(`balance: ${j2s(bal)}`); + + const balDet = await w1.call(WalletApiOperation.GetBalanceDetail, { + currency: "TESTKUDOS", + }); + console.log(`balance details: ${j2s(balDet)}`); + + // FIXME: Now check deposit/p2p/pay + t.assertTrue(false); } runWalletRefreshBlockedTest.suites = ["wallet"]; |