Proof with a note: decoded proof should include it.
(node_factory, bitcoind)
| 7340 | |
| 7341 | |
| 7342 | def test_createproof_note(node_factory, bitcoind): |
| 7343 | """Proof with a note: decoded proof should include it.""" |
| 7344 | l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, |
| 7345 | opts=[{}, |
| 7346 | {'dev-allow-localhost': None}, |
| 7347 | {'dev-allow-localhost': None}]) |
| 7348 | |
| 7349 | offer = l3.rpc.offer('5000msat', 'note test') |
| 7350 | inv = l1.rpc.fetchinvoice(offer['bolt12'])['invoice'] |
| 7351 | l1.rpc.xpay(inv) |
| 7352 | |
| 7353 | ret = l1.rpc.call('createproof', {'invstring': inv, 'note': 'I paid for this!'}) |
| 7354 | proof = only_one(ret['proofs']) |
| 7355 | |
| 7356 | decoded = l1.rpc.decode(proof['bolt12']) |
| 7357 | assert decoded['valid'] is True |
| 7358 | assert decoded['proof_note'] == 'I paid for this!' |
| 7359 | |
| 7360 | # Proof without note decodes fine with absent payer_note. |
| 7361 | ret2 = l1.rpc.call('createproof', {'invstring': inv}) |
| 7362 | decoded2 = l1.rpc.decode(only_one(ret2['proofs'])['bolt12']) |
| 7363 | assert decoded2['valid'] is True |
| 7364 | assert 'proof_note' not in decoded2 |
| 7365 | |
| 7366 | |
| 7367 | def test_createproof_include(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected