Skip to content

Generic Router Implementation #3976

Closed
Closed

Description

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type: Code HygieneGeneral cleanup and restructuring of code to provide clarity, flexibility, and modularity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions