ApeWorX / ape-etherscan

Etherscan explorer plugin using EVM-based networks for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
26 stars 25 forks source link

fix: Bug where got assertion error and no-exception to re-raise error [APE-1341] #103

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

What I did

Fixes: APE-1341

So I am minding my own business, running tests in Ape core and all of a sudden I get random assertions errors in ape-etherscan for now reason... ok.

I really am easily peeved by assertion errors in production code. That should never happen.

So I go and look and comes to find out we are not handling the empty list case at all. So i fix it, and guess what happens? I get something even more dreadful

RuntimeError: No active exception to reraise

what.... why would there ever be an empty raise statement in production code? So i go and fix that too.

How I did it

How to verify it

Run this test in ape core:

 pytest tests/functional/test_project.py::test_track_deployment_from_unknown_contract_missing_txn_hash

Checklist

linear[bot] commented 1 year ago
APE-1341 "fix: Bug where got assertion error and no-exception to re-raise error" (ApeWorX/ape-etherscan #101)

### What I did So I am minding my own business, running tests in Ape core and all of a sudden I get random assertions errors in ape-etherscan for now reason... ok. I really am easily peeved by assertion errors in production code. That should never happen. So I go and look and comes to find out we are not handling the empty list case at all. So i fix it, and guess what happens? I get something **even more dreadful** ``` RuntimeError: No active exception to reraise ``` what.... why would there ever be an empty raise statement in production code? So i go and fix that too. ### How I did it ### How to verify it Run this test in ape core: ``` pytest tests/functional/test_project.py::test_track_deployment_from_unknown_contract_missing_txn_hash ``` ### Checklist * [ ] Passes all linting checks (pre-commit and CI jobs) * [ ] New test cases have been added and are passing * [ ] Documentation has been updated * [ ] PR title follows [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) standard (will be automatically included in the changelog) --- [ApeWorX/ape-etherscan #101](https://github.com/ApeWorX/ape-etherscan/pull/101) by [antazoey](https://github.com/antazoey) on GitHub *via LinearSync*

github-actions[bot] commented 1 year ago

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

antazoey commented 1 year ago

fixing tests now