Skip to content

Add test coverage for harvest() #495

Description

@devsimze

Problem

harvest() (Issue #465, merged via PR #491) has zero test coverage — there is no test_harvest.rs and no other test file references harvest.

Scope

  • neurowealth-vault/contracts/vault/src/lib.rs (harvest)
  • New neurowealth-vault/contracts/vault/src/tests/test_harvest.rs

Acceptance criteria

  • Success path: harvest withdraws and re-supplies to CurrentProtocol, emits HarvestEvent with correct protocol/amount_harvested.
  • Rejects when vault is paused.
  • Rejects when caller is not the agent.
  • Rejects negative min_out.
  • Rejects when CurrentProtocol is none (UnsupportedProtocol).
  • Rejects when called before the rebalance cooldown elapses.

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions