-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(earn): Compute total deposit amount correctly for EarnPoolInfoScr…
…een (#6104) ### Description `totalDepositBalanceInCrypto` was being computed incorrectly if there were earningsItems where `includedInPoolBalance` is true and they are in a different token than the deposit token. Fixed this and added a test, also compute `totalDepositBalanceInLocalCurrency` using `totalDepositBalanceInCrypto` rather than doing another filter/reduce. ### Test plan Updated unit tests and added new ones to prevent same bug in the future ### Related issues - N/A ### Backwards compatibility Current pools don't have any earningItems where `includedInPoolBalance` is true so no issue, there will be a bug for older versions for Beefy pools though if we separate out compound interest (will show incorrect value). ### Network scalability If a new NetworkId and/or Network are added in the future, the changes in this PR will: - [X] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
- Loading branch information
1 parent
341e0f8
commit 2a6433e
Showing
2 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters