-
Notifications
You must be signed in to change notification settings - Fork 1
Update: update etherscan url to v2 from v1 #18
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
Conversation
src/ethproto/wrappers.py
Outdated
| ETHERSCAN_TOKEN = env.str("ETHERSCAN_TOKEN", None) | ||
| ETHERSCAN_DOMAIN = env.str("ETHERSCAN_DOMAIN", "api.etherscan.io") | ||
| ETHERSCAN_URL = env.str("ETHERSCAN_URL", "https://{domain}/api?apikey={token}&") | ||
| ETHERSCAN_URL = env.str("ETHERSCAN_URL", "https://{domain}/v2/api?apikey={token}&") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acá ya tendría que incluir el chainId también. Que get_etherscan_url lo complete.
tests/test_w3.py
Outdated
| mocker.patch.dict( | ||
| os.environ, | ||
| { | ||
| "ETHERSCAN_URL": "https://{domain}/v2/api?apikey={token}&", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mejor no sobreescribir la URL para el test, podría enmascarar errores (o cambios que rompen compatibilidad en el futuro)
tox.ini
Outdated
| testing | ||
| deps = | ||
| warrant @ git+https://github.com/gnarvaja/warrant.git#egg=warrant | ||
| requests-mock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Por qué esta dependencia que no usamos en ningún lado? Usemos responses. Además la dependencia habría que ponerla en setup.cfg, en la sección de testing.
Si no podés usar cassete (pytest-recording) que ya está incluida, pero capaz para este caso es mejor responses.
…et url to use chainid
src/ethproto/wrappers.py
Outdated
| if ETHERSCAN_TOKEN is None: | ||
| return None | ||
| return ETHERSCAN_URL.format(token=ETHERSCAN_TOKEN, domain=ETHERSCAN_DOMAIN) | ||
| return ETHERSCAN_URL.format(token=ETHERSCAN_TOKEN, domain=ETHERSCAN_DOMAIN, chainid=ETHERSCAN_CHAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para mi estaba bien como lo hacia antes, que lo tomaba de self.w3.chain_id
No description provided.