#495 Add test coverage for harvest() FIXED - #683
Merged
Abidoyesimze merged 2 commits intoAug 29, 2026
Merged
Conversation
|
@onakijames-droid 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! 🚀 |
orebams
pushed a commit
to orebams/NeuroWealth-Smartcontract
that referenced
this pull request
Aug 29, 2026
…1-614 fix(a11y): keyboard ops, focus rings, aria alerts, valid markup (Neurowealth#611–Neurowealth#614)
Contributor
Author
|
@robertocarlous PLEASE REVIEW AND MERGE |
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.
CLOSED #495 Add test coverage for harvest()
Summary
Adds dedicated unit-test coverage for the agent-callable
harvest()entrypoint (Issue #465 / PR #491). There was notest_harvest.rsbefore; harvest was only exercised incidentally (budget, pause matrix, cooldown, concurrent).harvest()withdraws the fullCurrentProtocolposition and immediately re-supplies it, compounding yield in place. It is agent-gated (unlike owner-gatedemergency_harvest) and shares the rebalance cooldown window.Acceptance coverage
HarvestEventwith the correct protocol andamount_harvested.VaultError::Paused(#35).require_is_agent(empty auth and attacker signer).min_out:VaultError::MinOutMustBeNonNegative(#16).CurrentProtocol == "none":VaultError::UnsupportedProtocol(#17).VaultError::RebalanceCooldownActive(#43).Also included so the lib test crate can compile and run these tests
test_rebalance.rs(unclosed{).VaultErrorat the Soroban SDK 50-variant#[contracterror]cap by aliasing extra names (62–76) as associated constants (same pattern asInvalidWasmHash).test_concurrent_timelocks,test_reentrancy_defense,test_liquidity_mining_rewards,test_performance_fee).harvest()itself is unchanged: no new public function, no new events, no harvest error-code changes, noget_version()bump.Files
neurowealth-vault/contracts/vault/src/tests/test_harvest.rsneurowealth-vault/contracts/vault/src/tests/mod.rsneurowealth-vault/contracts/vault/src/lib.rsneurowealth-vault/contracts/vault/src/tests/test_rebalance.rsValidation
Checklist
CHANGELOG.mdunder[Unreleased]for any contract behavior, event, or error-code changes.N/A for harvest: no
harvest()behavior, event, or harvest error-code change.get_version()is not bumped.get_version(), the new version number is noted inCHANGELOG.md.N/A — version not bumped.
Versionstorage value.N/A — no release / version change.
Dedicated
test_harvest.rs(18 tests) covering ACs 1–6.EVENTS.md.N/A —
HarvestEvent/TOPIC_HARVESTalready documented.SECURITY.mdand added a corresponding test intest_pause.rs.N/A —
harvest()already exists; already listed inSECURITY.mdand covered bypause_matrix_harvest_blocked.