From cda14f7c692708c75e757c73867fc1c79cbe765f Mon Sep 17 00:00:00 2001 From: hackrush Date: Wed, 26 Sep 2018 01:51:20 +0530 Subject: [PATCH 1/3] Deprecated wallet_public_key and claim_renew commands --- lbrynet/cli.py | 5 ++++ lbrynet/daemon/Daemon.py | 62 ++-------------------------------------- 2 files changed, 8 insertions(+), 59 deletions(-) diff --git a/lbrynet/cli.py b/lbrynet/cli.py index 9eccd21ab..ea712d992 100644 --- a/lbrynet/cli.py +++ b/lbrynet/cli.py @@ -145,7 +145,12 @@ def main(argv=None): if method not in Daemon.deprecated_methods: print('{} is not a valid command.'.format(method)) return 1 + new_method = Daemon.deprecated_methods[method].new_command + if new_method is None: + print("{} is permanently deprecated and will be removed in a future release.".format(method)) + return 0 + print("{} is deprecated, using {}.".format(method, new_method)) method = new_method diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 6e9974666..93d19e763 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1009,7 +1009,7 @@ class Daemon(AuthJSONRPCServer): def jsonrpc_wallet_is_address_mine(self, address): pass - @AuthJSONRPCServer.deprecated("address_public_key") + @AuthJSONRPCServer.deprecated() def jsonrpc_wallet_public_key(self, address): pass @@ -1513,23 +1513,6 @@ class Daemon(AuthJSONRPCServer): address, self.get_account_or_default(account_id) ) - @requires(WALLET_COMPONENT) - def jsonrpc_address_public_key(self, address): - """ - Get public key from wallet address - - Usage: - wallet_public_key (
| --address=
) - - Options: - --address=
: (str) address for which to get the public key - - Returns: - (list) list of public keys associated with address. - Could contain more than one public key if multisig. - """ - return self.wallet_manager.get_pub_keys(address) - @requires(WALLET_COMPONENT) def jsonrpc_address_list(self, account_id=None): """ @@ -2438,48 +2421,9 @@ class Daemon(AuthJSONRPCServer): self.analytics_manager.send_claim_action('new_support') return result - @requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED]) - @defer.inlineCallbacks + @AuthJSONRPCServer.deprecated() def jsonrpc_claim_renew(self, outpoint=None, height=None): - """ - Renew claim(s) or support(s) - - Usage: - claim_renew ( | --outpoint=) | ( | --height=) - - Options: - --outpoint= : (str) outpoint of the claim to renew - --height= : (str) update claims expiring before or at this block height - - Returns: - (dict) Dictionary where key is the the original claim's outpoint and - value is the result of the renewal - { - outpoint:{ - - 'tx' : (str) hex encoded transaction - 'txid' : (str) txid of resulting claim - 'nout' : (int) nout of the resulting claim - 'fee' : (float) fee paid for the claim transaction - 'claim_id' : (str) claim ID of the resulting claim - }, - } - """ - - if outpoint is None and height is None: - raise Exception("must provide an outpoint or a height") - elif outpoint is not None: - if len(outpoint.split(":")) == 2: - txid, nout = outpoint.split(":") - nout = int(nout) - else: - raise Exception("invalid outpoint") - result = yield self.wallet_manager.claim_renew(txid, nout) - result = {outpoint: result} - else: - height = int(height) - result = yield self.wallet_manager.claim_renew_all_before_expiration(height) - return result + pass @requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED]) @defer.inlineCallbacks From 655ece18deffca294477b11ce9897a67320588ab Mon Sep 17 00:00:00 2001 From: hackrush Date: Wed, 26 Sep 2018 18:30:07 +0530 Subject: [PATCH 2/3] Changelog update --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c444e3b5..292df378e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,9 +24,10 @@ implementation are the major changes in this release. * deprecated `wallet_prefill_addresses` command, use `account_fund` instead. * deprecated `wallet_list` command, use `address_list` instead. * deprecated `wallet_is_address_mine` command, use `address_is_mine` instead. - * deprecated `wallet_public_key` command, use `address_public_key` instead. + * deprecated `wallet_public_key` command. * deprecated `wallet_new_address` command, use `address_generate` instead. * deprecated `wallet_unused_address` command, use `address_unused` instead. + * deprecated `claim_renew` command. * added `account_list` command to list accounts including their balance. * added `account_add` command to add a previously created account from seed or private key. * added `account_create` command to generate a new account. From 3d72b2adf30fe2a371e5ccdc3e2c457fa68c4a5d Mon Sep 17 00:00:00 2001 From: hackrush Date: Wed, 26 Sep 2018 19:23:23 +0530 Subject: [PATCH 3/3] Review Fixes --- lbrynet/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/cli.py b/lbrynet/cli.py index ea712d992..60c85acf3 100644 --- a/lbrynet/cli.py +++ b/lbrynet/cli.py @@ -148,7 +148,7 @@ def main(argv=None): new_method = Daemon.deprecated_methods[method].new_command if new_method is None: - print("{} is permanently deprecated and will be removed in a future release.".format(method)) + print("{} is permanently deprecated and does not have a replacement command.".format(method)) return 0 print("{} is deprecated, using {}.".format(method, new_method))