Skip to content

Commit

Permalink
cosmos-sdk-proto: remove deprecated MessageExt methods (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-iqlusion authored Mar 15, 2024
1 parent 2c9058f commit d5e1008
Showing 1 changed file with 1 addition and 20 deletions.
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

0 comments on commit d5e1008

Please sign in to comment.