|
|
|
@ -1180,7 +1180,7 @@ class TestPeer(ElectrumTestCase): |
|
|
|
graph = self.prepare_chans_and_peers_in_graph(self.GRAPH_DEFINITIONS['square_graph']) |
|
|
|
graph = self.prepare_chans_and_peers_in_graph(self.GRAPH_DEFINITIONS['square_graph']) |
|
|
|
await self._run_mpp(graph, {'mpp_invoice': False}, {'mpp_invoice': True}) |
|
|
|
await self._run_mpp(graph, {'mpp_invoice': False}, {'mpp_invoice': True}) |
|
|
|
|
|
|
|
|
|
|
|
async def _run_trampoline_payment(self, is_legacy, direct, drop_dave=None): |
|
|
|
async def _run_trampoline_payment(self, is_legacy, direct, drop_dave=None, test_mpp_consolidation=False): |
|
|
|
if drop_dave is None: drop_dave = [] |
|
|
|
if drop_dave is None: drop_dave = [] |
|
|
|
|
|
|
|
|
|
|
|
async def pay(lnaddr, pay_req): |
|
|
|
async def pay(lnaddr, pay_req): |
|
|
|
@ -1217,7 +1217,16 @@ class TestPeer(ElectrumTestCase): |
|
|
|
# insert a channel from bob to carol |
|
|
|
# insert a channel from bob to carol |
|
|
|
graph_definition['bob']['channels']['carol'] = high_fee_channel |
|
|
|
graph_definition['bob']['channels']['carol'] = high_fee_channel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if test_mpp_consolidation: |
|
|
|
|
|
|
|
# deplete alice to carol so that all htlcs go through bob |
|
|
|
|
|
|
|
graph_definition['alice']['channels']['carol'] = depleted_channel |
|
|
|
|
|
|
|
|
|
|
|
graph = self.prepare_chans_and_peers_in_graph(graph_definition) |
|
|
|
graph = self.prepare_chans_and_peers_in_graph(graph_definition) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if test_mpp_consolidation: |
|
|
|
|
|
|
|
graph.workers['dave'].features |= LnFeatures.BASIC_MPP_OPT |
|
|
|
|
|
|
|
graph.workers['alice'].network.config.TEST_FORCE_MPP = True |
|
|
|
|
|
|
|
|
|
|
|
peers = graph.peers.values() |
|
|
|
peers = graph.peers.values() |
|
|
|
if is_legacy: |
|
|
|
if is_legacy: |
|
|
|
# turn off trampoline features in invoice |
|
|
|
# turn off trampoline features in invoice |
|
|
|
@ -1231,6 +1240,11 @@ class TestPeer(ElectrumTestCase): |
|
|
|
|
|
|
|
|
|
|
|
await f() |
|
|
|
await f() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@needs_test_with_all_chacha20_implementations |
|
|
|
|
|
|
|
async def test_trampoline_mpp_consolidation(self): |
|
|
|
|
|
|
|
with self.assertRaises(PaymentDone): |
|
|
|
|
|
|
|
await self._run_trampoline_payment(is_legacy=True, direct=False, test_mpp_consolidation=True) |
|
|
|
|
|
|
|
|
|
|
|
@needs_test_with_all_chacha20_implementations |
|
|
|
@needs_test_with_all_chacha20_implementations |
|
|
|
async def test_payment_trampoline_legacy(self): |
|
|
|
async def test_payment_trampoline_legacy(self): |
|
|
|
with self.assertRaises(PaymentDone): |
|
|
|
with self.assertRaises(PaymentDone): |
|
|
|
|