listinvoice: populate local_offer_id when iterating whole db.

And add the local_offer_id to the schemas too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSONRPC: `listoffers` now shows `local_offer_id` when listing all offers.
This commit is contained in:
Rusty Russell
2021-07-01 13:58:56 +09:30
parent 68962083e7
commit 33a40ca73b
11 changed files with 33 additions and 17 deletions

View File

@@ -3995,6 +3995,9 @@ def test_fetchinvoice(node_factory, bitcoind):
l1.rpc.pay(inv2['invoice'])
assert only_one(l3.rpc.call('listoffers', [offer1['offer_id']])['offers'])['used'] is True
# listinvoices will show these on l3
assert [x['local_offer_id'] for x in l3.rpc.listinvoices()['invoices']] == [offer1['offer_id'], offer1['offer_id']]
# We can also set the amount explicitly, to tip.
inv1 = l1.rpc.call('fetchinvoice', {'offer': offer1['bolt12'], 'msatoshi': 3})
assert l1.rpc.call('decode', [inv1['invoice']])['amount_msat'] == 3