Skip to content

Commit

Permalink
test: wait for ln nodes to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Nov 6, 2024
1 parent b4f244f commit b637bd3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ln_basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ def setup_network(self):
self.log.info(self.warnet(f"deploy {self.network_dir}"))
self.wait_for_all_tanks_status(target="running")

def wait_for_all_ln_rpc():
nodes = ["tank-0000-lnd", "tank-0001-lnd", "tank-0002-lnd"]
for node in nodes:
try:
self.warnet(f"ln rpc {node} getinfo")
except Exception as e:
print(f"LN node {node} not ready for rpc yet: {e}")
return False
return True

self.wait_for_predicate(wait_for_all_ln_rpc)

def fund_wallets(self):
self.warnet("bitcoin rpc tank-0000 createwallet miner")
self.warnet("bitcoin rpc tank-0000 -generate 110")
Expand Down

0 comments on commit b637bd3

Please sign in to comment.