diff options
author | Florian Dold <florian@dold.me> | 2023-09-05 10:46:06 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-05 10:48:41 +0200 |
commit | a60a1d867cfe6a12f1e6fadfa037f022e9385107 (patch) | |
tree | bc77a92b327cd0e4933fa4b3fe15f1c775e24235 /packages/taler-wallet-core/src | |
parent | e1d86816a7c07cb8ca2d54676d5cdbbe513f2ba7 (diff) | |
download | wallet-core-a60a1d867cfe6a12f1e6fadfa037f022e9385107.tar.xz |
harness: remove deprecated testing APIs
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/wallet-api-types.ts | 12 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index 4d9d40c43..72cd37b10 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -119,6 +119,7 @@ import { CreateStoredBackupResponse, RecoverStoredBackupRequest, DeleteStoredBackupRequest, + TestingSetTimetravelRequest, } from "@gnu-taler/taler-util"; import { AuditorTrustRecord, WalletContractData } from "./db.js"; import { @@ -215,6 +216,7 @@ export enum WalletApiOperation { ValidateIban = "validateIban", TestingWaitTransactionsFinal = "testingWaitTransactionsFinal", TestingWaitRefreshesFinal = "testingWaitRefreshesFinal", + TestingSetTimetravel = "testingSetTimetravel", GetScopedCurrencyInfo = "getScopedCurrencyInfo", ListStoredBackups = "listStoredBackups", CreateStoredBackup = "createStoredBackup", @@ -990,6 +992,15 @@ export type DumpCoinsOp = { }; /** + * Add an offset to the wallet's internal time. + */ +export type TestingSetTimetravelOp = { + op: WalletApiOperation.TestingSetTimetravel; + request: TestingSetTimetravelRequest; + response: EmptyObject; +}; + +/** * Wait until all transactions are in a final state. */ export type TestingWaitTransactionsFinal = { @@ -1111,6 +1122,7 @@ export type WalletOperations = { [WalletApiOperation.ValidateIban]: ValidateIbanOp; [WalletApiOperation.TestingWaitTransactionsFinal]: TestingWaitTransactionsFinal; [WalletApiOperation.TestingWaitRefreshesFinal]: TestingWaitRefreshesFinal; + [WalletApiOperation.TestingSetTimetravel]: TestingSetTimetravelOp; [WalletApiOperation.GetScopedCurrencyInfo]: GetScopedCurrencyInfoOp; [WalletApiOperation.CreateStoredBackup]: CreateStoredBackupsOp; [WalletApiOperation.ListStoredBackups]: ListStoredBackupsOp; diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 5666d67e0..4194ab9eb 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -126,6 +126,8 @@ import { DeleteStoredBackupRequest, RecoverStoredBackupRequest, codecForRecoverStoredBackupRequest, + codecForTestingSetTimetravelRequest, + setDangerousTimetravel, } from "@gnu-taler/taler-util"; import { HttpRequestLibrary, @@ -1674,6 +1676,11 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( return await waitUntilDone(ws); case WalletApiOperation.TestingWaitRefreshesFinal: return await waitUntilRefreshesDone(ws); + case WalletApiOperation.TestingSetTimetravel: { + const req = codecForTestingSetTimetravelRequest().decode(payload); + setDangerousTimetravel(req.offsetMs); + ws.workAvailable.trigger(); + } // default: // assertUnreachable(operation); } |