commit 40e7618de0957c8a239d906e8ab04d9333edb27f
parent 00f9dbb6c0281a7cc4533af515bd5884a03af0a0
Author: Florian Dold <florian@dold.me>
Date: Wed, 10 Jun 2026 16:11:50 +0200
improve devtesting wrapper
Diffstat:
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/roles/devtesting/tasks/files/taler-devtesting b/roles/devtesting/tasks/files/taler-devtesting
@@ -23,13 +23,27 @@ def get_nexus_currency():
@cli.command()
-@click.argument("credit-payto")
-@click.option("--debit-payto")
-def fake_incoming(credit_payto, debit_payto):
+@click.option("--credit-payto", "The credited account IBAN payto URI")
+@click.option("--debit-payto", "The debited account IBAN payto URI")
+@click.option(
+ "--subject",
+ help="The payment subject, credit-payto 'message' parameter takes the precedence",
+)
+@click.option(
+ "--amount",
+ help="The payment amount, credit-payto 'amount' parameter takes the precedence",
+)
+def fake_incoming(credit_payto, debit_payto, subject, amount):
currency = get_nexus_currency()
- debit_opts = []
+ opts = []
if debit_payto is not None:
- debit_opts = ["--debit-payto", debit_payto]
+ opts += ["--debit-payto", debit_payto]
+ if credit_payto is not None:
+ opts += ["--credit-payto", credit_payto]
+ if subject is not None:
+ opts += ["--subject", subject]
+ if amount is not None:
+ opts += ["--amount", amount]
print(f"Faking incoming {currency} transaction", file=sys.stderr)
print(f"Debit Payto: ", debit_payto, file=sys.stderr)
subprocess.run(
@@ -40,9 +54,7 @@ def fake_incoming(credit_payto, debit_payto):
"libeufin-nexus",
"testing",
"fake-incoming",
- "--credit-payto",
- credit_payto,
- *debit_opts,
+ *opts,
],
check=True,
)