Skip to content

Commit

Permalink
test, fundchannel: pass kwargs down to fundchannel command
Browse files Browse the repository at this point in the history
Allows us to more easily pass through args to `fundchannel` while still
using the utility function's funding + open confirmation logics
  • Loading branch information
niftynei authored and rustyrussell committed Oct 16, 2020
1 parent 4926c25 commit ee329f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ def fund_channel(self, l2, amount, wait_for_active=True, announce_channel=True):
"LightningNode.fundchannel", category=DeprecationWarning)
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
addr = self.rpc.newaddr()['bech32']

Expand All @@ -775,7 +776,9 @@ def has_funds_on_addr(addr):
wait_for(lambda: has_funds_on_addr(addr))

# 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())
self.bitcoin.generate_block(1)

Expand Down

0 comments on commit ee329f0

Please sign in to comment.