diff options
author | Florian Dold <florian@dold.me> | 2023-04-22 14:17:49 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-22 14:17:49 +0200 |
commit | 15feebecfeeda4758a96d1da99a98d9494c4bd2b (patch) | |
tree | 54a7536b93673202137927e097d4e5b5dcbc85eb /packages/taler-harness/src/integrationtests | |
parent | e331012c9f8efef86c6a8a9297b44a67ba8cda66 (diff) | |
download | wallet-core-15feebecfeeda4758a96d1da99a98d9494c4bd2b.tar.xz |
wallet-core: towards DD37 for deposits
Diffstat (limited to 'packages/taler-harness/src/integrationtests')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-deposit.ts | 22 | ||||
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-dbless.ts | 27 |
2 files changed, 40 insertions, 9 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-deposit.ts b/packages/taler-harness/src/integrationtests/test-deposit.ts index 6aa086107..8ea3fc12e 100644 --- a/packages/taler-harness/src/integrationtests/test-deposit.ts +++ b/packages/taler-harness/src/integrationtests/test-deposit.ts @@ -17,7 +17,11 @@ /** * Imports. */ -import { NotificationType, TransactionState } from "@gnu-taler/taler-util"; +import { + NotificationType, + TransactionMajorState, + TransactionMinorState, +} from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, getPayto } from "../harness/harness.js"; import { @@ -52,11 +56,19 @@ export async function runDepositTest(t: GlobalTestState) { const depositTxId = dgIdResp.transactionId; + const depositTrack = walletClient.waitForNotificationCond( + (n) => + n.type == NotificationType.TransactionStateTransition && + n.transactionId == depositTxId && + n.newTxState.major == TransactionMajorState.Pending && + n.newTxState.minor == TransactionMinorState.Track, + ); + const depositDone = walletClient.waitForNotificationCond( (n) => n.type == NotificationType.TransactionStateTransition && n.transactionId == depositTxId && - n.newTxState == TransactionState.Done, + n.newTxState.major == TransactionMajorState.Done, ); const depositGroupResult = await walletClient.client.call( @@ -70,6 +82,12 @@ export async function runDepositTest(t: GlobalTestState) { t.assertDeepEqual(depositGroupResult.transactionId, depositTxId); + await depositTrack; + + await exchange.runAggregatorOnceWithTimetravel({ + timetravelMicroseconds: 1000 * 1000 * 60 * 60 * 3, + }); + await depositDone; const transactions = await walletClient.client.call( diff --git a/packages/taler-harness/src/integrationtests/test-wallet-dbless.ts b/packages/taler-harness/src/integrationtests/test-wallet-dbless.ts index a1de7617b..35c60a89d 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-dbless.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-dbless.ts @@ -59,16 +59,29 @@ export async function runWalletDblessTest(t: GlobalTestState) { const reserveKeyPair = await cryptoApi.createEddsaKeypair({}); - await topupReserveWithDemobank( + let reserveUrl = new URL( + `reserves/${reserveKeyPair.pub}`, + exchange.baseUrl, + ); + reserveUrl.searchParams.set("timeout_ms", "30000"); + const longpollReq = http.fetch(reserveUrl.href, { + method: "GET", + }); + + await topupReserveWithDemobank({ + amount: "TESTKUDOS:10", http, - reserveKeyPair.pub, - bank.baseUrl, - bank.bankAccessApiBaseUrl, + reservePub: reserveKeyPair.pub, + bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl, + bankBaseUrl: bank.baseUrl, exchangeInfo, - "TESTKUDOS:10", - ); + }); + + console.log("waiting for longpoll request"); + const resp = await longpollReq; + console.log(`got response, status ${resp.status}`); - await exchange.runWirewatchOnce(); + console.log(exchangeInfo); await checkReserve(http, exchange.baseUrl, reserveKeyPair.pub); |