fix: issues #183 #185 #189 #203 + pre-existing CI failures#216
Merged
Abidoyesimze merged 2 commits intoJun 2, 2026
Conversation
…th#203 + pre-existing CI failures ## Issue Neurowealth#189 – Block upgrade while vault is paused - Add `require_not_paused()` guard to `upgrade()` so a compromised WASM cannot be pushed while the vault is in a degraded (paused) state. - New tests: `test_upgrade_blocked_while_paused`, `test_upgrade_unpaused_vault_clears_pause_guard`. ## Issue Neurowealth#185 – Validate expected_apy in rebalance - Assert `(0..=10_000).contains(&expected_apy)` before any protocol logic; rejects negative or >100 % APY values with a clear error. - New tests: `test_rebalance_apy_boundary_values_accepted`, `test_rebalance_negative_apy_rejected`, `test_rebalance_apy_above_max_rejected`. ## Issue Neurowealth#183 – TVL cap uses TotalAssets (not TotalDeposits) - `require_within_tvl_cap` now reads `TotalAssets` (principal + yield) so yield accrual does not silently allow over-subscription past the cap. - New test file `test_total_assets_cap.rs` with regression tests covering deposit → yield → withdraw → cap check lifecycle. - ARCHITECTURE.md: document TotalDeposits vs TotalAssets relationship. ## Issue Neurowealth#203 – Budget benchmark tests - New `test_budget.rs` with CPU/memory upper-bound assertions for deposit, withdraw (no-Blend), withdraw (Blend pull), rebalance→blend, rebalance→none. - ARCHITECTURE.md: document baseline ledger resource costs per operation. ## Pre-existing CI failures fixed (16 → 0) - emergency_pause tests passed agent address instead of owner → fixed to use owner throughout (test_pause, test_events, test_event_schema). - set_blend_pool tests passed agent instead of owner → fixed (test_events, test_event_schema, test_blend_integration). - test_owner_can_set_blend_pool used a bare Address (not a contract) as the Blend pool → changed to use setup_vault_with_token_and_blend. - test_event_schema_ownership_transfer_events had wrong destructuring order for setup_vault return tuple → fixed `(contract_id, _agent, owner)`. - test_math_limits: wrong expected panic messages and non-triggering overflow tests → replaced with correct expectations and functional assertions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Anuoluwapo25 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.
closes #189 – Block upgrade while vault is paused
require_not_paused()guard toupgrade()so a compromised WASM cannot be pushed while the vault is in a degraded (paused) state.test_upgrade_blocked_while_paused,test_upgrade_unpaused_vault_clears_pause_guard.closes #185 – Validate expected_apy in rebalance
(0..=10_000).contains(&expected_apy)before any protocol logic; rejects negative or >100 % APY values with a clear error.test_rebalance_apy_boundary_values_accepted,test_rebalance_negative_apy_rejected,test_rebalance_apy_above_max_rejected.closes #183 – TVL cap uses TotalAssets (not TotalDeposits)
require_within_tvl_capnow readsTotalAssets(principal + yield) so yield accrual does not silently allow over-subscription past the cap.test_total_assets_cap.rswith regression tests covering deposit → yield → withdraw → cap check lifecycle.closes #203 – Budget benchmark tests
test_budget.rswith CPU/memory upper-bound assertions for deposit, withdraw (no-Blend), withdraw (Blend pull), rebalance→blend, rebalance→none.Pre-existing CI failures fixed (16 → 0)
(contract_id, _agent, owner).