mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
offerout: don't insist that invoice vendor match our vendor.
This was a bug in the spec, actually. Reported-by: @shesek Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Fixes: #4666
This commit is contained in:
parent
cb9e0268a7
commit
ce338dc88f
2 changed files with 21 additions and 4 deletions
|
@ -229,15 +229,11 @@ static struct command_result *listoffers_done(struct command *cmd,
|
|||
* or unset exactly as they are in the `offer`:
|
||||
* - `refund_for`
|
||||
* - `description`
|
||||
* - `vendor`
|
||||
*/
|
||||
err = inv_must_equal_offer(cmd, inv, refund_for);
|
||||
if (err)
|
||||
return err;
|
||||
err = inv_must_equal_offer(cmd, inv, description);
|
||||
if (err)
|
||||
return err;
|
||||
err = inv_must_equal_offer(cmd, inv, vendor);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
|
@ -4452,6 +4452,27 @@ def test_sendinvoice(node_factory, bitcoind):
|
|||
'label': 'test sendinvoice refund'})
|
||||
wait_for(lambda: only_one(l2.rpc.call('listoffers', [refund['offer_id']])['offers'])['used'] is True)
|
||||
|
||||
# Offer with vendor: we must not copy vendor into our invoice!
|
||||
offer = l1.rpc.call('offerout', {'amount': '10000sat',
|
||||
'description': 'simple test',
|
||||
'vendor': "clightning test suite"})
|
||||
|
||||
out = l2.rpc.call('sendinvoice', {'offer': offer['bolt12'],
|
||||
'label': 'test sendinvoice 3'})
|
||||
assert out['label'] == 'test sendinvoice 3'
|
||||
assert out['description'] == 'simple test'
|
||||
assert 'vendor' not in out
|
||||
assert 'bolt12' in out
|
||||
assert 'payment_hash' in out
|
||||
assert out['status'] == 'paid'
|
||||
assert 'payment_preimage' in out
|
||||
assert 'expires_at' in out
|
||||
assert out['msatoshi'] == 10000000
|
||||
assert out['amount_msat'] == Millisatoshi(10000000)
|
||||
assert 'pay_index' in out
|
||||
assert out['msatoshi_received'] == 10000000
|
||||
assert out['amount_received_msat'] == Millisatoshi(10000000)
|
||||
|
||||
|
||||
def test_self_pay(node_factory):
|
||||
"""Repro test for issue 4345: pay ourselves via the pay plugin.
|
||||
|
|
Loading…
Add table
Reference in a new issue