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: remove deprecated MessageExt methods #465

Merged
Merged
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
21 changes: 1 addition & 20 deletions cosmos-sdk-proto/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,11 @@

pub use prost::{Message, Name};

use crate::Any;
use prost::{DecodeError, EncodeError};
use prost::EncodeError;
use std::str::FromStr;

/// Extension trait for [`Message`].
pub trait MessageExt: Message {
/// Parse this message proto from [`Any`].
#[deprecated(since = "0.20.0", note = "use Any::to_msg instead")]
fn from_any(any: &Any) -> Result<Self, DecodeError>
where
Self: Default + Name + Sized,
{
any.to_msg()
}

/// Serialize this message proto as [`Any`].
#[deprecated(since = "0.20.0", note = "use Any::from_msg instead")]
fn to_any(&self) -> Result<Any, EncodeError>
where
Self: Name + Sized,
{
Any::from_msg(self)
}

/// Serialize this protobuf message as a byte vector.
fn to_bytes(&self) -> Result<Vec<u8>, EncodeError>;
}
Expand Down
Loading