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

Add support to plug gogo's registry into Textual #14647

Closed
Tracked by #11970
amaury1093 opened this issue Jan 17, 2023 · 1 comment · Fixed by #15302
Closed
Tracked by #11970

Add support to plug gogo's registry into Textual #14647

amaury1093 opened this issue Jan 17, 2023 · 1 comment · Fixed by #15302

Comments

@amaury1093
Copy link
Contributor

amaury1093 commented Jan 17, 2023

Problem Definition

Currently, we hardcode to use protoregistry.GlobalTypes in Textual:

msgType, err := protoregistry.GlobalTypes.FindMessageByURL(screens[0].Text)

This means that for this registry to be populated, each chain needs to register all the needed proto v2 types. This can be done just by silently importing the module, e.g.:

_ "cosmossdk.io/api/cosmos/bank/v1beta1"
_ "cosmossdk.io/api/cosmos/crypto/secp256k1"

However, with a lot of modules, this can be cumbersome and error-prone.

Proposal

Since the current SDK is using gogoproto extensively, we should add the possibility to use gogoproto's registry inside Textual.

  • Add a new argument to NewTextual called typeResolver.
  • If nil, typeResolver will default to protoregistry.GlobalTypes
  • Add a function that transforms gogo's registry into a typeResolver. See some work done in feat: Validate Msg proto annotations #13793.
@amaury1093
Copy link
Contributor Author

Relevant conversation: #14693

@amaury1093 amaury1093 moved this from 📝 Todo to 👀 Needs Review in Cosmos-SDK Mar 8, 2023
@github-project-automation github-project-automation bot moved this from 👀 Needs Review to 👏 Done in Cosmos-SDK Mar 20, 2023
@tac0turtle tac0turtle removed the Q1:2023 label Apr 3, 2023
@tac0turtle tac0turtle removed this from Cosmos-SDK May 31, 2023
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 a pull request may close this issue.

2 participants