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: add support for no_std #478

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cosmos-sdk-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ edition = "2021"
rust-version = "1.72"

[dependencies]
prost = "0.13"
prost-types = "0.13"
prost = { version = "0.13", default-features = false }
prost-types = { version = "0.13", default-features = false }
tendermint-proto = "0.38"

# Optional dependencies
tonic = { version = "0.12", optional = true, default-features = false, features = ["codegen", "prost"] }

[features]
default = ["grpc-transport"]
grpc = ["tonic"]
std = ["prost/std", "prost-types/std"]
grpc = ["std", "tonic"]
grpc-transport = ["grpc", "tonic/transport"]
cosmwasm = []

Expand Down
3 changes: 3 additions & 0 deletions cosmos-sdk-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
)]
#![forbid(unsafe_code)]
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;

pub mod traits;
mod type_names;
Expand Down
3 changes: 2 additions & 1 deletion cosmos-sdk-proto/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

pub use prost::{Message, Name};

use alloc::{string::String, vec::Vec};
use core::str::FromStr;
use prost::EncodeError;
use std::str::FromStr;

/// Extension trait for [`Message`].
pub trait MessageExt: Message {
Expand Down
2 changes: 1 addition & 1 deletion cosmrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"
rust-version = "1.72"

[dependencies]
cosmos-sdk-proto = { version = "=0.23.0-pre", default-features = false, path = "../cosmos-sdk-proto" }
cosmos-sdk-proto = { version = "=0.23.0-pre", default-features = false, features = ["std"], path = "../cosmos-sdk-proto" }
ecdsa = "0.16"
eyre = "0.6"
k256 = { version = "0.13", default-features = false, features = ["ecdsa", "sha256"] }
Expand Down
Loading