This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 363
fix: check that calculated gas price is a number #3441
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLA Assistant Lite All Contributors have signed the CLA. |
katspaugh
approved these changes
Feb 7, 2022
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.
👍
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Pull Request Test Coverage Report for Build 1805525864
💛 - Coveralls |
usame-algan
approved these changes
Feb 7, 2022
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.
Well done!
E2E Tests Failed Failed tests:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it solves
Resolves down oracles
How this PR fixes it
Gas price oracles that are down, namely Rinkeby (atm), do not throw when there is an issue but return a string. This was not breaking out of the oracle estimation loop we use.
The fetced gas price is first checked (
!isNaN()
), throwing if so, before returning it.How to test it
This is very hard to test because manually switching to another oracle in Django will likely throw. You would likely have to mock the response of an oracle, returning a string (that is not a number).
This is the error returned:
Hopefully this PR is reviewed whilst there is an Etherscan issue.