OpenOrg-gg / yearn-looks

GNU Affero General Public License v3.0
1 stars 1 forks source link

Fail on test_shutdown.py #2

Open OpenOrg-gg opened 2 years ago

OpenOrg-gg commented 2 years ago

In test_shutdown.py I am still failing at line 45 when it calls estimatedTotalAssets().

The test is supposed to compare that the assets deposited still equal roughly the same after the first harvest right after a deposit (when in theory no profit has been made)

However, the assets come out to more than expected. This seems to suggest I'm either:

1) instantly gaining some profit from the contract upon deposit (which could be with how they count share balances)

Or

2) that I am miscalculating the reported profit, but I do not see anything in estimatedTotalAssets() that suggests that.

Would love support in double checking this.

OpenOrg-gg commented 2 years ago

This is specifically because when running estimatedTotalAssets() we account for the interest compounded in LOOKS tokens which is automatically added to our position and not yet claimed.

When we run a harvest() one of the commands that fires on the looks contract is harvestAndCompound() which adds in that amount.

So our estimatedTotalAssets() number is currently growing each block even without a harvest. That's why these numbers differ on a shutdown test.

To have the test report accurately I've changed the test case on test_shutdown.py line 45 to read >= rather than ==