From 7472d12644ca2b9371856f28991d3ccb2cb1950b Mon Sep 17 00:00:00 2001 From: hackrush Date: Fri, 12 Jan 2018 01:11:35 +0530 Subject: [PATCH 1/2] Removed `include_tip_info` from `transaction_list`, goes with lbryum#183 --- CHANGELOG.md | 2 ++ lbrynet/core/Wallet.py | 10 +++---- lbrynet/daemon/Daemon.py | 61 +++++++++++++++++++++++++--------------- 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c31db5d..e5a5591a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ at anytime. * 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 * 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/updates to `transaction_list` command, under `abandon_info` key ### Changed * claim_show API command no longer takes name as argument @@ -73,6 +74,7 @@ at anytime. * Removed old and unused UI related code * Removed claim information from lbry file internals * 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 diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 0755ba718..bfb8e7f9a 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -992,8 +992,8 @@ class Wallet(object): d = self._get_blockhash(height) return d - def get_history(self, include_tip_info): - d = self._get_history(include_tip_info) + def get_history(self): + d = self._get_history() return d def address_is_mine(self, address): @@ -1117,7 +1117,7 @@ class Wallet(object): def _get_balance_for_address(self, address): return defer.fail(NotImplementedError()) - def _get_history(self, include_tip_info): + def _get_history(self): return defer.fail(NotImplementedError()) def _address_is_mine(self, address): @@ -1519,9 +1519,7 @@ class LBRYumWallet(Wallet): def get_nametrie(self): return self._run_cmd_as_defer_to_thread('getclaimtrie') - def _get_history(self, include_tip_info): - if include_tip_info: - return self._run_cmd_as_defer_succeed('tiphistory') + def _get_history(self): return self._run_cmd_as_defer_succeed('claimhistory') def _address_is_mine(self, address): diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index ef3fa834d..01dd939cd 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -2349,47 +2349,62 @@ class Daemon(AuthJSONRPCServer): defer.returnValue(response) @AuthJSONRPCServer.auth_required - @AuthJSONRPCServer.flags(include_tip_info='-t') - def jsonrpc_transaction_list(self, include_tip_info=False): + def jsonrpc_transaction_list(self): """ List transactions belonging to wallet Usage: - transaction_list [-t] - - Options: - -t : Include claim tip information + transaction_list Returns: - (list) List of transactions, where is_tip is null by default, - and set to a boolean if include_tip_info is true + (list) List of transactions(balance_delta field returns the amount debited/credited from + your wallet) { - "claim_info": (list) claim info if in txn [{"amount": (float) claim amount, - "claim_id": (str) claim id, - "claim_name": (str) claim name, - "nout": (int) nout}], + "claim_info": (list) claim info if in txn [{ + "address": (str) address of claim, + "balance_delta": (float) bid amount, + "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, "date": (str) date and time of txn, "fee": (float) txn fee, - "support_info": (list) support info if in txn [{"amount": (float) support amount, - "claim_id": (str) claim id, - "claim_name": (str) claim name, - "is_tip": (null) default, - (bool) if include_tip_info is true, - "nout": (int) nout}], + "support_info": (list) support info if in txn [{ + "address": (str) address of support, + "balance_delta": (float) support amount, + "amount": (float) support amount, + "claim_id": (str) claim id, + "claim_name": (str) claim name, + "is_tip": (bool), + "nout": (int) nout + }], "timestamp": (int) timestamp, "txid": (str) txn id, - "update_info": (list) update info if in txn [{"amount": (float) updated amount, - "claim_id": (str) claim id, - "claim_name": (str) claim name, - "nout": (int) nout}], + "update_info": (list) update info if in txn [{ + "address": (str) address of claim, + "balance_delta": (float) difference amount, + "amount": (float) absolute amount, + "claim_id": (str) claim id, + "claim_name": (str) claim name, + "nout": (int) nout + }], "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)) return d From edb0f8deed051f4394b4d55a466132310546efa7 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 18 Jan 2018 13:41:17 -0500 Subject: [PATCH 2/2] changelog and doc --- CHANGELOG.md | 4 ++-- lbrynet/daemon/Daemon.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a5591a9..afbe78a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ at anytime. * 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 * 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/updates to `transaction_list` command, under `abandon_info` key + * 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 * claim_show API command no longer takes name as argument @@ -74,7 +74,7 @@ at anytime. * Removed old and unused UI related code * Removed claim information from lbry file internals * 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. + * Removed `include_tip_info` argument from `transaction_list`, which will now always include tip information. ## [0.18.0] - 2017-11-08 diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 01dd939cd..7039c6c8f 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -2357,8 +2357,7 @@ class Daemon(AuthJSONRPCServer): transaction_list Returns: - (list) List of transactions(balance_delta field returns the amount debited/credited from - your wallet) + (list) List of transactions { "claim_info": (list) claim info if in txn [{ @@ -2393,7 +2392,7 @@ class Daemon(AuthJSONRPCServer): "txid": (str) txn id, "update_info": (list) update info if in txn [{ "address": (str) address of claim, - "balance_delta": (float) difference amount, + "balance_delta": (float) credited/debited "amount": (float) absolute amount, "claim_id": (str) claim id, "claim_name": (str) claim name,