diff --git a/electrum/commands.py b/electrum/commands.py index eb3641474..f85d15eee 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1489,8 +1489,10 @@ class Commands(Logger): amount_sat = amount_msat // 1000 result = { "status": status, - "amount_sat_received": amount_sat + "received_amount_sat": amount_sat, } + if info is not None: + result["invoice_amount_sat"] = (info.amount_msat or 0) // 1000 return result @command('w') diff --git a/tests/test_commands.py b/tests/test_commands.py index 412b0214d..6ef5d1dad 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -495,7 +495,7 @@ class TestCommandsTestnet(ElectrumTestCase): mock.patch.object(wallet.lnworker, 'get_payment_mpp_amount_msat', return_value=10_000 * 1000): status: dict = await cmds.check_hold_invoice(payment_hash=payment_hash, wallet=wallet) assert status['status'] == 'paid' - assert status['amount_sat_received'] == 10000 + assert status['received_amount_sat'] == 10000 settle_result = await cmds.settle_hold_invoice( preimage=preimage.hex(), @@ -511,7 +511,8 @@ class TestCommandsTestnet(ElectrumTestCase): )): settled_status: dict = await cmds.check_hold_invoice(payment_hash=payment_hash, wallet=wallet) assert settled_status['status'] == 'settled' - assert settled_status['amount_sat_received'] == 10000 + assert settled_status['received_amount_sat'] == 10000 + assert settled_status['invoice_amount_sat'] == 10000 with self.assertRaises(AssertionError): # cancelling a settled invoice should raise