You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
accrueAccount test suite — added a dedicated set of tests covering the accrueAccount function, verifying correct behavior across various collateralization states.
accrueAccount idempotency within the same block
Calling accrueAccount twice in the same block should be a pure no-op (timeElapsed = 0). Not tested.
accrueAccount on one user after global state was advanced by another user's action
Pattern: bob's supply/withdraw triggers accrueInternal (global), updating lastAccrualTime. Then accrueAccount(alice) is called. Alice's baseTrackingAccrued should update based on the delta between totals.trackingSupplyIndex and alice.baseTrackingIndex. No test isolates this sequence explicitly.
balanceOf / borrowBalanceOf increasing over time
The test verifies userBasic.principal is unchanged after accrue (correct — principal is fixed). But there is no test confirming that balanceOf(alice) (which calls presentValueSupply(baseSupplyIndex, principal)) actually returns a larger value after the index grows, i.e., that supplier earned interest is reflected in their balance.
lastAccrualTime after accrueAccount vs. state-changing operations
accrueInternal updates lastAccrualTime. The test checks lastAccrualTime after supply (line 264-268) but never after a standalone accrueAccount. There's no explicit assertion that lastAccrualTime = block.timestamp after accrueAccount.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accrue Tests
accrueAccounttest suite — added a dedicated set of tests covering theaccrueAccountfunction, verifying correct behavior across various collateralization states.