Topology: 1----2 | | 3----4 This a payment that fails if fee is not allocated as part of the flow constraints. The payment should be straightforward, no failures are expected.
(node_factory)
| 427 | |
| 428 | |
| 429 | def test_fee_allocation(node_factory): |
| 430 | """ |
| 431 | Topology: |
| 432 | 1----2 |
| 433 | | | |
| 434 | 3----4 |
| 435 | This a payment that fails if fee is not allocated as part of the flow |
| 436 | constraints. The payment should be straightforward, no failures are |
| 437 | expected. |
| 438 | """ |
| 439 | # We set high fees at 3% and load a plugin that breaks if a sendpay_failure |
| 440 | # notification is received. |
| 441 | opts = [ |
| 442 | { |
| 443 | "disable-mpp": None, |
| 444 | "fee-base": 1000, |
| 445 | "fee-per-satoshi": 30000, |
| 446 | "plugin": os.path.join(os.getcwd(), "tests/plugins/no_fail.py"), |
| 447 | 'allow-deprecated-apis': True, |
| 448 | }, |
| 449 | ] |
| 450 | l1, l2, l3, l4 = node_factory.get_nodes(4, opts=opts * 4) |
| 451 | start_channels( |
| 452 | [(l1, l2, 1000000), (l2, l4, 2000000), (l1, l3, 1000000), (l3, l4, 2000000)] |
| 453 | ) |
| 454 | |
| 455 | inv = l4.rpc.invoice("1500000sat", "inv", "description") |
| 456 | l1.rpc.call("renepay", {"invstring": inv["bolt11"], "maxfee": "75000sat"}) |
| 457 | l1.wait_for_htlcs() |
| 458 | invoice = only_one(l4.rpc.listinvoices("inv")["invoices"]) |
| 459 | assert invoice["amount_received_msat"] >= Millisatoshi("1500000sat") |
| 460 | |
| 461 | # is the no_fail.py plugin still running? |
| 462 | l1.rpc.call("nofail") |
| 463 | |
| 464 | |
| 465 | def test_htlc_max(node_factory): |
nothing calls this directly
no test coverage detected