ApeWorX / ape-etherscan

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

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

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

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

antazoey commented 1 year ago

closing in favor of upstream PR https://github.com/ApeWorX/ape-etherscan/pull/103