-
Notifications
You must be signed in to change notification settings - Fork 167
feat(base_types): Add Wei
type
#825
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
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.
Nice! Never knew "finney" or "szabo" existed!
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.
Really nice, few suggestions below!
Perhaps you'd prefer to make it explicit and not allow synonyms, I don't have a strong opinion 🙂 but normalizing the input unit and using match
in a helper _get_multiplier()
method makes sense to me.
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.
Another test case.
Co-authored-by: danceratopz <[email protected]>
5b2d4c9
to
5e841a0
Compare
🗒️ Description
Adds a type called
Wei
which allows string parsing different combinations of fund amount strings, such as"1 ether"
,"100 gwei"
,"10**9 wei"
, and others.Mostly meant to be used in command parameter parsing to allow more human-readable commands.
🔗 Related Issues
None
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.