Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Raise ValueError for non-existant tx hashes #1442

Merged
merged 1 commit into from Feb 5, 2021

Conversation

achow101
Copy link
Contributor

@achow101 achow101 commented Feb 2, 2021

If the device asks for a tx_hash which is not present in prev_txes,
raise a ValueError with some more detailed messaging about the missing
hash rather than the default dictionary lookup failure of KeyError.

@matejcik
Copy link
Contributor

matejcik commented Feb 2, 2021

making the message more descriptive is definitely reasonable. I'm wondering, though, why you think ValueError is more appropriate than KeyError?

@achow101
Copy link
Contributor Author

achow101 commented Feb 2, 2021

ValueError seemed appropriate because prev_txs has the inappropriate value by missing the entry for a txid.

@matejcik
Copy link
Contributor

matejcik commented Feb 4, 2021

🤷‍♀️ ok

please add a changelog entry though

If the device asks for a tx_hash which is not present in prev_txes,
raise a ValueError with some more detailed messaging about the missing
hash rather than the default dictionary lookup failure of KeyError.
@achow101
Copy link
Contributor Author

achow101 commented Feb 4, 2021

please add a changelog entry though

Done

@matejcik matejcik changed the base branch from master to hwi-compat February 5, 2021 09:47
@matejcik matejcik merged commit 1f85cb4 into trezor:hwi-compat Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants