diff --git a/lightningd/invoice.c b/lightningd/invoice.c index 652950927..26ecaa8d0 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -1152,7 +1152,7 @@ static struct command_result *json_invoice(struct command *cmd, info->cmd = cmd; if (!param_check(cmd, buffer, params, - p_req("amount_msat|msatoshi", param_positive_msat_or_any, &msatoshi_val), + p_req("amount_msat", param_positive_msat_or_any, &msatoshi_val), p_req("label", param_label, &info->label), p_req("description", param_escaped_string, &desc_val), p_opt_def("expiry", param_u64, &expiry, 3600*24*7), @@ -1980,7 +1980,7 @@ static struct command_result *json_preapprovekeysend(struct command *cmd, if (!param(cmd, buffer, params, p_req("destination", param_node_id, &destination), p_req("payment_hash", param_sha256, &payment_hash), - p_req("amount_msat|msatoshi", param_msat, &amount), + p_req("amount_msat", param_msat, &amount), NULL)) return command_param_failed(); diff --git a/lightningd/pay.c b/lightningd/pay.c index 32fcde699..d5f7b63f0 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -1310,7 +1310,7 @@ static struct command_result *json_sendonion(struct command *cmd, p_opt_def("partid", param_u64, &partid, 0), /* FIXME: parameter should be invstring now */ p_opt("bolt11", param_invstring, &invstring), - p_opt_def("amount_msat|msatoshi", param_msat, &msat, AMOUNT_MSAT(0)), + p_opt_def("amount_msat", param_msat, &msat, AMOUNT_MSAT(0)), p_opt("destination", param_node_id, &destination), p_opt("localinvreqid", param_sha256, &local_invreq_id), p_opt("groupid", param_u64, &group), @@ -1393,8 +1393,7 @@ static struct command_result *param_route_hops(struct command *cmd, int *ignored; if (!param(cmd, buffer, t, - /* deprecated: getroute gives both, so we allow both! */ - p_req_dup_ok("amount_msat|msatoshi", param_msat, &amount_msat), + p_req("amount_msat", param_msat, &amount_msat), p_req("id", param_node_id, &id), p_req("delay", param_number, &delay), p_req("channel", param_short_channel_id, &channel), @@ -1526,7 +1525,7 @@ static struct command_result *json_sendpay(struct command *cmd, p_req("route", param_route_hops, &route), p_req("payment_hash", param_sha256, &rhash), p_opt("label", param_escaped_string, &label), - p_opt("amount_msat|msatoshi", param_msat, &msat), + p_opt("amount_msat", param_msat, &msat), /* FIXME: parameter should be invstring now */ p_opt("bolt11", param_invstring, &invstring), p_opt("payment_secret", param_secret, &payment_secret), diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index cbb367f6f..0c8012cba 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -913,7 +913,7 @@ static struct command_result *json_fetchinvoice(struct command *cmd, if (!param(cmd, buffer, params, p_req("offer", param_offer, &sent->offer), - p_opt("amount_msat|msatoshi", param_msat, &msat), + p_opt("amount_msat", param_msat, &msat), p_opt("quantity", param_u64, &quantity), p_opt("recurrence_counter", param_number, &recurrence_counter), p_opt("recurrence_start", param_number, &recurrence_start), diff --git a/plugins/keysend.c b/plugins/keysend.c index c53cd4b7f..0c1df8060 100644 --- a/plugins/keysend.c +++ b/plugins/keysend.c @@ -255,7 +255,7 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf, if (!param(cmd, buf, params, p_req("destination", param_node_id, &destination), - p_req("amount_msat|msatoshi", param_msat, &msat), + p_req("amount_msat", param_msat, &msat), p_opt("label", param_string, &label), p_opt_def("maxfeepercent", param_millionths, &maxfee_pct_millionths, 500000), diff --git a/plugins/pay.c b/plugins/pay.c index 153d86a32..fa5d3e4ec 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1038,7 +1038,7 @@ static struct command_result *json_pay(struct command *cmd, if (!param(cmd, buf, params, /* FIXME: parameter should be invstring now */ p_req("bolt11", param_invstring, &b11str), - p_opt("amount_msat|msatoshi", param_msat, &msat), + p_opt("amount_msat", param_msat, &msat), p_opt("label", param_string, &label), p_opt_def("riskfactor", param_millionths, &riskfactor_millionths, 10000000), diff --git a/plugins/topology.c b/plugins/topology.c index 38b458026..3432fe6d5 100644 --- a/plugins/topology.c +++ b/plugins/topology.c @@ -194,7 +194,7 @@ static struct command_result *json_getroute(struct command *cmd, if (!param(cmd, buffer, params, p_req("id", param_node_id, &info->destination), - p_req("amount_msat|msatoshi", param_msat, &info->msat), + p_req("amount_msat", param_msat, &info->msat), p_req("riskfactor", param_millionths, &info->riskfactor_millionths), p_opt_def("cltv", param_number, &info->cltv, 9), p_opt_def("fromid", param_node_id, &info->source, local_id), diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index 5e480cdb7..eda1d9f61 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -266,8 +266,8 @@ def test_cln_plugin_reentrant(node_factory, executor): # Now create two invoices, and pay them both. Neither should # succeed, but we should queue them on the plugin. - i1 = l1.rpc.invoice(label='lbl1', msatoshi='42sat', description='desc')['bolt11'] - i2 = l1.rpc.invoice(label='lbl2', msatoshi='31337sat', description='desc')['bolt11'] + i1 = l1.rpc.invoice(label='lbl1', amount_msat='42sat', description='desc')['bolt11'] + i2 = l1.rpc.invoice(label='lbl2', amount_msat='31337sat', description='desc')['bolt11'] f1 = executor.submit(l2.rpc.pay, i1) f2 = executor.submit(l2.rpc.pay, i2) diff --git a/tests/test_pay.py b/tests/test_pay.py index 7531a732c..e17e8ed0b 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -5131,26 +5131,6 @@ def test_pay_middle_fail(node_factory, bitcoind, executor): l1.rpc.waitsendpay('00' * 32) -def test_sendpay_dual_amounts(node_factory): - """Test that handing *both* msatoshi and amount_msat to sendpay works""" - l1 = node_factory.get_node(options={'allow-deprecated-apis': True}) - - route = [{'amount_msat': 1011, - 'msatoshi': 1011, - 'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', - 'delay': 20, - 'channel': '1x1x1'}, - {'amount_msat': 1000, - 'msatoshi': 1000, - 'id': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d', - 'delay': 10, - 'channel': '2x2x2'}] - l1.rpc.check("sendpay", route=route, payment_hash="00" * 32) - - with pytest.raises(RpcError, match=r'No connection to first peer found'): - l1.rpc.sendpay(route=route, payment_hash="00" * 32) - - @unittest.skipIf(TEST_NETWORK != 'regtest', "Invoice is network specific") @pytest.mark.slow_test def test_payerkey(node_factory):