-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Generic Router Implementation #3976
Comments
Under the hood the router is just a simple map, no? We can have a generic router that is of type |
This is a great thing for dev ux when building on the SDK. I think this is something we might want to look at while splitting |
I think this is more or less completed with the migration to protobuf. We no longer require users to create switch statements since the protobuf service is registered now. |
Ref: #3880 (comment)
We now have three router logic:
Tx Router: https://github.com/cosmos/cosmos-sdk/blob/develop/baseapp/router.go
Query Router: https://github.com/cosmos/cosmos-sdk/blob/develop/baseapp/queryrouter.go
Proposal Handler: (PR not merged yet)
We need to abstract out this logic, we expect the number of multipurpose modules(like governance proposal) will increase. Two possible implementations are go generate and reflect(https://golang.org/pkg/reflect/#Value.Call). AFAIK go generate is recommended to avoid in our codebase, and reflection is inefficient. Is there a better way to improve?
The text was updated successfully, but these errors were encountered: