pysha3 is pretty old and doesn't seem to have any modern Python
wheels, so it requires being compiled on Python 3.7 or newer.
Cryptodome is more modern and maintained, though larger.
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.
If you called daemon.block(height=0) then the expression:
if not height and not bhash:
Is `True` because 0 is falsey. I changed that line to a slightly more wordy, but more accurate:
if height is None and bhash is None:
Tweaks to Commands:
1. Now catches and raises a more descriptive error when the node returns malformed JSON or JSON with non-unicode characters in it.
2. Removed get_txpool_backlog and get_output_distribution because they are actually binary RPC commands in disguise, maybe they can be added later.
3. Improved input validation for start_mining.
4. Catches NOT MINING status in set_log_hash_rate and raises descriptive error.
5. Adds abaility in out_peers and in_peers to set unlimited peers by passing -1 as arg.
6. Make input more intuitive in get_outs.
7. Shortened names of get_all_known_log_levels and get_all_known_log_categories.
8. Other very minor tweaks.
Changes:
1. Added test cases for the JSON_RPC methods (not the old RPC methods)
2. Tweaked a couple of the methods to make input and output more intuitive