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

cosmos-sdk-proto: replace TypeUrl with Name trait #432

Merged

Conversation

tony-iqlusion
Copy link
Member

The Name trait added upstream in prost can be used to compute the type URL using Name::type_url: tokio-rs/prost#896

The new Any::{from_msg, to_msg} methods can be used to serialize Message types to/from messages.

This commit switches from the TypeUrl trait to Name and relies more on upstream functionality in prost.

Unfortunately it shipped with a bug in the default Name::full_name method, so a workaround is temporarily used until a fix ships: tokio-rs/prost#923

The `Name` trait added upstream in `prost` can be used to compute the
type URL using `Name::type_url`:

tokio-rs/prost#896

The new `Any::{from_msg, to_msg}` methods can be used to serialize
`Message` types to/from messages.

This commit switches from the `TypeUrl` trait to `Name` and relies
more on upstream functionality in `prost`.

Unfortunately it shipped with a bug in the default `Name::full_name`
method, so a workaround is temporarily used until a fix ships:

tokio-rs/prost#923
@tony-iqlusion tony-iqlusion force-pushed the cosmos-sdk-proto/replace-typeurl-with-name-trait branch from c7a3e03 to 0b01017 Compare October 3, 2023 01:41
@tony-iqlusion tony-iqlusion merged commit 78aed89 into main Oct 3, 2023
11 checks passed
@tony-iqlusion tony-iqlusion deleted the cosmos-sdk-proto/replace-typeurl-with-name-trait branch October 3, 2023 01:47
@Kayanski
Copy link
Contributor

Kayanski commented Dec 4, 2023

Is this reversed now that prost-types has had a named release ?

felipepimsil pushed a commit to felipepimsil/cosmos-rust that referenced this pull request Dec 18, 2023
The `Name` trait added upstream in `prost` can be used to compute the
type URL using `Name::type_url`:

tokio-rs/prost#896

The new `Any::{from_msg, to_msg}` methods can be used to serialize
`Message` types to/from messages.

This commit switches from the `TypeUrl` trait to `Name` and relies
more on upstream functionality in `prost`.

Unfortunately it shipped with a bug in the default `Name::full_name`
method, so a workaround is temporarily used until a fix ships:

tokio-rs/prost#923
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 this pull request may close these issues.

2 participants