pytest: Added gossip test for new daemon

This commit is contained in:
Christian Decker
2017-04-24 20:27:53 +02:00
committed by Rusty Russell
parent b4beab6537
commit dc7b832e83
2 changed files with 54 additions and 0 deletions

View File

@@ -260,3 +260,15 @@ class LightningNode(object):
return self.executor.submit(wait_connected)
else:
return wait_connected()
def openchannel(self, remote_node, capacity):
addr = self.rpc.newaddr()['address']
txid = self.bitcoin.rpc.sendtoaddress(addr, capacity / 10**6)
tx = self.bitcoin.rpc.getrawtransaction(txid)
self.rpc.addfunds(tx)
self.rpc.fundchannel(remote_node.info['id'], capacity)
self.daemon.wait_for_log('sendrawtx exit 0, gave')
time.sleep(1)
self.bitcoin.rpc.generate(6)
self.daemon.wait_for_log('Normal operation')