Skip to content

refactor(test): split escrow tests into focused modules#133

Merged
mikewheeleer merged 3 commits intoLiquifact:mainfrom
oderahub:refactor/escrow-test-modules
Apr 1, 2026
Merged

refactor(test): split escrow tests into focused modules#133
mikewheeleer merged 3 commits intoLiquifact:mainfrom
oderahub:refactor/escrow-test-modules

Conversation

@oderahub
Copy link
Copy Markdown
Contributor

Summary

Refactored the escrow test suite into focused feature-based modules to
improve maintainability, reviewability, and long-term scalability without
changing contract behavior.

Closes #23

What changed

  • split the previous monolithic escrow/src/test.rs into logical modules under
    escrow/src/test/
  • kept shared helpers in the root test module to reduce duplication and keep
    setup consistent
  • folded the old standalone funding-target and token-integration tests into
    the new module structure
  • removed extra #[cfg(test)] module declarations from escrow/src/lib.rs
  • updated README.md with test organization guidance and structure notes

Test organization

Tests are now grouped by feature area:

  • init.rs — initialization, invoice-id validation, getters, and init
    baselines
  • funding.rs — funding, contribution accounting, snapshots, and tier
    selection
  • settlement.rs — settlement, withdrawal, investor claims, maturity
    boundaries, and dust sweep
  • admin.rs — admin-governed updates, legal hold, migration guards, and
    collateral metadata
  • integration.rs — token-wrapper and metadata-only integration assumptions
  • properties.rs — proptest-based invariants

Shared helpers remain in escrow/src/test.rs. Each test creates a fresh Env
and local setup so modules do not depend on hidden cross-test state.

Validation

Ran locally:

cargo fmt --all -- --check
cargo test

Result:

  • cargo fmt --all -- --check passed
  • cargo test passed
  • 88 tests passed, 0 failed

Security notes

  • no contract logic was changed
  • no execution paths or on-chain behavior were modified
  • this refactor only reorganizes tests and related documentation
  • test isolation was preserved by keeping each test self-contained with fresh
    environment setup
  • module wiring and imports were validated by running the full suite after
    the split

Why this helps

This makes the escrow suite easier to audit, extend, and review as coverage
grows, especially around security-sensitive flows like funding, settlement,
claims, admin controls, and boundary conditions.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@oderahub 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! 🚀

Learn more about application limits

@oderahub oderahub force-pushed the refactor/escrow-test-modules branch from 8b91686 to 93e136e Compare March 30, 2026 14:21
@oderahub
Copy link
Copy Markdown
Contributor Author

@mikewheeleer attention

@mikewheeleer mikewheeleer merged commit 0b3ca3f into Liquifact:main Apr 1, 2026
1 check failed
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.

Split Contract Tests into Logical Modules

2 participants