Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve validation of actions by adding more unit tests #28

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

matiasvillaverde
Copy link
Owner

  • refactor: Refactor trade validation and funding validation modules
  • refactor: Refactor transaction processing functions and validators
  • refactor: Refactor funding validator function in trust core.

- Create separate modules in `validators.rs` for `trade_validator`, `funding_validator`, and `rule_validator`
- Rename `RuleValidator` to `trade_validator`
- Update several methods to return more results
- Refactor `create_rule` function in `rule_worker.rs` to use `can_create` function from `rule_validator.rs`
- Simplify validation of existing rules in `can_create` function of `rule_validator.rs`
- Refactor transaction worker functions
- Remove trade_db from deposit and withdraw functions
- Remove TransactionCategory::FundTrade call from several functions
- Create transactions and update overviews in multiple functions
- Remove validate_trade function from transaction validator
- Remove TransactionCategory::FundTrade from match statement in validate function
- Refactor funding_validator.rs for readability and maintainability
- Remove unnecessary return statement
- Use curly braces for clearer code
- Clean up error message formatting for better readability
@matiasvillaverde matiasvillaverde merged commit 5299240 into main Jun 23, 2023
@matiasvillaverde matiasvillaverde deleted the refactor/validators branch June 23, 2023 14:32
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.

1 participant