mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
test_lightningd: Modify test to remove repeated pay attempt.
This commit is contained in:
committed by
Christian Decker
parent
4ad1021c2c
commit
d9163dbb4f
@@ -904,21 +904,6 @@ class LightningDTests(BaseLightningDTests):
|
||||
c = self.fund_channel(lsrc, ldst, 10000000)
|
||||
self.wait_for_routes(lpayer, [c])
|
||||
|
||||
# FIXME: This repeated retrying should get implemented
|
||||
# in lightningd `pay` command directly.
|
||||
def pay(l, inv):
|
||||
start_time = time.time()
|
||||
retry = True
|
||||
err = None
|
||||
while retry:
|
||||
if time.time() > start_time + 10:
|
||||
raise err
|
||||
try:
|
||||
l.rpc.pay(inv)
|
||||
retry = False
|
||||
except Exception as errx:
|
||||
err = errx
|
||||
|
||||
## Setup
|
||||
# Construct lightningd
|
||||
l1 = self.node_factory.get_node()
|
||||
@@ -939,7 +924,7 @@ class LightningDTests(BaseLightningDTests):
|
||||
|
||||
## Test
|
||||
inv = l4.rpc.invoice(1234567, 'inv', 'for testing')['bolt11']
|
||||
pay(l1, inv)
|
||||
l1.rpc.pay(inv)
|
||||
|
||||
def test_bad_opening(self):
|
||||
# l1 asks for a too-long locktime
|
||||
|
||||
Reference in New Issue
Block a user