mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
test, fundchannel: pass kwargs down to fundchannel command
Allows us to more easily pass through args to `fundchannel` while still using the utility function's funding + open confirmation logics
This commit is contained in:
@@ -754,7 +754,8 @@ class LightningNode(object):
|
|||||||
"LightningNode.fundchannel", category=DeprecationWarning)
|
"LightningNode.fundchannel", category=DeprecationWarning)
|
||||||
return self.fundchannel(l2, amount, wait_for_active, announce_channel)
|
return self.fundchannel(l2, amount, wait_for_active, announce_channel)
|
||||||
|
|
||||||
def fundchannel(self, l2, amount, wait_for_active=True, announce_channel=True):
|
def fundchannel(self, l2, amount, wait_for_active=True,
|
||||||
|
announce_channel=True, **kwargs):
|
||||||
# Give yourself some funds to work with
|
# Give yourself some funds to work with
|
||||||
addr = self.rpc.newaddr()['bech32']
|
addr = self.rpc.newaddr()['bech32']
|
||||||
|
|
||||||
@@ -775,7 +776,9 @@ class LightningNode(object):
|
|||||||
wait_for(lambda: has_funds_on_addr(addr))
|
wait_for(lambda: has_funds_on_addr(addr))
|
||||||
|
|
||||||
# Now go ahead and open a channel
|
# Now go ahead and open a channel
|
||||||
res = self.rpc.fundchannel(l2.info['id'], amount, announce=announce_channel)
|
res = self.rpc.fundchannel(l2.info['id'], amount,
|
||||||
|
announce=announce_channel,
|
||||||
|
**kwargs)
|
||||||
wait_for(lambda: res['txid'] in self.bitcoin.rpc.getrawmempool())
|
wait_for(lambda: res['txid'] in self.bitcoin.rpc.getrawmempool())
|
||||||
self.bitcoin.generate_block(1)
|
self.bitcoin.generate_block(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user