Skip to content

test(integration): add deposit → withdraw unused collateral integration flow - #671

Merged
Mimah97 merged 2 commits into
Vatix-Protocol:devfrom
BarryArinze:issue-557-deposit-withdraw-integration
Jul 29, 2026
Merged

test(integration): add deposit → withdraw unused collateral integration flow#671
Mimah97 merged 2 commits into
Vatix-Protocol:devfrom
BarryArinze:issue-557-deposit-withdraw-integration

Conversation

@BarryArinze

@BarryArinze BarryArinze commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #557

This PR expands the integration test harness by covering the complete happy-path workflow for depositing collateral and subsequently withdrawing unused collateral. The new test validates that the end-to-end flow behaves correctly under normal operating conditions and protects against regressions in state transitions.

What Changed

  • Added (or extended) the integration test in tests/market_test.rs.
  • Implemented a complete deposit → withdraw_unused_collateral workflow.
  • Verified state transitions complete successfully throughout the lifecycle.
  • Added optional assertions for fee handling where applicable.
  • Integrated the test with the existing CI suite.

Why

While individual contract functions are already tested, integration tests provide confidence that multiple operations work together correctly. This scenario represents a common user workflow and should remain protected by regression tests.

The new test ensures:

  • Deposits are processed successfully.
  • Unused collateral can be withdrawn afterward.
  • Contract state remains consistent across operations.
  • Future changes cannot unintentionally break the end-to-end flow.

Testing

  • ✅ Added integration coverage for deposit followed by withdraw_unused_collateral.
  • ✅ Verified the happy path executes successfully.
  • ✅ Added optional fee assertions where supported.
  • ✅ Confirmed compatibility with the existing CI pipeline.

Acceptance Criteria

  • Happy-path integration test added.
  • Deposit and withdrawal execute successfully.
  • Fee assertions included where applicable.
  • CI passes successfully.
  • No unrelated contract behavior modified.

@Mimah97
Mimah97 merged commit dea7a8b into Vatix-Protocol:dev Jul 29, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration harness: deposit then withdraw unused

2 participants