From afc3a7c9e673c9cd58a7df88a31e9debc41d4e47 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 27 Jul 2020 16:31:42 +0200 Subject: [PATCH] pytest: Replicate the missing amount_msat in `listpays` Since we started using `sendonion` in the `pay` plugin we no longer automatically have the `amount` annotation on (partial) payments. This replicates the issue so we can fix it. Reported-by: Rusty Russell <@rustyrussell> --- tests/test_pay.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index 33f2b4768..a95691e1e 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3195,6 +3195,7 @@ def test_pay_fail_unconfirmed_channel(node_factory, bitcoind): l1.rpc.pay(invl2) +@pytest.mark.xfail(strict=True) def test_bolt11_null_after_pay(node_factory, bitcoind): l1, l2 = node_factory.get_nodes(2) @@ -3211,8 +3212,10 @@ def test_bolt11_null_after_pay(node_factory, bitcoind): bitcoind.generate_block(6) sync_blockheight(bitcoind, [l1, l2]) - invl1 = l1.rpc.invoice(Millisatoshi(amount_sat * 2 * 1000), 'j', 'j')['bolt11'] + amt = Millisatoshi(amount_sat * 2 * 1000) + invl1 = l1.rpc.invoice(amt, 'j', 'j')['bolt11'] l2.rpc.pay(invl1) pays = l2.rpc.listpays()["pays"] - assert pays[0]["bolt11"] == invl1 + assert(pays[0]["bolt11"] == invl1) + assert('amount_msat' in pays[0] and pays[0]['amount_msat'] == amt)