test: capacity-boundary and rebalance coverage for allocation_logic#499
Open
Whiznificent wants to merge 3 commits into
Open
test: capacity-boundary and rebalance coverage for allocation_logic#499Whiznificent wants to merge 3 commits into
Whiznificent wants to merge 3 commits into
Conversation
- Add test_allocate_exactly_at_max_capacity_accepted: exact boundary accepted - Add test_allocate_one_over_max_capacity_rejected: +1 stroop fails (Commitlabs-Org#7) - Add test_rebalance_across_pools_respects_capacity: rebalance stays within caps - Add test_update_pool_capacity_below_total_liquidity_rejected: cap < liquidity fails - Add test_rebalance_total_liquidity_no_underflow: liquidity never goes negative - Document boundary matrix in docs/ALLOCATION_LOGIC_POOL_REGISTRY_AND_RISK_LEVELS.md Closes Commitlabs-Org#480
- Add missing 'use crate::error::{category, Error}' imports to lib.rs tests module
- Add CommitmentMetadata and CommitmentNFT to types.rs to match commitment_nft
- Fix get_owner_commitments signature to include offset/limit params (matches live core)
- Update live-core signature check to match paginated get_owner_commitments
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
Closes #480
Adds exhaustive capacity-boundary and rebalance tests to
contracts/allocation_logic/src/tests.rsand documents the boundary matrix indocs/ALLOCATION_LOGIC_POOL_REGISTRY_AND_RISK_LEVELS.md.Tests Added
test_allocate_exactly_at_max_capacity_acceptedmax_capacityboundary is acceptedtest_allocate_one_over_max_capacity_rejectedPoolCapacityExceeded(#7)test_rebalance_across_pools_respects_capacitytest_update_pool_capacity_below_total_liquidity_rejectedtotal_liquidityfails withPoolCapacityExceeded(#7)test_rebalance_total_liquidity_no_underflowtotal_liquiditynever goes below zero after rebalanceDocs Updated
docs/ALLOCATION_LOGIC_POOL_REGISTRY_AND_RISK_LEVELS.md: added Capacity Boundary Test Matrix table.