Using a diamond graph, with inferred `channel_hint`s, see if we remember
(node_factory)
| 6271 | |
| 6272 | |
| 6273 | def test_pay_remember_hint(node_factory): |
| 6274 | """Using a diamond graph, with inferred `channel_hint`s, see if we remember |
| 6275 | """ |
| 6276 | sender, fw1, fw2, recipient, = diamond_network(node_factory) |
| 6277 | |
| 6278 | inv = recipient.rpc.invoice( |
| 6279 | 4200000, |
| 6280 | "lbl1", |
| 6281 | "desc1", |
| 6282 | exposeprivatechannels=[], # suppress routehints, so fees alone control route |
| 6283 | )['bolt11'] |
| 6284 | |
| 6285 | p = sender.rpc.pay(inv) |
| 6286 | |
| 6287 | # Ensure we failed the first, cheap, path, and then tried the successful one. |
| 6288 | assert(p['parts'] == 2) |
| 6289 | |
| 6290 | # Now for the final trick: a new payment should remember the |
| 6291 | # previous failure, and go directly for the successful route |
| 6292 | # through fw2 |
| 6293 | |
| 6294 | inv = recipient.rpc.invoice( |
| 6295 | 4200000, |
| 6296 | "lbl2", |
| 6297 | "desc2", |
| 6298 | exposeprivatechannels=[], # suppress routehints, so fees alone control route |
| 6299 | )['bolt11'] |
| 6300 | |
| 6301 | # We should not have touched fw1, and should succeed after a single call |
| 6302 | p = sender.rpc.pay(inv) |
| 6303 | assert(p['parts'] == 1) |
| 6304 | |
| 6305 | |
| 6306 | def test_injectpaymentonion_simple(node_factory, executor): |
nothing calls this directly
no test coverage detected