Skip to content

Commit

Permalink
cosmos-sdk-proto: add support for no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Jul 31, 2024
1 parent ae003db commit aaf7618
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
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

0 comments on commit aaf7618

Please sign in to comment.