ethereum / eth-utils

Utility functions for working with ethereum related codebases.
https://eth-utils.readthedocs.io/en/latest/
MIT License
312 stars 148 forks source link

test: add currency tests with float ether input #231

Closed e3243eric closed 1 year ago

e3243eric commented 1 year ago

What was wrong?

Issue #102

How was it fixed?

Add float inputs to see that from_wei(to_wei(value, 'ether'), 'ether') == decimal.Decimal(str(value)) for float inputs. When the decimal of the value is less than 0 Wei, to_wei converts it to 0, and the test case gets AssertionError because of 0 != 0.0...01.

To-Do

Cute Animal Picture

put a cute animal picture link inside the parentheses

e3243eric commented 1 year ago

Hi @pipermerriam, can you help to review the issue? I add some float tests for the currency. Thanks!

e3243eric commented 1 year ago

Thanks for @fselmo pointing it out. I split up the test cases.

fselmo commented 1 year ago

Thanks again @e3243eric!