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

Implement Typestate Builder Pattern #12

Merged
merged 21 commits into from
Dec 8, 2023

Conversation

ejorritsma
Copy link
Contributor

@ejorritsma ejorritsma commented Nov 21, 2023

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

A rewrite of the way request building works. This introduces the advantage of validation of requests at compile time.

⤵️ What is the current behavior?

Currently, requests are validated at runtime, which may lead to unexpected behavior.

🆕 What is the new behavior (if this is a feature change)?

Now, requests are validated at compile time.

💥 Does this PR introduce a breaking change?

Yes. However, since we are not running in production yet, I think we will be ok.

🐛 Recommendations for testing

Run the tests, which have been unchanged.

📝 Links to relevant issues/docs

#10

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines
  • Relevant documentation was updated
  • Rebased onto current main

@ejorritsma ejorritsma linked an issue Nov 21, 2023 that may be closed by this pull request
Copy link
Collaborator

@tluijken tluijken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work so far! I have a lot of comments, but don't worry, it's more of the same for a lot of this. I'll check in with you personally do elaborate the high level changes.

src/assets/all_assets_request.rs Outdated Show resolved Hide resolved
src/assets/all_assets_request.rs Show resolved Hide resolved
src/assets/all_assets_request.rs Show resolved Hide resolved
src/assets/all_assets_request.rs Show resolved Hide resolved
src/assets/all_assets_request.rs Show resolved Hide resolved
src/ledgers/ledgers_request.rs Show resolved Hide resolved
src/ledgers/ledgers_request.rs Show resolved Hide resolved
src/ledgers/single_ledger_request.rs Outdated Show resolved Hide resolved
src/models/mod.rs Outdated Show resolved Hide resolved
src/models/mod.rs Outdated Show resolved Hide resolved
@ejorritsma ejorritsma changed the title Perform request validation at compile time Implement Typestate Builder Pattern Nov 28, 2023
@ejorritsma ejorritsma force-pushed the 10-request-validation-at-compile-time branch from 84a4ee4 to e2a1944 Compare November 28, 2023 12:10
@tluijken tluijken force-pushed the 10-request-validation-at-compile-time branch from d73232c to ff850f3 Compare December 8, 2023 15:05
@tluijken tluijken merged commit bab47f6 into main Dec 8, 2023
1 check passed
@tluijken tluijken deleted the 10-request-validation-at-compile-time branch December 8, 2023 15:08
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.

Implement Typestate Builder Pattern
2 participants