test(integration): add rebalance protocol-path tests (#46)#80
Merged
Abidoyesimze merged 2 commits intoNeurowealth:mainfrom Mar 30, 2026
Merged
Conversation
|
@Mrwicks00 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
Closes #46
Adds integration-level tests for all rebalance protocol-path transitions in the NeuroWealth Vault. These tests operate end-to-end using the existing mock/fixture pool (
MockBlendPool,TestToken) to validate real on-chain fund movement, state changes, and emitted events.Changes
contracts/vault/src/tests/test_rebalance_integration.rs— 13 integration testscontracts/vault/src/tests/mod.rs— registers the new test moduleTests Added
test_integration_rebalance_to_blend_with_pool_configuredtest_integration_rebalance_to_blend_already_in_blend_is_idempotenttest_integration_rebalance_to_blend_without_pool_panics_with_balancevault: blend pool not configuredpanictest_integration_rebalance_to_blend_without_pool_panics_zero_balancetest_integration_rebalance_from_blend_to_none_withdraws_alltest_integration_rebalance_none_to_none_is_nooptest_integration_full_protocol_round_triptest_integration_rebalance_blend_zero_vault_balance_no_panicnone(deterministic)test_integration_rebalance_unknown_protocol_is_explicit_failurevault: unsupported protocoltest_integration_rebalance_while_paused_explicit_failurevault: pausedtest_integration_asset_accounting_invariant_across_full_cycletest_integration_rebalance_event_schema_correctnessprotocol+expected_apyfieldstest_integration_blend_supply_event_fields_are_correcttest_integration_blend_withdraw_event_fields_on_protocol_switchTest Results
Acceptance Criteria
cargo test)CurrentProtocol, asset accounting, and rebalance events validated