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

Implement JsonSchema for MsgEnvelope #856

Merged
merged 4 commits into from
Sep 5, 2023
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
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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 23 in crates/ibc/src/core/ics02_client/msgs.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics02_client/msgs.rs#L23

Added line #L23 was not covered by tests
#[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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]

Check warning on line 20 in crates/ibc/src/core/ics02_client/msgs/create_client.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics02_client/msgs/create_client.rs#L19-L20

Added lines #L19 - L20 were not covered by tests
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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]

Check warning on line 24 in crates/ibc/src/core/ics02_client/msgs/update_client.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics02_client/msgs/update_client.rs#L23-L24

Added lines #L23 - L24 were not covered by tests
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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 380 in crates/ibc/src/core/ics03_connection/connection.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/connection.rs#L380

Added line #L380 was not covered by tests
#[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_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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 31 in crates/ibc/src/core/ics03_connection/msgs.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/msgs.rs#L31

Added line #L31 was not covered by tests
#[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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 22 in crates/ibc/src/core/ics03_connection/msgs/conn_open_ack.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/msgs/conn_open_ack.rs#L22

Added line #L22 was not covered by tests
#[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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 20 in crates/ibc/src/core/ics03_connection/msgs/conn_open_confirm.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/msgs/conn_open_confirm.rs#L20

Added line #L20 was not covered by tests
#[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 @@
/// 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))]

Check warning on line 19 in crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs#L19

Added line #L19 was not covered by tests
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 @@

/// 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))]

Check warning on line 22 in crates/ibc/src/core/ics03_connection/msgs/conn_open_try.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/msgs/conn_open_try.rs#L22

Added line #L22 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 27 in crates/ibc/src/core/ics03_connection/version.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics03_connection/version.rs#L27

Added line #L27 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 26 in crates/ibc/src/core/ics04_channel/acknowledgement.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/acknowledgement.rs#L26

Added line #L26 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 437 in crates/ibc/src/core/ics04_channel/channel.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/channel.rs#L437

Added line #L437 was not covered by tests
#[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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 38 in crates/ibc/src/core/ics04_channel/msgs.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs.rs#L38

Added line #L38 was not covered by tests
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ChannelMsg {
OpenInit(MsgChannelOpenInit),
Expand All @@ -48,6 +51,7 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 54 in crates/ibc/src/core/ics04_channel/msgs.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs.rs#L54

Added line #L54 was not covered by tests
#[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,7 +19,8 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]

Check warning on line 23 in crates/ibc/src/core/ics04_channel/msgs/acknowledgement.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/acknowledgement.rs#L22-L23

Added lines #L22 - L23 were not covered by tests
pub struct MsgAcknowledgement {
pub packet: Packet,
pub acknowledgement: Acknowledgement,
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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 20 in crates/ibc/src/core/ics04_channel/msgs/chan_close_init.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/chan_close_init.rs#L20

Added line #L20 was not covered by tests
#[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,8 +19,9 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MsgChannelOpenAck {

Check warning on line 24 in crates/ibc/src/core/ics04_channel/msgs/chan_open_ack.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/chan_open_ack.rs#L22-L24

Added lines #L22 - L24 were not covered by tests
pub port_id_on_a: PortId,
pub chan_id_on_a: ChannelId,
pub chan_id_on_b: ChannelId,
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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 26 in crates/ibc/src/core/ics04_channel/msgs/chan_open_try.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/chan_open_try.rs#L26

Added line #L26 was not covered by tests
#[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,7 +18,8 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]

Check warning on line 22 in crates/ibc/src/core/ics04_channel/msgs/recv_packet.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/recv_packet.rs#L21-L22

Added lines #L21 - L22 were not covered by tests
pub struct MsgRecvPacket {
/// The packet to be received
pub packet: Packet,
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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 21 in crates/ibc/src/core/ics04_channel/msgs/timeout_on_close.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/msgs/timeout_on_close.rs#L21

Added line #L21 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 69 in crates/ibc/src/core/ics04_channel/packet.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/packet.rs#L69

Added line #L69 was not covered by tests
/// 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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 131 in crates/ibc/src/core/ics04_channel/packet.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/packet.rs#L131

Added line #L131 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 30 in crates/ibc/src/core/ics04_channel/version.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics04_channel/version.rs#L30

Added line #L30 was not covered by tests
#[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 @@
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 71 in crates/ibc/src/core/ics23_commitment/commitment.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics23_commitment/commitment.rs#L71

Added line #L71 was not covered by tests
#[derive(Clone, PartialEq, Eq)]
pub struct CommitmentProofBytes {
#[cfg_attr(
Expand Down Expand Up @@ -150,6 +151,7 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 154 in crates/ibc/src/core/ics23_commitment/commitment.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics23_commitment/commitment.rs#L154

Added line #L154 was not covered by tests
#[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 @@
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 185 in crates/ibc/src/core/ics24_host/identifier.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/ics24_host/identifier.rs#L185

Added line #L185 was not covered by tests
#[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 @@
feature = "borsh",
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]

Check warning on line 42 in crates/ibc/src/core/msgs.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/msgs.rs#L42

Added line #L42 was not covered by tests
#[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 @@
/// 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))]

Check warning on line 26 in crates/ibc/src/core/timestamp.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/core/timestamp.rs#L26

Added line #L26 was not covered by tests
#[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))]

Check warning on line 6 in crates/ibc/src/utils/schema.rs

View check run for this annotation

Codecov / codecov/patch

crates/ibc/src/utils/schema.rs#L6

Added line #L6 was not covered by tests
pub struct AnySchema {
pub type_url: String,
pub value: Vec<u8>,
}
Loading