Deprecated wallet_public_key and claim_renew commands

This commit is contained in:
hackrush 2018-09-26 01:51:20 +05:30 committed by Jack Robison
parent 3d36e36173
commit cda14f7c69
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 8 additions and 59 deletions

View file

@ -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

View file

@ -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> | --address=<address>)
Options:
--address=<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> | --outpoint=<outpoint>) | (<height> | --height=<height>)
Options:
--outpoint=<outpoint> : (str) outpoint of the claim to renew
--height=<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