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

What are these tests for ? #139

Open
ICONationDevTeam opened this issue May 31, 2021 · 0 comments
Open

What are these tests for ? #139

ICONationDevTeam opened this issue May 31, 2021 · 0 comments

Comments

@ICONationDevTeam
Copy link

for i in (sending, receiving):
if wrapped_coins[i] == ETH_ADDRESS:
admin_fee = swap.balance() - swap.balances(i)
assert admin_fee + swap.balances(i) == swap.balance()
else:
admin_fee = wrapped_coins[i].balanceOf(swap) - swap.balances(i)
assert admin_fee + swap.balances(i) == wrapped_coins[i].balanceOf(swap)
assert admin_fee > 0

In simpler terms :

admin_fee = A - B

and the test is :

admin_fee + B == A

Whatever swap.balance() and swap.balances(i) returns, the result will always be true.

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

1 participant