Closed jeffro256 closed 3 years ago
The question is: should the output_indices
attribute of Transaction
be None
to reflect the JSON, or []
to make more sense for the user, in the case that a transaction is in the blockchain but has no output indices? If we wanted to do the latter, I could push one more commit to add that change.
I'm merging this but having a unit test with the example transaction you mentioned would be wonderful. How about that? :)
I am experiencing errors with the block 202612, probably the same fix should be applied here https://github.com/monero-ecosystem/monero-python/blob/d24044a5e713fcda24e9d681515a4140bbe33d4a/monero/backends/jsonrpc/daemon.py#L1601
@OOtta Could you check with the latest master
, please?
@emesik works good now, thanks.
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.