Skip to content

Conversation

@Potolski
Copy link
Contributor

@Potolski Potolski commented Sep 9, 2024

Fix: Partial Collateral Removal Issue & Add New Test Scenarios

Issue

The existing implementation had a flaw where if a user removed only a portion of their collateral, they would stop earning rewards on the entirety of their remaining staked capital. This was causing an unintended halt in reward accrual for users who didn't fully withdraw their staked collateral.

Solution

  • Fixed the logic to ensure users continue earning rewards on their remaining collateral after partially withdrawing their staked funds.

Additional Changes

  • Added 2 new test scenarios to validate the correct behavior:
    1. Partial collateral removal: Ensure users still earn rewards on the remaining staked collateral after removing a portion of it.
    2. Full collateral removal: Verify the correct behavior when a user removes all of their staked collateral.

@Potolski Potolski requested a review from claudiovb October 3, 2024 13:02
@Potolski Potolski changed the title WIP updates _updateReward logic to account withdraw requests updates _updateReward logic to account withdraw requests Oct 3, 2024
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

Successfully merging this pull request may close these issues.

3 participants