When I wrote the output code, I made the assumption that if a transaction
was not in the transaction pool then its "output_indices" atrribute would
be present. However, upon further testing I found that for transactions
with 0 outputs, such as at height 202612, the Monero daemon returns a JSON
object with no "output_indices" attribute. This PR should keep a KeyError
from occurring.
I changed one file: `monero.backends.jsonrpc.daemon` to add one line.
This send the `"prune": True` option along with the `get_transactions` call.
The data that is pruned is not used by the `_do_get_transactions` call but
it can save up to 80% in bandwidth.
* Add `OneTimeOutput` Class
* Add `output_indices` attribute to `Transaction`
* Add `outputs` property to `Transaction`
* `do_get_transactions` now populates `output_indices` with fetched data
* Updated test cases
* Retains backwards compatibility
Future plans:
* Add `inputs` property to `Transaction` which would return list of rings
* Add `TransactionRing` or similar to `transaction.py`
This PR is extremely similar to PR #78. However, it now is based off of the backends refactor
in PR #82.
Changes:
1. Added `OneTimeOutput` class in `transaction.py`
2. Added `output_indices` attribute to `Transaction`
3. Added `outputs` property to `Transaction`
4. Changed `_do_get_transactions` code to populate `output_indices` with fetched data
5. Updated tests
Thanks for your hard work.