mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
pytest: speed up test_opening.py::test_funder_contribution_limits when !DEVELOPER
This test takes 695 seconds, because fundwallet waits for the wallet to notice the tx, which takes 60 seconds if not DEVELOPER. Do all the waiting at once, and this speeds the test up to 153 seconds. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -729,11 +729,12 @@ class LightningNode(object):
|
||||
r'Funding tx {} depth'.format(fundingtx['txid']))
|
||||
return {'address': addr, 'wallettxid': wallettxid, 'fundingtx': fundingtx}
|
||||
|
||||
def fundwallet(self, sats, addrtype="p2sh-segwit"):
|
||||
def fundwallet(self, sats, addrtype="p2sh-segwit", mine_block=True):
|
||||
addr = self.rpc.newaddr(addrtype)[addrtype]
|
||||
txid = self.bitcoin.rpc.sendtoaddress(addr, sats / 10**8)
|
||||
self.bitcoin.generate_block(1)
|
||||
self.daemon.wait_for_log('Owning output .* txid {} CONFIRMED'.format(txid))
|
||||
if mine_block:
|
||||
self.bitcoin.generate_block(1)
|
||||
self.daemon.wait_for_log('Owning output .* txid {} CONFIRMED'.format(txid))
|
||||
return addr, txid
|
||||
|
||||
def fundbalancedchannel(self, remote_node, total_capacity, announce=True):
|
||||
|
||||
Reference in New Issue
Block a user