From 308becc749e2167398ba3deab060c9a725e310e9 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 11 Jun 2020 16:55:58 +0200 Subject: [PATCH] paymod: Reorder paymod arguments to match pay We've been adding modifiers and arguments out of order, and we need the arguments order to match up if we want `paymod` to be a drop-in replacement. --- plugins/pay.c | 8 ++++---- tests/test_pay.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/pay.c b/plugins/pay.c index e7fb8ad28..8da683134 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1878,12 +1878,12 @@ static struct command_result *json_paymod(struct command *cmd, p_opt("label", param_string, &label), p_opt_def("riskfactor", param_millionths, &riskfactor_millionths, 10000000), - p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)), - p_opt_def("maxdelay", param_number, &maxdelay, - maxdelay_default), - p_opt_def("retry_for", param_number, &retryfor, 60), p_opt_def("maxfeepercent", param_millionths, &maxfee_pct_millionths, 500000), + p_opt_def("retry_for", param_number, &retryfor, 60), + p_opt_def("maxdelay", param_number, &maxdelay, + maxdelay_default), + p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)), #if DEVELOPER p_opt_def("use_shadow", param_bool, &use_shadow, true), #endif diff --git a/tests/test_pay.py b/tests/test_pay.py index 829cff2d0..e9f572844 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3077,7 +3077,7 @@ def test_pay_modifiers(node_factory): # Make sure that the dummy param is in the help (and therefore assigned to # the modifier data). hlp = l1.rpc.help("paymod")['help'][0] - assert(hlp['command'] == 'paymod bolt11 [msatoshi] [label] [riskfactor] [exemptfee] [maxdelay] [retry_for] [maxfeepercent] [use_shadow]') + assert(hlp['command'] == 'paymod bolt11 [msatoshi] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [use_shadow]') inv = l2.rpc.invoice(123, 'lbl', 'desc')['bolt11'] r = l1.rpc.paymod(inv)