Skip to content

Commit

Permalink
Implement JsonSchema for MsgEnvelope (#856)
Browse files Browse the repository at this point in the history
* derive JsonSchema

* fmt

* changelog
  • Loading branch information
plafer authored Sep 5, 2023
1 parent dc8e416 commit 357f51d
Show file tree
Hide file tree
Showing 34 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add `JsonSchema` derive for `MsgEnvelope`
([#856](https://github.com/cosmos/ibc-rs/pull/856))
3 changes: 2 additions & 1 deletion crates/ibc/src/core/ics02_client/msgs.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Defines the client message types that are sent to the chain by the relayer.
use ibc_proto::google::protobuf::Any;

use crate::core::ics02_client::msgs::create_client::MsgCreateClient;
use crate::core::ics02_client::msgs::misbehaviour::MsgSubmitMisbehaviour;
use crate::core::ics02_client::msgs::update_client::MsgUpdateClient;
use crate::core::ics02_client::msgs::upgrade_client::MsgUpgradeClient;
use crate::core::ics24_host::identifier::ClientId;
use crate::prelude::*;
use crate::signer::Signer;

pub mod create_client;
Expand All @@ -20,6 +20,7 @@ pub mod upgrade_client;
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ClientMsg {
CreateClient(MsgCreateClient),
Expand Down
3 changes: 3 additions & 0 deletions crates/ibc/src/core/ics02_client/msgs/create_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgCreateClient";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgCreateClient {
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub client_state: Any,
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub consensus_state: Any,
pub signer: Signer,
}
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics02_client/msgs/misbehaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgSubmitMisbehaviour";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgSubmitMisbehaviour {
/// client unique identifier
pub client_id: ClientId,
/// misbehaviour used for freezing the light client
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub misbehaviour: ProtoAny,
/// signer address
pub signer: Signer,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics02_client/msgs/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpdateClient";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgUpdateClient {
pub client_id: ClientId,
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub client_message: Any,
pub signer: Signer,
}
Expand Down
3 changes: 3 additions & 0 deletions crates/ibc/src/core/ics02_client/msgs/upgrade_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpgradeClient";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgUpgradeClient {
// client unique identifier
pub client_id: ClientId,
// Upgraded client state
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub upgraded_client_state: Any,
// Upgraded consensus state, only contains enough information
// to serve as a basis of trust in update logic
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub upgraded_consensus_state: Any,
// proof that old chain committed to new client
pub proof_upgrade_client: CommitmentProofBytes,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics03_connection/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ impl ConnectionEnd {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct Counterparty {
client_id: ClientId,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics03_connection/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck;
use crate::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm;
use crate::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit;
use crate::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry;
use crate::prelude::*;

pub mod conn_open_ack;
pub mod conn_open_confirm;
Expand All @@ -27,6 +28,7 @@ pub mod conn_open_try;
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ConnectionMsg {
OpenInit(MsgConnectionOpenInit),
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics03_connection/msgs/conn_open_ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenAck"
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgConnectionOpenAck {
/// ConnectionId that chain A has chosen for it's ConnectionEnd
pub conn_id_on_a: ConnectionId,
/// ConnectionId that chain B has chosen for it's ConnectionEnd
pub conn_id_on_b: ConnectionId,
/// ClientState of client tracking chain A on chain B
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub client_state_of_a_on_b: Any,
/// proof of ConnectionEnd stored on Chain B during ConnOpenTry
pub proof_conn_end_on_b: CommitmentProofBytes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenConf
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgConnectionOpenConfirm {
/// ConnectionId that chain B has chosen for it's ConnectionEnd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenInit
/// Per our convention, this message is sent to chain A.
/// The handler will check proofs of chain B.
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct MsgConnectionOpenInit {
/// ClientId on chain A that the connection is being opened for
pub client_id_on_a: ClientId,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics03_connection/msgs/conn_open_try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionOpenTry"

/// Per our convention, this message is sent to chain B.
/// The handler will check proofs of chain A.
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgConnectionOpenTry {
/// ClientId on B that the connection is being opened for
pub client_id_on_b: ClientId,
/// ClientState of client tracking chain B on chain A
#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]
pub client_state_of_b_on_a: Any,
/// ClientId, ConnectionId and prefix of chain A
pub counterparty: Counterparty,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics03_connection/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::utils::pretty::PrettySlice;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Version {
/// unique version identifier
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/acknowledgement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::prelude::*;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Into)]
pub struct Acknowledgement(Vec<u8>);

Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ impl From<Counterparty> for RawCounterparty {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Order {
None = 0isize,
Expand Down
4 changes: 4 additions & 0 deletions crates/ibc/src/core/ics04_channel/msgs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Message definitions for all ICS4 domain types: channel open & close handshake datagrams, as well
//! as packets.
use crate::prelude::*;

pub(crate) mod acknowledgement;
pub(crate) mod chan_close_confirm;
pub(crate) mod chan_close_init;
Expand Down Expand Up @@ -33,6 +35,7 @@ use crate::core::ics24_host::identifier::PortId;
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ChannelMsg {
OpenInit(MsgChannelOpenInit),
Expand All @@ -48,6 +51,7 @@ pub enum ChannelMsg {
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PacketMsg {
Recv(MsgRecvPacket),
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/acknowledgement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgAcknowledgement";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgAcknowledgement {
pub packet: Packet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelCloseConfirm";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelCloseConfirm {
pub port_id_on_b: PortId,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/chan_close_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelCloseInit";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelCloseInit {
pub port_id_on_a: PortId,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/chan_open_ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenAck";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelOpenAck {
pub port_id_on_a: PortId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenConfirm";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelOpenConfirm {
pub port_id_on_b: PortId,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/chan_open_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenInit";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelOpenInit {
pub port_id_on_a: PortId,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/chan_open_try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenTry";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelOpenTry {
pub port_id_on_b: PortId,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/recv_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgRecvPacket";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgRecvPacket {
/// The packet to be received
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgTimeout";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgTimeout {
pub packet: Packet,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/msgs/timeout_on_close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub(crate) const TYPE_URL: &str = "/ibc.core.channel.v1.MsgTimeoutOnClose";
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgTimeoutOnClose {
pub packet: Packet,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics04_channel/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl core::fmt::Display for PacketMsgType {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
/// The sequence number of a packet enforces ordering among packets from the same source.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Sequence(u64);
Expand Down Expand Up @@ -127,6 +128,7 @@ impl core::fmt::Display for Sequence {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Default, Hash, PartialEq, Eq)]
pub struct Packet {
pub seq_on_a: Sequence,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics04_channel/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::prelude::*;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Version(String);

Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/core/ics23_commitment/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ impl From<Vec<u8>> for CommitmentRoot {
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, PartialEq, Eq)]
pub struct CommitmentProofBytes {
#[cfg_attr(
Expand Down Expand Up @@ -150,6 +151,7 @@ impl TryFrom<CommitmentProofBytes> for RawMerkleProof {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, PartialEq, Eq, Hash, Default)]
pub struct CommitmentPrefix {
bytes: Vec<u8>,
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/ics24_host/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ fn parse_chain_id_string(chain_id_str: &str) -> Result<(&str, u64), IdentifierEr
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Into)]
pub struct ClientId(String);

Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/core/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub trait Msg: Clone {
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum MsgEnvelope {
Client(ClientMsg),
Expand Down
3 changes: 3 additions & 0 deletions crates/ibc/src/core/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ pub const ZERO_DURATION: Duration = Duration::from_secs(0);
/// represented as a `u64` Unix timestamp in nanoseconds, with 0 representing the absence
/// of timestamp.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(PartialEq, Eq, Copy, Clone, Debug, Default, PartialOrd, Ord)]
pub struct Timestamp {
// Note: The schema representation is the timestamp in nanoseconds (as we do with borsh).
#[cfg_attr(feature = "schema", schemars(with = "u64"))]
time: Option<Time>,
}

Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
pub mod macros;
pub mod pretty;
pub(crate) mod schema;
10 changes: 10 additions & 0 deletions crates/ibc/src/utils/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;

/// Dummy type that mirrors `ibc_proto::google::protobuf::Any`.
/// Meant to be used with `#[cfg_attr(feature = "schema", schemars(with = "crate::utils::schema::AnySchema"))]`
#[allow(dead_code)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct AnySchema {
pub type_url: String,
pub value: Vec<u8>,
}

0 comments on commit 357f51d

Please sign in to comment.