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

add Model trait #9

Merged
merged 12 commits into from
Jul 26, 2022
Merged

add Model trait #9

merged 12 commits into from
Jul 26, 2022

Conversation

LimpidCrypto
Copy link
Collaborator

@LimpidCrypto LimpidCrypto commented Jul 5, 2022

High Level Overview of Change

Add a Base trait that brings standard functionalities to all models. The Base trait also adds the get_errors method that checks a model for its unique errors.

Context of Change

#7
#11

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Test Plan

TODO

  • Add Model to requests
  • Add more get_errors
  • Add more docstrings to transactions
  • Fix get_nftoken_minter_error
  • Fix get_nftoken_broker_fee_error
  • Fix Transaction.has_flag()
  • Fix tests
  • Add tests
  • Add docstrings

@LimpidCrypto LimpidCrypto added the enhancement New feature or request label Jul 5, 2022
@LimpidCrypto LimpidCrypto linked an issue Jul 5, 2022 that may be closed by this pull request
@sephynox
Copy link
Owner

Rust does not really have a concept of inheritance. Maybe naming it to "Model" might be more appropriate. I see some repetition with the implementation of some of the trait's methods on structs. You can write default implementations in the trait definition and override it when necessary.

@LimpidCrypto
Copy link
Collaborator Author

Rust does not really have a concept of inheritance. Maybe naming it to "Model" might be more appropriate. I see some repetition with the implementation of some of the trait's methods on structs. You can write default implementations in the trait definition and override it when necessary.

Yes, I found that out too. They will be removed with the next commit :) "Model" is definitely a better name.

@LimpidCrypto LimpidCrypto changed the title add Base trait add Model trait Jul 14, 2022
@LimpidCrypto LimpidCrypto self-assigned this Jul 22, 2022
@LimpidCrypto LimpidCrypto merged commit be565ce into sephynox:develop Jul 26, 2022
@LimpidCrypto LimpidCrypto deleted the add_Base branch March 4, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

DEV: Models for request fields should be separated DEV: Add Model trait
2 participants