Deprecated wallet_public_key and claim_renew commands
This commit is contained in:
parent
3d36e36173
commit
cda14f7c69
2 changed files with 8 additions and 59 deletions
|
@ -145,7 +145,12 @@ def main(argv=None):
|
||||||
if method not in Daemon.deprecated_methods:
|
if method not in Daemon.deprecated_methods:
|
||||||
print('{} is not a valid command.'.format(method))
|
print('{} is not a valid command.'.format(method))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
new_method = Daemon.deprecated_methods[method].new_command
|
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))
|
print("{} is deprecated, using {}.".format(method, new_method))
|
||||||
method = new_method
|
method = new_method
|
||||||
|
|
||||||
|
|
|
@ -1009,7 +1009,7 @@ class Daemon(AuthJSONRPCServer):
|
||||||
def jsonrpc_wallet_is_address_mine(self, address):
|
def jsonrpc_wallet_is_address_mine(self, address):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@AuthJSONRPCServer.deprecated("address_public_key")
|
@AuthJSONRPCServer.deprecated()
|
||||||
def jsonrpc_wallet_public_key(self, address):
|
def jsonrpc_wallet_public_key(self, address):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1513,23 +1513,6 @@ class Daemon(AuthJSONRPCServer):
|
||||||
address, self.get_account_or_default(account_id)
|
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)
|
@requires(WALLET_COMPONENT)
|
||||||
def jsonrpc_address_list(self, account_id=None):
|
def jsonrpc_address_list(self, account_id=None):
|
||||||
"""
|
"""
|
||||||
|
@ -2438,48 +2421,9 @@ class Daemon(AuthJSONRPCServer):
|
||||||
self.analytics_manager.send_claim_action('new_support')
|
self.analytics_manager.send_claim_action('new_support')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
@AuthJSONRPCServer.deprecated()
|
||||||
@defer.inlineCallbacks
|
|
||||||
def jsonrpc_claim_renew(self, outpoint=None, height=None):
|
def jsonrpc_claim_renew(self, outpoint=None, height=None):
|
||||||
"""
|
pass
|
||||||
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
|
|
||||||
|
|
||||||
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
@requires(WALLET_COMPONENT, conditions=[WALLET_IS_UNLOCKED])
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
Loading…
Add table
Reference in a new issue