tests/test_lightningd.py: move port into node.

We're about to change the JSONRPC, so let's put an explicit 'port' into
our node class.

We initialize it at startup time: in future I hope to use ephemeral ports
to make our tests more easily parallelizable.

Suggested-by: @cdecker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-05-07 13:14:39 +09:30
committed by Christian Decker
parent 7d27501c94
commit 6ba9a7cb57
2 changed files with 109 additions and 109 deletions

View File

@@ -367,6 +367,10 @@ class LightningNode(object):
c.close()
db.close()
def start(self):
self.daemon.start()
self.port = self.rpc.getinfo()['port']
def stop(self, timeout=10):
""" Attempt to do a clean shutdown, but kill if it hangs
"""
@@ -403,7 +407,7 @@ class LightningNode(object):
else:
self.daemon.stop()
self.daemon.start()
self.start()
def fund_channel(self, l2, amount):