Merge branch 'abandon_stuff'

This commit is contained in:
Jack Robison 2018-01-18 13:42:59 -05:00
commit 02619259d1
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
3 changed files with 43 additions and 29 deletions

View file

@ -48,6 +48,7 @@ at anytime.
* Added a new startup stage to indicate if the daemon is waiting for the `wallet_unlock` command. * Added a new startup stage to indicate if the daemon is waiting for the `wallet_unlock` command.
* Add `--conf` CLI flag to specify an alternate config file * Add `--conf` CLI flag to specify an alternate config file
* Added `blockchain_name` and `lbryum_servers` to the adjustable settings * Added `blockchain_name` and `lbryum_servers` to the adjustable settings
* Added abandon information (claim name, id, address, amount, balance_delta and nout) about claims, supports, and updates to `transaction_list` results under `abandon_info` key
### Changed ### Changed
* claim_show API command no longer takes name as argument * claim_show API command no longer takes name as argument
@ -73,6 +74,7 @@ at anytime.
* Removed old and unused UI related code * Removed old and unused UI related code
* Removed claim information from lbry file internals * Removed claim information from lbry file internals
* Removed `auto_re_reflect` setting from the conf file, use the `reflect_uploads` setting instead * Removed `auto_re_reflect` setting from the conf file, use the `reflect_uploads` setting instead
* Removed `include_tip_info` argument from `transaction_list`, which will now always include tip information.
## [0.18.0] - 2017-11-08 ## [0.18.0] - 2017-11-08

View file

@ -992,8 +992,8 @@ class Wallet(object):
d = self._get_blockhash(height) d = self._get_blockhash(height)
return d return d
def get_history(self, include_tip_info): def get_history(self):
d = self._get_history(include_tip_info) d = self._get_history()
return d return d
def address_is_mine(self, address): def address_is_mine(self, address):
@ -1117,7 +1117,7 @@ class Wallet(object):
def _get_balance_for_address(self, address): def _get_balance_for_address(self, address):
return defer.fail(NotImplementedError()) return defer.fail(NotImplementedError())
def _get_history(self, include_tip_info): def _get_history(self):
return defer.fail(NotImplementedError()) return defer.fail(NotImplementedError())
def _address_is_mine(self, address): def _address_is_mine(self, address):
@ -1519,9 +1519,7 @@ class LBRYumWallet(Wallet):
def get_nametrie(self): def get_nametrie(self):
return self._run_cmd_as_defer_to_thread('getclaimtrie') return self._run_cmd_as_defer_to_thread('getclaimtrie')
def _get_history(self, include_tip_info): def _get_history(self):
if include_tip_info:
return self._run_cmd_as_defer_succeed('tiphistory')
return self._run_cmd_as_defer_succeed('claimhistory') return self._run_cmd_as_defer_succeed('claimhistory')
def _address_is_mine(self, address): def _address_is_mine(self, address):

View file

@ -2349,47 +2349,61 @@ class Daemon(AuthJSONRPCServer):
defer.returnValue(response) defer.returnValue(response)
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
@AuthJSONRPCServer.flags(include_tip_info='-t') def jsonrpc_transaction_list(self):
def jsonrpc_transaction_list(self, include_tip_info=False):
""" """
List transactions belonging to wallet List transactions belonging to wallet
Usage: Usage:
transaction_list [-t] transaction_list
Options:
-t : Include claim tip information
Returns: Returns:
(list) List of transactions, where is_tip is null by default, (list) List of transactions
and set to a boolean if include_tip_info is true
{ {
"claim_info": (list) claim info if in txn [{"amount": (float) claim amount, "claim_info": (list) claim info if in txn [{
"claim_id": (str) claim id, "address": (str) address of claim,
"claim_name": (str) claim name, "balance_delta": (float) bid amount,
"nout": (int) nout}], "amount": (float) claim amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"abandon_info": (list) abandon info if in txn [{
"address": (str) address of abandoned claim,
"balance_delta": (float) returned amount,
"amount": (float) claim amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"confirmations": (int) number of confirmations for the txn, "confirmations": (int) number of confirmations for the txn,
"date": (str) date and time of txn, "date": (str) date and time of txn,
"fee": (float) txn fee, "fee": (float) txn fee,
"support_info": (list) support info if in txn [{"amount": (float) support amount, "support_info": (list) support info if in txn [{
"claim_id": (str) claim id, "address": (str) address of support,
"claim_name": (str) claim name, "balance_delta": (float) support amount,
"is_tip": (null) default, "amount": (float) support amount,
(bool) if include_tip_info is true, "claim_id": (str) claim id,
"nout": (int) nout}], "claim_name": (str) claim name,
"is_tip": (bool),
"nout": (int) nout
}],
"timestamp": (int) timestamp, "timestamp": (int) timestamp,
"txid": (str) txn id, "txid": (str) txn id,
"update_info": (list) update info if in txn [{"amount": (float) updated amount, "update_info": (list) update info if in txn [{
"claim_id": (str) claim id, "address": (str) address of claim,
"claim_name": (str) claim name, "balance_delta": (float) credited/debited
"nout": (int) nout}], "amount": (float) absolute amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"value": (float) value of txn "value": (float) value of txn
} }
""" """
d = self.session.wallet.get_history(include_tip_info) d = self.session.wallet.get_history()
d.addCallback(lambda r: self._render_response(r)) d.addCallback(lambda r: self._render_response(r))
return d return d