Browse Source

pyln: Remove deprecated txprepare variant

We promised to deprecate the old "destination satoshi feerate utxos"
variant some time on mid-2020 so let's do just that. `txprepare`
doesn't parse it either anymore.

Changelog-Changed: pyln: `txprepare` no longer supports the deprecated `destination satoshi feerate utxos` call format.
fix-mocks
Christian Decker 4 years ago
committed by Rusty Russell
parent
commit
eacc54646f
  1. 37
      contrib/pyln-client/pyln/client/lightning.py

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

@ -1172,19 +1172,7 @@ class LightningRpc(UnixDomainSocketRpc):
return self.call("withdraw", payload) return self.call("withdraw", payload)
def _deprecated_txprepare(self, destination, satoshi, feerate=None, minconf=None): def txprepare(self, outputs, feerate=None, minconf=None, utxos=None):
warnings.warn("txprepare now takes output arg: expect removal"
" in Mid-2020",
DeprecationWarning)
payload = {
"destination": destination,
"satoshi": satoshi,
"feerate": feerate,
"minconf": minconf,
}
return self.call("txprepare", payload)
def txprepare(self, *args, **kwargs):
""" """
Prepare a Bitcoin transaction which sends to [outputs]. Prepare a Bitcoin transaction which sends to [outputs].
The format of output is like [{address1: amount1}, The format of output is like [{address1: amount1},
@ -1194,22 +1182,13 @@ class LightningRpc(UnixDomainSocketRpc):
Outputs will be reserved until you call txdiscard or txsend, or Outputs will be reserved until you call txdiscard or txsend, or
lightningd restarts. lightningd restarts.
""" """
if 'destination' in kwargs or 'satoshi' in kwargs: payload = {
return self._deprecated_txprepare(*args, **kwargs) "outputs": outputs,
"feerate": feerate,
if len(args) and not isinstance(args[0], list): "minconf": minconf,
return self._deprecated_txprepare(*args, **kwargs) "utxos": utxos,
}
def _txprepare(outputs, feerate=None, minconf=None, utxos=None): return self.call("txprepare", payload)
payload = {
"outputs": outputs,
"feerate": feerate,
"minconf": minconf,
"utxos": utxos,
}
return self.call("txprepare", payload)
return _txprepare(*args, **kwargs)
def txdiscard(self, txid): def txdiscard(self, txid):
""" """

Loading…
Cancel
Save