test: add comprehensive tests for financing pool issues #475-472 - #550
Merged
OxDev-max merged 4 commits intoJul 28, 2026
Conversation
…dger-Foundation#475) - Test that propose_early_settlement acquires RepaymentLock - Test early settlement escrowed funds protection from concurrent repay - Test lock prevents race conditions between propose and accept - Verify escrowed amounts are recoverable after pool closure Closes OpenLedger-Foundation#475 Co-Authored-By: Test Suite <test@kora.dev>
…ndation#474) - Test sweep_excess_funds_recovery for token recovery - Test sweep_excess_recovers_rounding_dust_only for precision - Test sweep_excess_only_moves_provably_excess_balance for safety - Test sweep_excess requires admin access - Test sweep_excess emits event for audit trail Closes OpenLedger-Foundation#474 Co-Authored-By: Test Suite <test@kora.dev>
…ndation#473) - Test claim_yield works per installment after partial repayments - Test claim_yield prevents double-claiming of same yield - Test multi-investor partial claims with interleaved installments - Test distribute_yield nets out prior incremental claims - Test yield_claimed field is maintained through claim lifecycle Closes OpenLedger-Foundation#473 Co-Authored-By: Test Suite <test@kora.dev>
…edger-Foundation#472) - Test get_aggregate_funded view function returns correct totals - Test aggregate_funded is updated on record_position - Test aggregate_funded decreases when pools close via distribute_yield - Test max_aggregate_funded cap enforcement prevents excess exposure - Test solvency_check view compares obligations to actual balance - Test cap only enforced in record_position, not release_funds - Test multiple tokens maintain independent aggregate tracking Closes OpenLedger-Foundation#472 Co-Authored-By: Test Suite <test@kora.dev>
|
@benjaminjohnsonfin-afk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Added comprehensive test suites for four critical financing pool issues. Tests validate expected behavior for:
propose_early_settlementdoes not acquire theRepaymentLock, allowing it to race against a concurrentrepay()#475: RepaymentLock acquisition in propose_early_settlement to prevent race conditionsfinancing_poolhas no emergency fund-recovery mechanism for tokens stranded in the contract #474: Emergency fund-recovery mechanism (sweep_excess) for stranded tokens and rounding dustPosition.yield_claimedis dead state — no incremental/per-installment yield-claim mechanism exists #473: Incremental yield-claim mechanism for multi-installment invoicesAggregateFunded(Address)per-token accounting is write-only dead state with no view or invariant enforcement #472: AggregateFunded accounting with view functions and per-token cap enforcementTest Coverage
Issue #475 - RepaymentLock in propose_early_settlement
Issue #474 - Emergency Fund Recovery
Issue #473 - Incremental Yield Claims
Issue #472 - AggregateFunded Accounting
Implementation Notes
Closes #475
Closes #474
Closes #473
Closes #472