Skip to content

Fix/152 module trait di#207

Merged
ISTIFANUS-N merged 3 commits intorinafcode:mainfrom
ritik4ever:fix/152-module-trait-di
Mar 30, 2026
Merged

Fix/152 module trait di#207
ISTIFANUS-N merged 3 commits intorinafcode:mainfrom
ritik4ever:fix/152-module-trait-di

Conversation

@ritik4ever
Copy link
Copy Markdown
Contributor

Fix tight coupling between modules via trait-based DI

Introduces src/interfaces.rs with 7 port traits (ArbitrationPort, InsurancePort, EscrowObserver, AnalyticsPort, EscrowMetricsPort, AuditPort, ProvenancePort). Each concrete type implements its trait(s). All calling modules (escrow, tokenization, performance, reporting, backup) are refactored to accept generic type parameters instead of direct imports. lib.rs wires production types via turbofish at the single call-site layer. tests/test_module_isolation.rs validates each mock port in isolation.

Closes #152

@github-actions
Copy link
Copy Markdown

⚠️ PR Title Format

Please update your PR title to follow the conventional commit format:

type(scope): description

Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert

Examples:

  • feat(contract): add learning reward distribution
  • fix(escrow): resolve timeout calculation bug
  • docs: update contributing guidelines

See CONTRIBUTING.md for details.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@ritik4ever 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

@ritik4ever
Copy link
Copy Markdown
Contributor Author

@ISTIFANUS-N please reveiw my PR

@ritik4ever
Copy link
Copy Markdown
Contributor Author

@ISTIFANUS-N please reveiw my PR

@ISTIFANUS-N ISTIFANUS-N merged commit f48c978 into rinafcode:main Mar 30, 2026
5 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tight Coupling Between Modules

2 participants