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

Propigate class constraints for Query handlers from Application #257

Open
UnitylChaos opened this issue Jan 12, 2021 · 2 comments
Open

Propigate class constraints for Query handlers from Application #257

UnitylChaos opened this issue Jan 12, 2021 · 2 comments

Comments

@UnitylChaos
Copy link
Contributor

General case of #256

It would be better to enforce these constraints when the Module or Query handler is built, rather than just when makeApp is called.

Based on my very light reading, it looks like at a minimum:

  • A StoreLeaf query of type Map requires QueryData on the Key type.
  • A general Leaf query requires HasCodec on the type being returned. (perhaps this could be enforced through a constraint in the QueryResult type?)
@martyall
Copy link
Collaborator

Yes this makes sense, I can look into this. I’m out of the office/ open source works for the next week, but will accept any pr that fixes it done before then

@martyall
Copy link
Collaborator

I was thinking about this, I think we can make a smart constructor for constructing a module and not expose the constructor directly. I will try to make a PR

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

No branches or pull requests

2 participants