mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
offers: split offer send_invoice generation into new JSON command
We split `send_invoice` offers inoo offerout (for want of a better name). This simplifies the API. Also took the opportunity to move the `vendor` tag to immediately follow `description` (our tests use arguments by keywords, so no change there). Suggested-by: shesek Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3991,9 +3991,8 @@ def test_sendinvoice(node_factory, bitcoind):
|
||||
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
|
||||
|
||||
# Simple offer to send money (balances channel a little)
|
||||
offer = l1.rpc.call('offer', {'amount': '100000sat',
|
||||
'description': 'simple test',
|
||||
'send_invoice': True})['bolt12']
|
||||
offer = l1.rpc.call('offerout', {'amount': '100000sat',
|
||||
'description': 'simple test'})['bolt12']
|
||||
print(offer)
|
||||
|
||||
# Fetchinvoice will refuse, since you're supposed to send an invoice.
|
||||
@@ -4019,9 +4018,9 @@ def test_sendinvoice(node_factory, bitcoind):
|
||||
inv = l1.rpc.call('fetchinvoice', {'offer': offer})
|
||||
l1.rpc.pay(inv['invoice'])
|
||||
|
||||
refund = l2.rpc.call('offer', {'amount': '100msat',
|
||||
'description': 'refund test',
|
||||
'refund_for': inv['invoice']})['bolt12']
|
||||
refund = l2.rpc.call('offerout', {'amount': '100msat',
|
||||
'description': 'refund test',
|
||||
'refund_for': inv['invoice']})['bolt12']
|
||||
|
||||
l1.rpc.call('sendinvoice', {'offer': refund,
|
||||
'label': 'test sendinvoice refund'})
|
||||
|
||||
Reference in New Issue
Block a user