feat: Add market liquidity filter with minimum pool size threshold#220
Merged
ISTIFANUS-N merged 1 commit intorinafcode:mainfrom Apr 1, 2026
Merged
Conversation
…ects and builder pattern Issue rinafcode#151: Code Quality & Maintainability Changes: - Escrow: Refactored create_escrow() to use EscrowParameters struct instead of 10 individual parameters - Social Learning: Created CreateStudyGroupParams struct with builder pattern for create_study_group() (was 9 params) - Social Learning: Created CreatePeerReviewParams struct for create_review() (was 8 params) - Validation: Added validate_escrow_parameters() and parameter combination validation - Errors: Added new error types for parameter validation (InvalidBeneficiary, InvalidToken, etc.) Benefits: - Improved function signatures readability - Reduced parameter coupling - Automatic validation of related parameters - Builder pattern enables flexible object construction - Better maintainability and testability
|
@kryputh 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! 🚀 |
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.
Closes #151
Implements issue #151: Refactor functions with 8+ parameters to improve code quality and maintainability.
Changes
create_escrow()from 10 parameters to useEscrowParametersstructCreateStudyGroupParamsstruct with builder pattern (was 9 params)CreatePeerReviewParamsstruct (was 8 params)validate_escrow_parameters()with parameter combination validationBenefits
✓ Cleaner, more readable function signatures
✓ Related parameters grouped logically
✓ Automatic validation of parameter combinations
✓ Builder pattern for flexible object construction
✓ Easier to test and maintain
✓ Reduced cognitive load for developers using these functions
Files Changed
contracts/teachlink/src/escrow.rs- Use EscrowParameters instead of 10 individual paramscontracts/teachlink/src/social_learning.rs- New parameter objects with builder patterncontracts/teachlink/src/validation.rs- New validation functions for parameter structscontracts/teachlink/src/errors.rs- New error types for validationAcceptance Criteria Met
✓ Refactored functions with too many parameters
✓ Used parameter objects and structs for related parameters
✓ Implemented builder pattern for complex function calls
✓ Added validation for parameter combinations
✓ Simplified function interfaces where possible