summaryrefslogtreecommitdiff
path: root/src/headless
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-23 17:47:35 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-23 17:47:35 +0530
commitc4d289956275677b24459237d13ed8c23a606079 (patch)
tree53f340c001c36fbb15dbd0f7ace2606371c52c30 /src/headless
parent1b0b3f146c829caf04a42984d1a09a7c80b867c4 (diff)
downloadwallet-core-c4d289956275677b24459237d13ed8c23a606079.tar.gz
wallet-core-c4d289956275677b24459237d13ed8c23a606079.tar.bz2
wallet-core-c4d289956275677b24459237d13ed8c23a606079.zip
implement time travelling
Diffstat (limited to 'src/headless')
-rw-r--r--src/headless/taler-wallet-cli.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts
index c4d8664d9..9a21d2a1d 100644
--- a/src/headless/taler-wallet-cli.ts
+++ b/src/headless/taler-wallet-cli.ts
@@ -31,6 +31,7 @@ import { Bank } from "./bank";
import { classifyTalerUri, TalerUriType } from "../util/taleruri";
import util = require("util");
import { Configuration } from "../util/talerconfig";
+import { setDangerousTimetravel } from "../util/time";
// Backwards compatibility with nodejs<0.11, where TextEncoder and TextDecoder
// are not globals yet.
@@ -119,6 +120,14 @@ const walletCli = clk
.maybeOption("walletDbFile", ["--wallet-db"], clk.STRING, {
help: "location of the wallet database file"
})
+ .maybeOption("timetravel", ["--timetravel"], clk.INT, {
+ help: "modify system time by given offset in microseconds",
+ onPresentHandler: (x) => {
+ // Convert microseconds to milliseconds and do timetravel
+ logger.info(`timetravelling ${x} microseconds`);
+ setDangerousTimetravel(x / 1000);
+ },
+ })
.maybeOption("inhibit", ["--inhibit"], clk.STRING, {
help:
"Inhibit running certain operations, useful for debugging and testing.",