From 0caffd87dac4dee9f0837a4d1b422b2d1b128ee0 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 1 May 2023 09:45:02 +0200 Subject: [PATCH] Re-export the `ics23.cosmos.v1` Protobuf definitions from the `ics23` crate (#92) Closes: #10 The proto definitions are exported both under the `ibc_proto::cosmos::ics23::v1` module and under the `ibc_proto::ics23` module for backward source compatiblity. This is nonetheless a breaking change as it may break compilation or trigger warnings in code which relied on these definitions being different than the ones in `ics23`. Note that because the code generated by `pbjson-build` is not `no_std` compatible, the serde annotations on the generated protos are only emitted when the `std` feature of `ibc-proto` is enabled, which is unfortunate but I didn't find a way around that. * Use `ics23` crate Protobuf definitions for `ics23.cosmos.v1` protos * Run Clippy on all possible features combinations using `cargo-hack` on CI * Add changelog entry * Use `pbjson`-based protos * Use master branch * Use latest published version of `ics23` * Only emit serde annotations when `std` feature is enabled * Fix compilation with std enabled --- .../breaking-changes/10-extern-ics23.md | 5 + .github/workflows/rust.yml | 13 + Cargo.toml | 6 +- src/lib.rs | 9 +- src/prost/cosmos.bank.v1beta1.rs | 66 +-- src/prost/cosmos.base.query.v1beta1.rs | 4 +- src/prost/cosmos.base.v1beta1.rs | 8 +- src/prost/cosmos.upgrade.v1beta1.rs | 36 +- src/prost/google.protobuf.rs | 6 +- ...tions.interchain_accounts.controller.v1.rs | 10 +- src/prost/ibc.applications.transfer.v1.rs | 30 +- src/prost/ibc.applications.transfer.v2.rs | 2 +- src/prost/ibc.core.channel.v1.rs | 128 +++--- src/prost/ibc.core.client.v1.rs | 81 ++-- src/prost/ibc.core.commitment.v1.rs | 30 +- src/prost/ibc.core.connection.v1.rs | 69 +-- src/prost/ibc.core.types.v1.rs | 2 +- src/prost/ibc.lightclients.tendermint.v1.rs | 4 +- src/prost/ics23.rs | 402 ------------------ src/protobuf/mod.rs | 2 + tools/proto-compiler/src/cmd/compile.rs | 42 +- 21 files changed, 293 insertions(+), 662 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/10-extern-ics23.md delete mode 100644 src/prost/ics23.rs diff --git a/.changelog/unreleased/breaking-changes/10-extern-ics23.md b/.changelog/unreleased/breaking-changes/10-extern-ics23.md new file mode 100644 index 00000000..83cc169f --- /dev/null +++ b/.changelog/unreleased/breaking-changes/10-extern-ics23.md @@ -0,0 +1,5 @@ +- Re-export the `ics23.cosmos.v1` Protobuf definitions from the `ics23` crate instead of including them directly in this crate. + The proto definitions are exported both under the `ibc_proto::cosmos::ics23::v1` module and under the `ibc_proto::ics23` module + for backward source compatiblity. This is nonetheless a breaking change as it may break compilation or trigger warnings + in code which relied on these definitions being different than the ones in `ics23`. + ([\#10](https://github.com/cosmos/ibc-proto-rs/issues/10)) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 057fea2d..a42e35c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,6 +74,19 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --no-default-features + check_features_powerset: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v1 + - run: cargo hack clippy --feature-powerset --no-dev-deps + test-stable: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/Cargo.toml b/Cargo.toml index e25f3a41..3056c658 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,13 +44,17 @@ scale-info = { version = "2.1.2", default-features = false, features = [ ## for borsh encode or decode borsh = { version = "0.10.0", default-features = false, optional = true } +[dependencies.ics23] +version = "0.10.1" +default-features = false + [dependencies.tendermint-proto] version = "0.31" default-features = false [features] default = ["std", "client"] -std = [] +std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "ics23/serde"] client = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"] json-schema = ["std", "schemars"] server = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"] diff --git a/src/lib.rs b/src/lib.rs index a3d2eac2..01c49304 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -131,6 +131,9 @@ pub mod cosmos { include_proto!("cosmos.gov.v1beta1.rs"); } } + pub mod ics23 { + pub use ics23 as v1; + } } pub mod ibc { @@ -217,9 +220,8 @@ pub mod ibc { } } -pub mod ics23 { - include_proto!("ics23.rs"); -} +// Re-export `ics23` definitions for backward compatibility +pub use ics23; pub mod interchain_security { pub mod ccv { @@ -248,6 +250,7 @@ pub mod stride { } } +#[cfg(feature = "std")] pub(crate) mod base64 { use alloc::string::String; use alloc::vec::Vec; diff --git a/src/prost/cosmos.bank.v1beta1.rs b/src/prost/cosmos.bank.v1beta1.rs index 28fdb987..d92494cb 100644 --- a/src/prost/cosmos.bank.v1beta1.rs +++ b/src/prost/cosmos.bank.v1beta1.rs @@ -1,5 +1,5 @@ /// Params defines the parameters for the bank module. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -10,7 +10,7 @@ pub struct Params { } /// SendEnabled maps coin denom to a send_enabled status (whether a denom is /// sendable). -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendEnabled { @@ -20,7 +20,7 @@ pub struct SendEnabled { pub enabled: bool, } /// Input models transaction input. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Input { @@ -30,7 +30,7 @@ pub struct Input { pub coins: ::prost::alloc::vec::Vec, } /// Output models transaction outputs. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Output { @@ -42,7 +42,7 @@ pub struct Output { /// Supply represents a struct that passively keeps track of the total supply /// amounts in the network. /// This message is deprecated now that supply is indexed by denom. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Supply { @@ -51,7 +51,7 @@ pub struct Supply { } /// DenomUnit represents a struct that describes a given /// denomination unit of the basic token. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomUnit { @@ -71,7 +71,7 @@ pub struct DenomUnit { } /// Metadata represents a struct that describes /// a basic token. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -111,7 +111,7 @@ pub struct Metadata { pub uri_hash: ::prost::alloc::string::String, } /// MsgSend represents a message to send coins from one account to another. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { @@ -123,12 +123,12 @@ pub struct MsgSend { pub amount: ::prost::alloc::vec::Vec, } /// MsgSendResponse defines the Msg/Send response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { @@ -138,7 +138,7 @@ pub struct MsgMultiSend { pub outputs: ::prost::alloc::vec::Vec, } /// MsgMultiSendResponse defines the Msg/MultiSend response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSendResponse {} @@ -511,7 +511,7 @@ pub mod msg_server { } } /// QueryBalanceRequest is the request type for the Query/Balance RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -523,7 +523,7 @@ pub struct QueryBalanceRequest { pub denom: ::prost::alloc::string::String, } /// QueryBalanceResponse is the response type for the Query/Balance RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { @@ -532,7 +532,7 @@ pub struct QueryBalanceResponse { pub balance: ::core::option::Option, } /// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesRequest { @@ -547,7 +547,7 @@ pub struct QueryAllBalancesRequest { } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesResponse { @@ -564,7 +564,7 @@ pub struct QueryAllBalancesResponse { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { @@ -581,7 +581,7 @@ pub struct QuerySpendableBalancesRequest { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { @@ -596,7 +596,7 @@ pub struct QuerySpendableBalancesResponse { } /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { @@ -610,7 +610,7 @@ pub struct QueryTotalSupplyRequest { } /// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyResponse { @@ -626,7 +626,7 @@ pub struct QueryTotalSupplyResponse { >, } /// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfRequest { @@ -635,7 +635,7 @@ pub struct QuerySupplyOfRequest { pub denom: ::prost::alloc::string::String, } /// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfResponse { @@ -644,12 +644,12 @@ pub struct QuerySupplyOfResponse { pub amount: ::core::option::Option, } /// QueryParamsRequest defines the request type for querying x/bank parameters. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse defines the response type for querying x/bank parameters. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -657,7 +657,7 @@ pub struct QueryParamsResponse { pub params: ::core::option::Option, } /// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataRequest { @@ -669,7 +669,7 @@ pub struct QueryDenomsMetadataRequest { } /// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataResponse { @@ -683,7 +683,7 @@ pub struct QueryDenomsMetadataResponse { >, } /// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataRequest { @@ -693,7 +693,7 @@ pub struct QueryDenomMetadataRequest { } /// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataResponse { @@ -704,7 +704,7 @@ pub struct QueryDenomMetadataResponse { /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersRequest { @@ -722,7 +722,7 @@ pub struct QueryDenomOwnersRequest { /// balance of the denominated token. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { @@ -736,7 +736,7 @@ pub struct DenomOwner { /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { @@ -1699,7 +1699,7 @@ pub mod query_server { /// the granter's account. /// /// Since: cosmos-sdk 0.43 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { @@ -1707,7 +1707,7 @@ pub struct SendAuthorization { pub spend_limit: ::prost::alloc::vec::Vec, } /// GenesisState defines the bank module's genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -1727,7 +1727,7 @@ pub struct GenesisState { } /// Balance defines an account address and balance pair used in the bank module's /// genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Balance { diff --git a/src/prost/cosmos.base.query.v1beta1.rs b/src/prost/cosmos.base.query.v1beta1.rs index 00c6edcb..7036e087 100644 --- a/src/prost/cosmos.base.query.v1beta1.rs +++ b/src/prost/cosmos.base.query.v1beta1.rs @@ -5,7 +5,7 @@ /// Foo some_parameter = 1; /// PageRequest pagination = 2; /// } -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageRequest { @@ -42,7 +42,7 @@ pub struct PageRequest { /// repeated Bar results = 1; /// PageResponse page = 2; /// } -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageResponse { diff --git a/src/prost/cosmos.base.v1beta1.rs b/src/prost/cosmos.base.v1beta1.rs index 533f3bb0..e6f40718 100644 --- a/src/prost/cosmos.base.v1beta1.rs +++ b/src/prost/cosmos.base.v1beta1.rs @@ -2,7 +2,7 @@ /// /// NOTE: The amount field is an Int which implements the custom method /// signatures required by gogoproto. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Coin { @@ -15,7 +15,7 @@ pub struct Coin { /// /// NOTE: The amount field is an Dec which implements the custom method /// signatures required by gogoproto. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecCoin { @@ -25,7 +25,7 @@ pub struct DecCoin { pub amount: ::prost::alloc::string::String, } /// IntProto defines a Protobuf wrapper around an Int object. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IntProto { @@ -33,7 +33,7 @@ pub struct IntProto { pub int: ::prost::alloc::string::String, } /// DecProto defines a Protobuf wrapper around a Dec object. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecProto { diff --git a/src/prost/cosmos.upgrade.v1beta1.rs b/src/prost/cosmos.upgrade.v1beta1.rs index 9d4ebf27..aabbe6f2 100644 --- a/src/prost/cosmos.upgrade.v1beta1.rs +++ b/src/prost/cosmos.upgrade.v1beta1.rs @@ -1,5 +1,5 @@ /// Plan specifies information about a planned upgrade and when it should occur. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Plan { @@ -39,7 +39,7 @@ pub struct Plan { /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgSoftwareUpgrade. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { @@ -54,7 +54,7 @@ pub struct SoftwareUpgradeProposal { /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgCancelUpgrade. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { @@ -66,7 +66,7 @@ pub struct CancelSoftwareUpgradeProposal { /// ModuleVersion specifies a module and its consensus version. /// /// Since: cosmos-sdk 0.43 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleVersion { @@ -80,7 +80,7 @@ pub struct ModuleVersion { /// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { @@ -94,14 +94,14 @@ pub struct MsgSoftwareUpgrade { /// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgradeResponse {} /// MsgCancelUpgrade is the Msg/CancelUpgrade request type. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { @@ -112,7 +112,7 @@ pub struct MsgCancelUpgrade { /// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgradeResponse {} @@ -505,13 +505,13 @@ pub mod msg_server { } /// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanRequest {} /// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanResponse { @@ -521,7 +521,7 @@ pub struct QueryCurrentPlanResponse { } /// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanRequest { @@ -531,7 +531,7 @@ pub struct QueryAppliedPlanRequest { } /// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanResponse { @@ -541,7 +541,7 @@ pub struct QueryAppliedPlanResponse { } /// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState /// RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest { @@ -552,7 +552,7 @@ pub struct QueryUpgradedConsensusStateRequest { } /// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState /// RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { @@ -564,7 +564,7 @@ pub struct QueryUpgradedConsensusStateResponse { /// RPC method. /// /// Since: cosmos-sdk 0.43 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsRequest { @@ -578,7 +578,7 @@ pub struct QueryModuleVersionsRequest { /// RPC method. /// /// Since: cosmos-sdk 0.43 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsResponse { @@ -589,14 +589,14 @@ pub struct QueryModuleVersionsResponse { /// QueryAuthorityRequest is the request type for Query/Authority /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityRequest {} /// QueryAuthorityResponse is the response type for Query/Authority /// /// Since: cosmos-sdk 0.46 -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityResponse { diff --git a/src/prost/google.protobuf.rs b/src/prost/google.protobuf.rs index 7b37e2d4..27ae62a0 100644 --- a/src/prost/google.protobuf.rs +++ b/src/prost/google.protobuf.rs @@ -1231,7 +1231,7 @@ pub mod generated_code_info { /// "value": "1.212s" /// } /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1363,7 +1363,7 @@ pub struct Any { /// ) to obtain a formatter capable of generating timestamps in this format. /// /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Timestamp { @@ -1439,7 +1439,7 @@ pub struct Timestamp { /// microsecond should be expressed in JSON format as "3.000001s". /// /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs index 05ff1a2f..16f6b329 100644 --- a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs @@ -1,6 +1,6 @@ /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the controller submodule. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -9,7 +9,7 @@ pub struct Params { pub controller_enabled: bool, } /// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountRequest { @@ -19,7 +19,7 @@ pub struct QueryInterchainAccountRequest { pub connection_id: ::prost::alloc::string::String, } /// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountResponse { @@ -27,12 +27,12 @@ pub struct QueryInterchainAccountResponse { pub address: ::prost::alloc::string::String, } /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { diff --git a/src/prost/ibc.applications.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index 831b422c..2d350087 100644 --- a/src/prost/ibc.applications.transfer.v1.rs +++ b/src/prost/ibc.applications.transfer.v1.rs @@ -1,7 +1,7 @@ /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransfer { @@ -37,7 +37,7 @@ pub struct MsgTransfer { pub memo: ::prost::alloc::string::String, } /// MsgTransferResponse defines the Msg/Transfer response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransferResponse { @@ -342,7 +342,7 @@ pub mod msg_server { } /// DenomTrace contains the base denomination for ICS20 fungible tokens and the /// source tracing information path. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomTrace { @@ -358,7 +358,7 @@ pub struct DenomTrace { /// NOTE: To prevent a single token from being transferred, set the /// TransfersEnabled parameter to true and then set the bank module's SendEnabled /// parameter for the denomination to false. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -373,7 +373,7 @@ pub struct Params { } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceRequest { @@ -383,7 +383,7 @@ pub struct QueryDenomTraceRequest { } /// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceResponse { @@ -393,7 +393,7 @@ pub struct QueryDenomTraceResponse { } /// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesRequest { @@ -405,7 +405,7 @@ pub struct QueryDenomTracesRequest { } /// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesResponse { @@ -419,12 +419,12 @@ pub struct QueryDenomTracesResponse { >, } /// QueryParamsRequest is the request type for the Query/Params RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is the response type for the Query/Params RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -434,7 +434,7 @@ pub struct QueryParamsResponse { } /// QueryDenomHashRequest is the request type for the Query/DenomHash RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashRequest { @@ -444,7 +444,7 @@ pub struct QueryDenomHashRequest { } /// QueryDenomHashResponse is the response type for the Query/DenomHash RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashResponse { @@ -453,7 +453,7 @@ pub struct QueryDenomHashResponse { pub hash: ::prost::alloc::string::String, } /// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressRequest { @@ -465,7 +465,7 @@ pub struct QueryEscrowAddressRequest { pub channel_id: ::prost::alloc::string::String, } /// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressResponse { @@ -1096,7 +1096,7 @@ pub mod query_server { } } /// GenesisState defines the ibc-transfer genesis state -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/src/prost/ibc.applications.transfer.v2.rs b/src/prost/ibc.applications.transfer.v2.rs index 76c794e7..ffaee30e 100644 --- a/src/prost/ibc.applications.transfer.v2.rs +++ b/src/prost/ibc.applications.transfer.v2.rs @@ -1,7 +1,7 @@ /// FungibleTokenPacketData defines a struct for the packet payload /// See FungibleTokenPacketData spec: /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FungibleTokenPacketData { diff --git a/src/prost/ibc.core.channel.v1.rs b/src/prost/ibc.core.channel.v1.rs index 5b74963e..dfdb3822 100644 --- a/src/prost/ibc.core.channel.v1.rs +++ b/src/prost/ibc.core.channel.v1.rs @@ -1,8 +1,11 @@ /// Channel defines pipeline for exactly-once packet delivery between specific /// modules on separate blockchains, which has at least one end capable of /// sending packets and one end capable of receiving packets. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Channel { @@ -25,7 +28,7 @@ pub struct Channel { } /// IdentifiedChannel defines a channel with additional port and channel /// identifier fields. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedChannel { @@ -53,8 +56,11 @@ pub struct IdentifiedChannel { pub channel_id: ::prost::alloc::string::String, } /// Counterparty defines a channel end counterparty -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Counterparty { @@ -66,7 +72,7 @@ pub struct Counterparty { pub channel_id: ::prost::alloc::string::String, } /// Packet defines a type that carries data across different chains through IBC -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Packet { @@ -101,7 +107,7 @@ pub struct Packet { /// packet commitments, acknowledgements, and receipts. /// Caller is responsible for knowing the context necessary to interpret this /// state as a commitment, acknowledgement, or a receipt. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketState { @@ -121,7 +127,7 @@ pub struct PacketState { /// PacketId is an identifer for a unique Packet /// Source chains refer to packets by source port/channel /// Destination chains refer to packets by destination port/channel -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketId { @@ -142,7 +148,7 @@ pub struct PacketId { /// The first byte of any message with this format will be the non-ASCII values /// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: /// -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Acknowledgement { @@ -153,7 +159,7 @@ pub struct Acknowledgement { /// Nested message and enum types in `Acknowledgement`. pub mod acknowledgement { /// response contains either a result or an error and must be non-empty - #[derive(::serde::Serialize, ::serde::Deserialize)] + #[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { @@ -165,7 +171,7 @@ pub mod acknowledgement { } /// State defines if a channel is in one of the following states: /// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { @@ -209,7 +215,7 @@ impl State { } } /// Order defines if a channel is ORDERED or UNORDERED -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Order { @@ -244,7 +250,7 @@ impl Order { } } /// GenesisState defines the ibc channel submodule's genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -268,7 +274,7 @@ pub struct GenesisState { } /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketSequence { @@ -281,7 +287,7 @@ pub struct PacketSequence { } /// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It /// is called by a relayer on Chain A. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInit { @@ -293,7 +299,7 @@ pub struct MsgChannelOpenInit { pub signer: ::prost::alloc::string::String, } /// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInitResponse { @@ -305,7 +311,7 @@ pub struct MsgChannelOpenInitResponse { /// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel /// on Chain B. The version field within the Channel field has been deprecated. Its /// value will be ignored by core IBC. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTry { @@ -328,7 +334,7 @@ pub struct MsgChannelOpenTry { pub signer: ::prost::alloc::string::String, } /// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTryResponse { @@ -337,7 +343,7 @@ pub struct MsgChannelOpenTryResponse { } /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge /// the change of channel state to TRYOPEN on Chain B. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAck { @@ -357,13 +363,13 @@ pub struct MsgChannelOpenAck { pub signer: ::prost::alloc::string::String, } /// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAckResponse {} /// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of channel state to OPEN on Chain A. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirm { @@ -380,13 +386,13 @@ pub struct MsgChannelOpenConfirm { } /// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response /// type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirmResponse {} /// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A /// to close a channel with Chain B. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInit { @@ -398,13 +404,13 @@ pub struct MsgChannelCloseInit { pub signer: ::prost::alloc::string::String, } /// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInitResponse {} /// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B /// to acknowledge the change of channel state to CLOSED on Chain A. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirm { @@ -421,12 +427,12 @@ pub struct MsgChannelCloseConfirm { } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirmResponse {} /// MsgRecvPacket receives incoming IBC packet -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacket { @@ -440,7 +446,7 @@ pub struct MsgRecvPacket { pub signer: ::prost::alloc::string::String, } /// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacketResponse { @@ -448,7 +454,7 @@ pub struct MsgRecvPacketResponse { pub result: i32, } /// MsgTimeout receives timed-out packet -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeout { @@ -464,7 +470,7 @@ pub struct MsgTimeout { pub signer: ::prost::alloc::string::String, } /// MsgTimeoutResponse defines the Msg/Timeout response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutResponse { @@ -472,7 +478,7 @@ pub struct MsgTimeoutResponse { pub result: i32, } /// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnClose { @@ -490,7 +496,7 @@ pub struct MsgTimeoutOnClose { pub signer: ::prost::alloc::string::String, } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnCloseResponse { @@ -498,7 +504,7 @@ pub struct MsgTimeoutOnCloseResponse { pub result: i32, } /// MsgAcknowledgement receives incoming IBC acknowledgement -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgement { @@ -514,7 +520,7 @@ pub struct MsgAcknowledgement { pub signer: ::prost::alloc::string::String, } /// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgementResponse { @@ -522,7 +528,7 @@ pub struct MsgAcknowledgementResponse { pub result: i32, } /// ResponseResultType defines the possible outcomes of the execution of a message -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ResponseResultType { @@ -1561,7 +1567,7 @@ pub mod msg_server { } } /// QueryChannelRequest is the request type for the Query/Channel RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelRequest { @@ -1575,7 +1581,7 @@ pub struct QueryChannelRequest { /// QueryChannelResponse is the response type for the Query/Channel RPC method. /// Besides the Channel end, it includes a proof and the height from which the /// proof was retrieved. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelResponse { @@ -1590,7 +1596,7 @@ pub struct QueryChannelResponse { pub proof_height: ::core::option::Option, } /// QueryChannelsRequest is the request type for the Query/Channels RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsRequest { @@ -1601,7 +1607,7 @@ pub struct QueryChannelsRequest { >, } /// QueryChannelsResponse is the response type for the Query/Channels RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsResponse { @@ -1619,7 +1625,7 @@ pub struct QueryChannelsResponse { } /// QueryConnectionChannelsRequest is the request type for the /// Query/QueryConnectionChannels RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsRequest { @@ -1634,7 +1640,7 @@ pub struct QueryConnectionChannelsRequest { } /// QueryConnectionChannelsResponse is the Response type for the /// Query/QueryConnectionChannels RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsResponse { @@ -1652,7 +1658,7 @@ pub struct QueryConnectionChannelsResponse { } /// QueryChannelClientStateRequest is the request type for the Query/ClientState /// RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateRequest { @@ -1665,7 +1671,7 @@ pub struct QueryChannelClientStateRequest { } /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateResponse { @@ -1683,7 +1689,7 @@ pub struct QueryChannelClientStateResponse { } /// QueryChannelConsensusStateRequest is the request type for the /// Query/ConsensusState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateRequest { @@ -1702,7 +1708,7 @@ pub struct QueryChannelConsensusStateRequest { } /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateResponse { @@ -1723,7 +1729,7 @@ pub struct QueryChannelConsensusStateResponse { } /// QueryPacketCommitmentRequest is the request type for the /// Query/PacketCommitment RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentRequest { @@ -1740,7 +1746,7 @@ pub struct QueryPacketCommitmentRequest { /// QueryPacketCommitmentResponse defines the client query response for a packet /// which also includes a proof and the height from which the proof was /// retrieved -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentResponse { @@ -1756,7 +1762,7 @@ pub struct QueryPacketCommitmentResponse { } /// QueryPacketCommitmentsRequest is the request type for the /// Query/QueryPacketCommitments RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsRequest { @@ -1774,7 +1780,7 @@ pub struct QueryPacketCommitmentsRequest { } /// QueryPacketCommitmentsResponse is the request type for the /// Query/QueryPacketCommitments RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsResponse { @@ -1791,7 +1797,7 @@ pub struct QueryPacketCommitmentsResponse { } /// QueryPacketReceiptRequest is the request type for the /// Query/PacketReceipt RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptRequest { @@ -1808,7 +1814,7 @@ pub struct QueryPacketReceiptRequest { /// QueryPacketReceiptResponse defines the client query response for a packet /// receipt which also includes a proof, and the height from which the proof was /// retrieved -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptResponse { @@ -1824,7 +1830,7 @@ pub struct QueryPacketReceiptResponse { } /// QueryPacketAcknowledgementRequest is the request type for the /// Query/PacketAcknowledgement RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementRequest { @@ -1841,7 +1847,7 @@ pub struct QueryPacketAcknowledgementRequest { /// QueryPacketAcknowledgementResponse defines the client query response for a /// packet which also includes a proof and the height from which the /// proof was retrieved -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementResponse { @@ -1857,7 +1863,7 @@ pub struct QueryPacketAcknowledgementResponse { } /// QueryPacketAcknowledgementsRequest is the request type for the /// Query/QueryPacketCommitments RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsRequest { @@ -1878,7 +1884,7 @@ pub struct QueryPacketAcknowledgementsRequest { } /// QueryPacketAcknowledgemetsResponse is the request type for the /// Query/QueryPacketAcknowledgements RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsResponse { @@ -1895,7 +1901,7 @@ pub struct QueryPacketAcknowledgementsResponse { } /// QueryUnreceivedPacketsRequest is the request type for the /// Query/UnreceivedPackets RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsRequest { @@ -1911,7 +1917,7 @@ pub struct QueryUnreceivedPacketsRequest { } /// QueryUnreceivedPacketsResponse is the response type for the /// Query/UnreceivedPacketCommitments RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsResponse { @@ -1924,7 +1930,7 @@ pub struct QueryUnreceivedPacketsResponse { } /// QueryUnreceivedAcks is the request type for the /// Query/UnreceivedAcks RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksRequest { @@ -1940,7 +1946,7 @@ pub struct QueryUnreceivedAcksRequest { } /// QueryUnreceivedAcksResponse is the response type for the /// Query/UnreceivedAcks RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksResponse { @@ -1953,7 +1959,7 @@ pub struct QueryUnreceivedAcksResponse { } /// QueryNextSequenceReceiveRequest is the request type for the /// Query/QueryNextSequenceReceiveRequest RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveRequest { @@ -1966,7 +1972,7 @@ pub struct QueryNextSequenceReceiveRequest { } /// QuerySequenceResponse is the request type for the /// Query/QueryNextSequenceReceiveResponse RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveResponse { diff --git a/src/prost/ibc.core.client.v1.rs b/src/prost/ibc.core.client.v1.rs index 93e8f971..577c49a9 100644 --- a/src/prost/ibc.core.client.v1.rs +++ b/src/prost/ibc.core.client.v1.rs @@ -1,6 +1,6 @@ /// IdentifiedClientState defines a client state with an additional client /// identifier field. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedClientState { @@ -15,7 +15,7 @@ pub struct IdentifiedClientState { } /// ConsensusStateWithHeight defines a consensus state with an additional height /// field. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusStateWithHeight { @@ -30,7 +30,7 @@ pub struct ConsensusStateWithHeight { } /// ClientConsensusStates defines all the stored consensus states for a given /// client. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientConsensusStates { @@ -45,7 +45,7 @@ pub struct ClientConsensusStates { /// client's latest consensus state is copied over to the subject client. The proposal /// handler may fail if the subject and the substitute do not match in client and /// chain parameters (with exception to latest height, frozen height, and chain-id). -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientUpdateProposal { @@ -65,7 +65,7 @@ pub struct ClientUpdateProposal { } /// UpgradeProposal is a gov Content type for initiating an IBC breaking /// upgrade. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeProposal { @@ -98,23 +98,26 @@ pub struct UpgradeProposal { /// breaking changes In these cases, the RevisionNumber is incremented so that /// height continues to be monitonically increasing even as the RevisionHeight /// gets reset -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Height { /// the revision that the client is currently on #[prost(uint64, tag = "1")] - #[serde(default)] + #[cfg_attr(feature = "std", serde(default))] pub revision_number: u64, /// the height within the given revision #[prost(uint64, tag = "2")] - #[serde(default)] + #[cfg_attr(feature = "std", serde(default))] pub revision_height: u64, } /// Params defines the set of IBC light client parameters. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -123,7 +126,7 @@ pub struct Params { pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// GenesisState defines the ibc client submodule's genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -147,7 +150,7 @@ pub struct GenesisState { } /// GenesisMetadata defines the genesis type for metadata that clients may return /// with ExportMetadata -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisMetadata { @@ -160,7 +163,7 @@ pub struct GenesisMetadata { } /// IdentifiedGenesisMetadata has the client metadata with the corresponding /// client id. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedGenesisMetadata { @@ -170,7 +173,7 @@ pub struct IdentifiedGenesisMetadata { pub client_metadata: ::prost::alloc::vec::Vec, } /// MsgCreateClient defines a message to create an IBC client -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClient { @@ -190,13 +193,13 @@ pub struct MsgCreateClient { pub signer: ::prost::alloc::string::String, } /// MsgCreateClientResponse defines the Msg/CreateClient response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClientResponse {} /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using /// the given header. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClient { @@ -213,13 +216,13 @@ pub struct MsgUpdateClient { pub signer: ::prost::alloc::string::String, } /// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClientResponse {} /// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client /// state -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClient { @@ -248,13 +251,13 @@ pub struct MsgUpgradeClient { pub signer: ::prost::alloc::string::String, } /// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClientResponse {} /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for /// light client misbehaviour. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviour { @@ -272,7 +275,7 @@ pub struct MsgSubmitMisbehaviour { } /// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response /// type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviourResponse {} @@ -811,7 +814,7 @@ pub mod msg_server { } /// QueryClientStateRequest is the request type for the Query/ClientState RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateRequest { @@ -822,7 +825,7 @@ pub struct QueryClientStateRequest { /// QueryClientStateResponse is the response type for the Query/ClientState RPC /// method. Besides the client state, it includes a proof and the height from /// which the proof was retrieved. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateResponse { @@ -840,7 +843,7 @@ pub struct QueryClientStateResponse { } /// QueryClientStatesRequest is the request type for the Query/ClientStates RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesRequest { @@ -852,7 +855,7 @@ pub struct QueryClientStatesRequest { } /// QueryClientStatesResponse is the response type for the Query/ClientStates RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesResponse { @@ -868,7 +871,7 @@ pub struct QueryClientStatesResponse { /// QueryConsensusStateRequest is the request type for the Query/ConsensusState /// RPC method. Besides the consensus state, it includes a proof and the height /// from which the proof was retrieved. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateRequest { @@ -888,7 +891,7 @@ pub struct QueryConsensusStateRequest { } /// QueryConsensusStateResponse is the response type for the Query/ConsensusState /// RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateResponse { @@ -906,7 +909,7 @@ pub struct QueryConsensusStateResponse { } /// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates /// RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesRequest { @@ -921,7 +924,7 @@ pub struct QueryConsensusStatesRequest { } /// QueryConsensusStatesResponse is the response type for the /// Query/ConsensusStates RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesResponse { @@ -936,7 +939,7 @@ pub struct QueryConsensusStatesResponse { } /// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights /// RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsRequest { @@ -951,7 +954,7 @@ pub struct QueryConsensusStateHeightsRequest { } /// QueryConsensusStateHeightsResponse is the response type for the /// Query/ConsensusStateHeights RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsResponse { @@ -966,7 +969,7 @@ pub struct QueryConsensusStateHeightsResponse { } /// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusRequest { @@ -976,7 +979,7 @@ pub struct QueryClientStatusRequest { } /// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC /// method. It returns the current status of the IBC client. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusResponse { @@ -985,13 +988,13 @@ pub struct QueryClientStatusResponse { } /// QueryClientParamsRequest is the request type for the Query/ClientParams RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsRequest {} /// QueryClientParamsResponse is the response type for the Query/ClientParams RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsResponse { @@ -1001,13 +1004,13 @@ pub struct QueryClientParamsResponse { } /// QueryUpgradedClientStateRequest is the request type for the /// Query/UpgradedClientState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateRequest {} /// QueryUpgradedClientStateResponse is the response type for the /// Query/UpgradedClientState RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateResponse { @@ -1019,13 +1022,13 @@ pub struct QueryUpgradedClientStateResponse { } /// QueryUpgradedConsensusStateRequest is the request type for the /// Query/UpgradedConsensusState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest {} /// QueryUpgradedConsensusStateResponse is the response type for the /// Query/UpgradedConsensusState RPC method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { diff --git a/src/prost/ibc.core.commitment.v1.rs b/src/prost/ibc.core.commitment.v1.rs index 62d927ff..0b30b223 100644 --- a/src/prost/ibc.core.commitment.v1.rs +++ b/src/prost/ibc.core.commitment.v1.rs @@ -1,32 +1,38 @@ /// MerkleRoot defines a merkle root hash. /// In the Cosmos SDK, the AppHash of a block header becomes the root. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleRoot { #[prost(bytes = "vec", tag = "1")] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] + #[cfg_attr(feature = "std", serde(with = "crate::base64"))] + #[cfg_attr(all(feature = "json-schema", feature = "std"), schemars(with = "String"))] pub hash: ::prost::alloc::vec::Vec, } /// MerklePrefix is merkle path prefixed to the key. /// The constructed key from the Path and the key will be append(Path.KeyPath, /// append(Path.KeyPrefix, key...)) -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePrefix { #[prost(bytes = "vec", tag = "1")] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] + #[cfg_attr(feature = "std", serde(with = "crate::base64"))] + #[cfg_attr(all(feature = "json-schema", feature = "std"), schemars(with = "String"))] pub key_prefix: ::prost::alloc::vec::Vec, } /// MerklePath is the path used to verify commitment proofs, which can be an /// arbitrary structured object (defined by a commitment type). /// MerklePath is represented from root-to-leaf -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePath { @@ -38,12 +44,10 @@ pub struct MerklePath { /// elements, verifiable in conjunction with a known commitment root. Proofs /// should be succinct. /// MerkleProofs are ordered from leaf-to-root -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { #[prost(message, repeated, tag = "1")] - pub proofs: ::prost::alloc::vec::Vec< - super::super::super::super::ics23::CommitmentProof, - >, + pub proofs: ::prost::alloc::vec::Vec<::ics23::CommitmentProof>, } diff --git a/src/prost/ibc.core.connection.v1.rs b/src/prost/ibc.core.connection.v1.rs index 652babeb..03eb3b58 100644 --- a/src/prost/ibc.core.connection.v1.rs +++ b/src/prost/ibc.core.connection.v1.rs @@ -2,8 +2,11 @@ /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish /// a connection between two chains. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionEnd { @@ -28,7 +31,7 @@ pub struct ConnectionEnd { } /// IdentifiedConnection defines a connection with additional connection /// identifier field. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedConnection { @@ -53,8 +56,11 @@ pub struct IdentifiedConnection { pub delay_period: u64, } /// Counterparty defines the counterparty chain associated with a connection end. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Counterparty { @@ -71,7 +77,7 @@ pub struct Counterparty { pub prefix: ::core::option::Option, } /// ClientPaths define all the connection paths for a client state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientPaths { @@ -80,7 +86,7 @@ pub struct ClientPaths { pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// ConnectionPaths define all the connection paths for a given client state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionPaths { @@ -93,8 +99,11 @@ pub struct ConnectionPaths { } /// Version defines the versioning scheme used to negotiate the IBC verison in /// the connection handshake. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] +#[cfg_attr( + all(feature = "json-schema", feature = "std"), + derive(::schemars::JsonSchema) +)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Version { @@ -106,7 +115,7 @@ pub struct Version { pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Params defines the set of Connection parameters. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -118,7 +127,7 @@ pub struct Params { } /// State defines if a connection is in one of the following states: /// INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { @@ -157,7 +166,7 @@ impl State { } } /// GenesisState defines the ibc connection submodule's genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -173,7 +182,7 @@ pub struct GenesisState { } /// MsgConnectionOpenInit defines the msg sent by an account on Chain A to /// initialize a connection with Chain B. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInit { @@ -190,13 +199,13 @@ pub struct MsgConnectionOpenInit { } /// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response /// type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInitResponse {} /// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a /// connection on Chain B. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTry { @@ -234,13 +243,13 @@ pub struct MsgConnectionOpenTry { pub signer: ::prost::alloc::string::String, } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTryResponse {} /// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to /// acknowledge the change of connection state to TRYOPEN on Chain B. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAck { @@ -272,13 +281,13 @@ pub struct MsgConnectionOpenAck { pub signer: ::prost::alloc::string::String, } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAckResponse {} /// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of connection state to OPEN on Chain A. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirm { @@ -294,7 +303,7 @@ pub struct MsgConnectionOpenConfirm { } /// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm /// response type. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} @@ -848,7 +857,7 @@ pub mod msg_server { } /// QueryConnectionRequest is the request type for the Query/Connection RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionRequest { @@ -859,7 +868,7 @@ pub struct QueryConnectionRequest { /// QueryConnectionResponse is the response type for the Query/Connection RPC /// method. Besides the connection end, it includes a proof and the height from /// which the proof was retrieved. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionResponse { @@ -875,7 +884,7 @@ pub struct QueryConnectionResponse { } /// QueryConnectionsRequest is the request type for the Query/Connections RPC /// method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsRequest { @@ -886,7 +895,7 @@ pub struct QueryConnectionsRequest { } /// QueryConnectionsResponse is the response type for the Query/Connections RPC /// method. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsResponse { @@ -904,7 +913,7 @@ pub struct QueryConnectionsResponse { } /// QueryClientConnectionsRequest is the request type for the /// Query/ClientConnections RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsRequest { @@ -914,7 +923,7 @@ pub struct QueryClientConnectionsRequest { } /// QueryClientConnectionsResponse is the response type for the /// Query/ClientConnections RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsResponse { @@ -930,7 +939,7 @@ pub struct QueryClientConnectionsResponse { } /// QueryConnectionClientStateRequest is the request type for the /// Query/ConnectionClientState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateRequest { @@ -940,7 +949,7 @@ pub struct QueryConnectionClientStateRequest { } /// QueryConnectionClientStateResponse is the response type for the /// Query/ConnectionClientState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateResponse { @@ -958,7 +967,7 @@ pub struct QueryConnectionClientStateResponse { } /// QueryConnectionConsensusStateRequest is the request type for the /// Query/ConnectionConsensusState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateRequest { @@ -972,7 +981,7 @@ pub struct QueryConnectionConsensusStateRequest { } /// QueryConnectionConsensusStateResponse is the response type for the /// Query/ConnectionConsensusState RPC method -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateResponse { diff --git a/src/prost/ibc.core.types.v1.rs b/src/prost/ibc.core.types.v1.rs index 3bbd6f6e..704722dd 100644 --- a/src/prost/ibc.core.types.v1.rs +++ b/src/prost/ibc.core.types.v1.rs @@ -1,5 +1,5 @@ /// GenesisState defines the ibc module's genesis state. -#[derive(::serde::Serialize, ::serde::Deserialize)] +#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { diff --git a/src/prost/ibc.lightclients.tendermint.v1.rs b/src/prost/ibc.lightclients.tendermint.v1.rs index d1dfa918..0a2b7a04 100644 --- a/src/prost/ibc.lightclients.tendermint.v1.rs +++ b/src/prost/ibc.lightclients.tendermint.v1.rs @@ -35,9 +35,7 @@ pub struct ClientState { >, /// Proof specifications used in verifying counterparty state #[prost(message, repeated, tag = "8")] - pub proof_specs: ::prost::alloc::vec::Vec< - super::super::super::super::ics23::ProofSpec, - >, + pub proof_specs: ::prost::alloc::vec::Vec<::ics23::ProofSpec>, /// Path at which next upgraded client will be committed. /// Each element corresponds to the key for a single CommitmentProof in the /// chained proof. NOTE: ClientState must stored under diff --git a/src/prost/ics23.rs b/src/prost/ics23.rs deleted file mode 100644 index aa7e2cbe..00000000 --- a/src/prost/ics23.rs +++ /dev/null @@ -1,402 +0,0 @@ -/// * -/// ExistenceProof takes a key and a value and a set of steps to perform on it. -/// The result of peforming all these steps will provide a "root hash", which can -/// be compared to the value in a header. -/// -/// Since it is computationally infeasible to produce a hash collission for any of the used -/// cryptographic hash functions, if someone can provide a series of operations to transform -/// a given key and value into a root hash that matches some trusted root, these key and values -/// must be in the referenced merkle tree. -/// -/// The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -/// which should be controlled by a spec. Eg. with lengthOp as NONE, -/// prefix = FOO, key = BAR, value = CHOICE -/// and -/// prefix = F, key = OOBAR, value = CHOICE -/// would produce the same value. -/// -/// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -/// in the ProofSpec is valuable to prevent this mutability. And why all trees should -/// length-prefix the data before hashing it. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -/// -/// NonExistenceProof takes a proof of two neighbors, one left of the desired key, -/// one right of the desired key. If both proofs are valid AND they are neighbors, -/// then there is no valid proof for the given key. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -/// -/// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CommitmentProof { - #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CommitmentProof`. -pub mod commitment_proof { - #[derive(::serde::Serialize, ::serde::Deserialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - #[prost(message, tag = "3")] - Batch(super::BatchProof), - #[prost(message, tag = "4")] - Compressed(super::CompressedBatchProof), - } -} -/// * -/// LeafOp represents the raw key-value data we wish to prove, and -/// must be flexible to represent the internal transformation from -/// the original key-value pairs into the basis hash, for many existing -/// merkle trees. -/// -/// key and value are passed in. So that the signature of this operation is: -/// leafOp(key, value) -> output -/// -/// To process this, first prehash the keys and values if needed (ANY means no hash in this case): -/// hkey = prehashKey(key) -/// hvalue = prehashValue(value) -/// -/// Then combine the bytes, and hash it -/// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[derive(Eq)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LeafOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(enumeration = "HashOp", tag = "2")] - #[serde(default)] - pub prehash_key: i32, - #[prost(enumeration = "HashOp", tag = "3")] - pub prehash_value: i32, - #[prost(enumeration = "LengthOp", tag = "4")] - pub length: i32, - /// prefix is a fixed bytes that may optionally be included at the beginning to differentiate - /// a leaf node from an inner node. - #[prost(bytes = "vec", tag = "5")] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] - pub prefix: ::prost::alloc::vec::Vec, -} -/// * -/// InnerOp represents a merkle-proof step that is not a leaf. -/// It represents concatenating two children and hashing them to provide the next result. -/// -/// The result of the previous step is passed in, so the signature of this op is: -/// innerOp(child) -> output -/// -/// The result of applying InnerOp should be: -/// output = op.hash(op.prefix || child || op.suffix) -/// -/// where the || operator is concatenation of binary data, -/// and child is the result of hashing all the tree below this step. -/// -/// Any special data, like prepending child with the length, or prepending the entire operation with -/// some value to differentiate from leaf nodes, should be included in prefix and suffix. -/// If either of prefix or suffix is empty, we just treat it as an empty string -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] -#[derive(Eq)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(bytes = "vec", tag = "2")] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] - pub prefix: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] - pub suffix: ::prost::alloc::vec::Vec, -} -/// * -/// ProofSpec defines what the expected parameters are for a given proof type. -/// This can be stored in the client and used to validate any incoming proofs. -/// -/// verify(ProofSpec, Proof) -> Proof | Error -/// -/// As demonstrated in tests, if we don't fix the algorithm used to calculate the -/// LeafHash for a given tree, there are many possible key-value pairs that can -/// generate a given hash (by interpretting the preimage differently). -/// We need this for proper security, requires client knows a priori what -/// tree format server uses. But not in code, rather a configuration object. -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[derive(Eq)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProofSpec { - /// any field in the ExistenceProof must be the same as in this spec. - /// except Prefix, which is just the first bytes of prefix (spec can be longer) - #[prost(message, optional, tag = "1")] - pub leaf_spec: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub inner_spec: ::core::option::Option, - /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "3")] - #[serde(default)] - pub max_depth: i32, - /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "4")] - #[serde(default)] - pub min_depth: i32, -} -/// -/// InnerSpec contains all store-specific structure info to determine if two proofs from a -/// given store are neighbors. -/// -/// This enables: -/// -/// isLeftMost(spec: InnerSpec, op: InnerOp) -/// isRightMost(spec: InnerSpec, op: InnerOp) -/// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[derive(Eq)] -#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerSpec { - /// Child order is the ordering of the children node, must count from 0 - /// iavl tree is [0, 1] (left then right) - /// merk is [0, 2, 1] (left, right, here) - #[prost(int32, repeated, tag = "1")] - pub child_order: ::prost::alloc::vec::Vec, - #[prost(int32, tag = "2")] - pub child_size: i32, - #[prost(int32, tag = "3")] - pub min_prefix_length: i32, - #[prost(int32, tag = "4")] - pub max_prefix_length: i32, - /// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - #[prost(bytes = "vec", tag = "5")] - #[serde(default)] - #[serde(with = "crate::base64")] - #[cfg_attr(feature = "json-schema", schemars(with = "String"))] - pub empty_child: ::prost::alloc::vec::Vec, - /// hash is the algorithm that must be used for each InnerOp - #[prost(enumeration = "HashOp", tag = "6")] - pub hash: i32, -} -/// -/// BatchProof is a group of multiple proof types than can be compressed -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchEntry { - #[prost(oneof = "batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `BatchEntry`. -pub mod batch_entry { - #[derive(::serde::Serialize, ::serde::Deserialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - } -} -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub lookup_inners: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchEntry { - #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CompressedBatchEntry`. -pub mod compressed_batch_entry { - #[derive(::serde::Serialize, ::serde::Deserialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::CompressedExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::CompressedNonExistenceProof), - } -} -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - /// these are indexes into the lookup_inners table in CompressedBatchProof - #[prost(int32, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedNonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum HashOp { - /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NoHash = 0, - Sha256 = 1, - Sha512 = 2, - Keccak = 3, - Ripemd160 = 4, - /// ripemd160(sha256(x)) - Bitcoin = 5, - Sha512256 = 6, -} -impl HashOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - HashOp::NoHash => "NO_HASH", - HashOp::Sha256 => "SHA256", - HashOp::Sha512 => "SHA512", - HashOp::Keccak => "KECCAK", - HashOp::Ripemd160 => "RIPEMD160", - HashOp::Bitcoin => "BITCOIN", - HashOp::Sha512256 => "SHA512_256", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NO_HASH" => Some(Self::NoHash), - "SHA256" => Some(Self::Sha256), - "SHA512" => Some(Self::Sha512), - "KECCAK" => Some(Self::Keccak), - "RIPEMD160" => Some(Self::Ripemd160), - "BITCOIN" => Some(Self::Bitcoin), - "SHA512_256" => Some(Self::Sha512256), - _ => None, - } - } -} -/// * -/// LengthOp defines how to process the key and value of the LeafOp -/// to include length information. After encoding the length with the given -/// algorithm, the length will be prepended to the key and value bytes. -/// (Each one with it's own encoded length) -#[derive(::serde::Serialize, ::serde::Deserialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LengthOp { - /// NO_PREFIX don't include any length info - NoPrefix = 0, - /// VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VarProto = 1, - /// VAR_RLP uses rlp int encoding of the length - VarRlp = 2, - /// FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - Fixed32Big = 3, - /// FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - Fixed32Little = 4, - /// FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - Fixed64Big = 5, - /// FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - Fixed64Little = 6, - /// REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - Require32Bytes = 7, - /// REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - Require64Bytes = 8, -} -impl LengthOp { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - LengthOp::NoPrefix => "NO_PREFIX", - LengthOp::VarProto => "VAR_PROTO", - LengthOp::VarRlp => "VAR_RLP", - LengthOp::Fixed32Big => "FIXED32_BIG", - LengthOp::Fixed32Little => "FIXED32_LITTLE", - LengthOp::Fixed64Big => "FIXED64_BIG", - LengthOp::Fixed64Little => "FIXED64_LITTLE", - LengthOp::Require32Bytes => "REQUIRE_32_BYTES", - LengthOp::Require64Bytes => "REQUIRE_64_BYTES", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NO_PREFIX" => Some(Self::NoPrefix), - "VAR_PROTO" => Some(Self::VarProto), - "VAR_RLP" => Some(Self::VarRlp), - "FIXED32_BIG" => Some(Self::Fixed32Big), - "FIXED32_LITTLE" => Some(Self::Fixed32Little), - "FIXED64_BIG" => Some(Self::Fixed64Big), - "FIXED64_LITTLE" => Some(Self::Fixed64Little), - "REQUIRE_32_BYTES" => Some(Self::Require32Bytes), - "REQUIRE_64_BYTES" => Some(Self::Require64Bytes), - _ => None, - } - } -} diff --git a/src/protobuf/mod.rs b/src/protobuf/mod.rs index a6f10a42..59d51291 100644 --- a/src/protobuf/mod.rs +++ b/src/protobuf/mod.rs @@ -58,6 +58,8 @@ mod erased; mod error; +#[allow(unused_imports)] +use alloc::boxed::Box; use alloc::string::String; use alloc::vec::Vec; use core::fmt::Display; diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index 481d0171..b26be45d 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -113,15 +113,21 @@ impl CompileCmd { // List available paths for dependencies let includes: Vec = proto_includes_paths.iter().map(PathBuf::from).collect(); - let attrs_serde = r#"#[derive(::serde::Serialize, ::serde::Deserialize)]"#; - let attrs_jsonschema = - r#"#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))]"#; + // We can only enable JSON serialization when the `std` feature is enabled, + // as it is currently required by `ics23` for it to implement JSON serialization + // let attrs_serde = r#"#[derive(::serde::Serialize, ::serde::Deserialize)]"#; + // let attrs_serde_default = r#"#[serde(default)]"#; + // let attrs_jsonschema = + // r#"#[cfg_attr(feature = "json-schema", derive(::schemars::JsonSchema))]"#; + + let attrs_jsonschema = r#"#[cfg_attr(all(feature = "json-schema", feature = "std"), derive(::schemars::JsonSchema))]"#; let attrs_ord = "#[derive(Eq, PartialOrd, Ord)]"; let attrs_eq = "#[derive(Eq)]"; - let attrs_serde_default = r#"#[serde(default)]"#; - let attrs_serde_base64 = r#"#[serde(with = "crate::base64")]"#; - let attrs_jsonschema_str = - r#"#[cfg_attr(feature = "json-schema", schemars(with = "String"))]"#; + let attrs_serde = + r#"#[cfg_attr(feature = "std", derive(::serde::Serialize, ::serde::Deserialize))]"#; + let attrs_serde_default = r#"#[cfg_attr(feature = "std", serde(default))]"#; + let attrs_serde_base64 = r#"#[cfg_attr(feature = "std", serde(with = "crate::base64"))]"#; + let attrs_jsonschema_str = r#"#[cfg_attr(all(feature = "json-schema", feature = "std"), schemars(with = "String"))]"#; tonic_build::configure() .build_client(true) @@ -131,6 +137,7 @@ impl CompileCmd { .server_mod_attribute(".", r#"#[cfg(feature = "server")]"#) .out_dir(out_dir) .extern_path(".tendermint", "::tendermint_proto") + .extern_path(".ics23", "::ics23") .type_attribute(".google.protobuf.Any", attrs_serde) .type_attribute(".google.protobuf.Any", attrs_eq) .type_attribute(".google.protobuf.Timestamp", attrs_serde) @@ -173,27 +180,6 @@ impl CompileCmd { ".ibc.applications.interchain_accounts.controller.v1", attrs_serde, ) - .type_attribute(".ics23", attrs_serde) - .type_attribute(".ics23.LeafOp", attrs_eq) - .type_attribute(".ics23.LeafOp", attrs_jsonschema) - .field_attribute(".ics23.LeafOp.prehash_key", attrs_serde_default) - .field_attribute(".ics23.LeafOp.prefix", attrs_serde_base64) - .field_attribute(".ics23.LeafOp.prefix", attrs_jsonschema_str) - .type_attribute(".ics23.InnerOp", attrs_jsonschema) - .field_attribute(".ics23.InnerOp.prefix", attrs_serde_base64) - .field_attribute(".ics23.InnerOp.prefix", attrs_jsonschema_str) - .field_attribute(".ics23.InnerOp.suffix", attrs_serde_base64) - .field_attribute(".ics23.InnerOp.suffix", attrs_jsonschema_str) - .type_attribute(".ics23.InnerOp", attrs_eq) - .type_attribute(".ics23.ProofSpec", attrs_eq) - .type_attribute(".ics23.ProofSpec", attrs_jsonschema) - .field_attribute(".ics23.ProofSpec.max_depth", attrs_serde_default) - .field_attribute(".ics23.ProofSpec.min_depth", attrs_serde_default) - .type_attribute(".ics23.InnerSpec", attrs_eq) - .type_attribute(".ics23.InnerSpec", attrs_jsonschema) - .field_attribute(".ics23.InnerSpec.empty_child", attrs_serde_default) - .field_attribute(".ics23.InnerSpec.empty_child", attrs_serde_base64) - .field_attribute(".ics23.InnerSpec.empty_child", attrs_jsonschema_str) .type_attribute(".cosmos.upgrade.v1beta1", attrs_serde) .type_attribute(".cosmos.base.v1beta1", attrs_serde) .type_attribute(".cosmos.base.query.v1beta1", attrs_serde)