Skip to content
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

get rid of rounding error in test_aave_withdraw #13

Open
gosuto-inzasheru opened this issue Dec 30, 2021 · 1 comment
Open

get rid of rounding error in test_aave_withdraw #13

gosuto-inzasheru opened this issue Dec 30, 2021 · 1 comment

Comments

@gosuto-inzasheru
Copy link
Member

>       assert aUSDC.balanceOf(safe) >= bal_before_ausdc - to_withdraw
E       assert 8999999999 >= (10000000000 - 1000000000)
E        +  where 8999999999 = <ContractCall 'balanceOf(address user)'>(ApeSafe("0xB65cef03b9B89f99517643226d76e286ee999e77"))
E        +    where <ContractCall 'balanceOf(address user)'> = <InitializableImmutableAdminUpgradeabilityProxy Contract '0xBcca60bB61934080951369a648Fb03DF4F96263C'>.balanceOf

tests/aave/test_aave_withdraw.py:18: AssertionError

i am suggesting assert aUSDC.balanceOf(safe) >= bal_before_ausdc - to_withdraw - 1, but am just wondering if bigger deviations than 1 could occur? eg if chain is left to sleep for longer, leaving ausdc rebase more?

@jalbrekt85
Copy link
Contributor

I assume it could be higher than 1 if amount of atokens is high enough, maybe use pytest.approx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants