-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Proposal: Simplification of AppModule interface. #6232
Comments
What is Querier routing will already change based on ADR 021/gRPC #5894. |
I changed this other interfaces: From:
To:
I don't know if this will help or not with the gRPC. Is just an idea to simplify to AppModule. Do you think it can help @aaronc ? |
Okay makes sense now. I've always wondered why the SDK does routing the way it does in general. Maybe that's a larger question, but why don't we just dispatch with
|
Having fewer methods in Seconded - I like the proposal. |
Plus, this does not seem to introduce any auto-magical, convoluted mechanisms that usually make debugging painful like hell. |
Summary
Right now in AppModule we find for the routes next methods:
I think this can be simplified to only:
Problem Definition
The first problem I see is that we have this Route() and QuerierRoute() that can be embedded into a more generic call.
With the spirit of simplify I saw that is very common to have empty handlers, so we find a lot of modules which provides something like (from x/auth):
Another thing that can happens is that we can have an empty handler to a key, or viceversa.
With the change this is reduced to:
Proposal
When I looked when is Route() used I saw that is only used once, meaning that we have 2 functions that we can reduce this to one.
So where in module/module.go we have:
We can reduce it to:
I have opened a PR with the basic interface concept, and if we like it we can go for it.
#6231
It will need some changes in all modules and it is a breaking change for other project modules, but I think it is simpler.
For Admin Use
The text was updated successfully, but these errors were encountered: