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

Merge upstream cosmos-rust #2

Merged
merged 13 commits into from
Jul 27, 2022
Merged

Merge upstream cosmos-rust #2

merged 13 commits into from
Jul 27, 2022

Conversation

Philipp-Sc
Copy link
Owner

Update osmosis-proto branch

cbrit and others added 13 commits June 29, 2022 11:18
- Implemented `serde` traits for `Denom`
- Changed internal `Coin` representation
- Getter for `Decimal`'s internal value
- Removed unused `Decimal`
Expose MsgGrantAllowance, MsgRevokeAllowance, BasicAllowance and
AllowedMsgAllowance from cosmrs.
This includes the following additional dependency upgrades:

- `k256` v0.11
- `ecdsa` v0.14
The re-exports CosmRS provides are easily overlooked, and many
downstream users explicitly include `cosmrs`, `cosmos-sdk-proto`, and
`tendermint` in their Cargo.toml.

This documentation should help steer people towards using the
re-exports.
Required by tendermint 0.23.8: cosmos#253
When trying to define an `osmosis-proto` crate (cosmos#239), we ran into the
problem that it needed to import `cosmrs` to be able to impl the
`MsgProto` trait.

We couldn't follow the same pattern as `cosmrs` defining the type URLs
for `cosmos-sdk-proto`, which it could only do because it defined the
`MsgProto` trait as well.

Knowledge of the type URLs is necessary to convert to/from `Any`, which
Cosmos SDK uses all over the place.

So far there isn't a good upstream solution to this problem in `prost`
or AFAICT in `tendermint-proto` either. There's an upstream tracking
issue for `prost` here:

tokio-rs/prost#299

The ideal solution to this problem seems to be adding a `TYPE_URL` to
`prost::Message`, and automatically populating them with `prost-build`.

Failing that, this commit introduces a `TypeUrl` trait with an
associated `TYPE_URL` const (previously provided by the `MsgProto`
trait).

The `from_any` and `to_any` methods have been moved to `MessageExt`.
Transitively enables gRPC support in `cosmos-sdk-proto`
This module contains only trait impls and is therefore empty. It was
mistakenly made `pub`.
@Philipp-Sc Philipp-Sc closed this Jul 27, 2022
@Philipp-Sc Philipp-Sc reopened this Jul 27, 2022
@Philipp-Sc Philipp-Sc merged commit 06ab6b8 into osmosis-proto Jul 27, 2022
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.

5 participants