Skip to content

Commit fad4aee

Browse files
committed
pyln: remove deprecated fundchannel/fundchannel_start variants.
Signed-off-by: Rusty Russell <[email protected]> Changelog-Removed: pyln: removed deprecated fundchannel/fundchannel_start `satoshi` arg.
1 parent 0ed614d commit fad4aee

File tree

1 file changed

+16
-58
lines changed

1 file changed

+16
-58
lines changed

contrib/pyln-client/pyln/client/lightning.py

Lines changed: 16 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -692,22 +692,7 @@ def feerates(self, style, urgent=None, normal=None, slow=None):
692692
}
693693
return self.call("feerates", payload)
694694

695-
def _deprecated_fundchannel(self, node_id, satoshi, feerate=None, announce=True, minconf=None, utxos=None):
696-
warnings.warn("fundchannel: the 'satoshi' field is renamed 'amount' : expect removal"
697-
" in Mid-2020",
698-
DeprecationWarning)
699-
700-
payload = {
701-
"id": node_id,
702-
"satoshi": satoshi,
703-
"feerate": feerate,
704-
"announce": announce,
705-
"minconf": minconf,
706-
"utxos": utxos
707-
}
708-
return self.call("fundchannel", payload)
709-
710-
def fundchannel(self, node_id, *args, **kwargs):
695+
def fundchannel(self, node_id, amount, feerate=None, announce=True, minconf=None, utxos=None, push_msat=None, close_to=None):
711696
"""
712697
Fund channel with {id} using {amount} satoshis with feerate
713698
of {feerate} (uses default feerate if unset).
@@ -717,39 +702,19 @@ def fundchannel(self, node_id, *args, **kwargs):
717702
fund a channel from these specifics utxos.
718703
{close_to} is a valid Bitcoin address.
719704
"""
720-
721-
if 'satoshi' in kwargs:
722-
return self._deprecated_fundchannel(node_id, *args, **kwargs)
723-
724-
def _fundchannel(node_id, amount, feerate=None, announce=True, minconf=None, utxos=None, push_msat=None, close_to=None):
725-
payload = {
726-
"id": node_id,
727-
"amount": amount,
728-
"feerate": feerate,
729-
"announce": announce,
730-
"minconf": minconf,
731-
"utxos": utxos,
732-
"push_msat": push_msat,
733-
"close_to": close_to,
734-
}
735-
return self.call("fundchannel", payload)
736-
737-
return _fundchannel(node_id, *args, **kwargs)
738-
739-
def _deprecated_fundchannel_start(self, node_id, satoshi, feerate=None, announce=True):
740-
warnings.warn("fundchannel_start: the 'satoshi' field is renamed 'amount' : expect removal"
741-
" in Mid-2020",
742-
DeprecationWarning)
743-
744705
payload = {
745706
"id": node_id,
746-
"satoshi": satoshi,
707+
"amount": amount,
747708
"feerate": feerate,
748709
"announce": announce,
710+
"minconf": minconf,
711+
"utxos": utxos,
712+
"push_msat": push_msat,
713+
"close_to": close_to,
749714
}
750-
return self.call("fundchannel_start", payload)
715+
return self.call("fundchannel", payload)
751716

752-
def fundchannel_start(self, node_id, *args, **kwargs):
717+
def fundchannel_start(self, node_id, amount, feerate=None, announce=True, close_to=None):
753718
"""
754719
Start channel funding with {id} for {amount} satoshis
755720
with feerate of {feerate} (uses default feerate if unset).
@@ -759,21 +724,14 @@ def fundchannel_start(self, node_id, *args, **kwargs):
759724
'fundchannel_complete' to complete channel establishment
760725
with peer.
761726
"""
762-
763-
if 'satoshi' in kwargs:
764-
return self._deprecated_fundchannel_start(node_id, *args, **kwargs)
765-
766-
def _fundchannel_start(node_id, amount, feerate=None, announce=True, close_to=None):
767-
payload = {
768-
"id": node_id,
769-
"amount": amount,
770-
"feerate": feerate,
771-
"announce": announce,
772-
"close_to": close_to,
773-
}
774-
return self.call("fundchannel_start", payload)
775-
776-
return _fundchannel_start(node_id, *args, **kwargs)
727+
payload = {
728+
"id": node_id,
729+
"amount": amount,
730+
"feerate": feerate,
731+
"announce": announce,
732+
"close_to": close_to,
733+
}
734+
return self.call("fundchannel_start", payload)
777735

778736
def fundchannel_cancel(self, node_id):
779737
"""

0 commit comments

Comments
 (0)