From d9cdea37d05be626f33b3f28438f575fbc0b46ae Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Fri, 15 Nov 2024 13:12:07 +0200 Subject: [PATCH 1/2] icq docs codfe --- packages/neutron-std/src/types/NEUTRON_COMMIT | 2 +- .../src/types/neutron/interchainqueries.rs | 272 +++++++++++------- proto-build/src/main.rs | 2 +- 3 files changed, 165 insertions(+), 111 deletions(-) diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index 8eb3891..6022294 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -v5.0.0 \ No newline at end of file +feat/refactor-icq-module-documentation \ No newline at end of file diff --git a/packages/neutron-std/src/types/neutron/interchainqueries.rs b/packages/neutron-std/src/types/neutron/interchainqueries.rs index bcd9487..cbf1038 100644 --- a/packages/neutron-std/src/types/neutron/interchainqueries.rs +++ b/packages/neutron-std/src/types/neutron/interchainqueries.rs @@ -1,5 +1,5 @@ use neutron_std_derive::CosmwasmExt; -/// Params defines the parameters for the module. +/// The parameters for the module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -13,20 +13,19 @@ use neutron_std_derive::CosmwasmExt; )] #[proto_message(type_url = "/neutron.interchainqueries.Params")] pub struct Params { - /// Defines amount of blocks required before query becomes available for - /// removal by anybody + /// The amount of blocks required to pass since an Interchain Query registration/update for the + /// query to become available for removal by anybody. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub query_submit_timeout: u64, - /// Amount of coins deposited for the query. + /// Amount of coins required to be provided as deposit on Interchain Query registration. #[prost(message, repeated, tag = "2")] pub query_deposit: ::prost::alloc::vec::Vec, - /// Amount of tx hashes to be removed during a single EndBlock. Can vary to - /// balance between network cleaning speed and EndBlock duration. A zero value - /// means no limit. + /// Amount of tx hashes to be removed during a single EndBlock. Can vary to balance between + /// network cleaning speed and EndBlock duration. A zero value means no limit. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -48,6 +47,7 @@ pub struct Params { )] pub max_transactions_filters: u64, } +/// Information about an Interchain Query registered in the interchainqueries module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -69,51 +69,60 @@ pub struct RegisteredQuery { deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, - /// The address that registered the query. + /// The address of the contract that registered the query. #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, - /// The query type identifier: `kv` or `tx` now + /// The query type identifier: `kv` or `tx`. #[prost(string, tag = "3")] pub query_type: ::prost::alloc::string::String, - /// The KV-storage keys for which we want to get values from remote chain + /// The KV-storage keys for which to get values from the remote chain. Only applicable for the + /// KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + /// parameters. #[prost(message, repeated, tag = "4")] pub keys: ::prost::alloc::vec::Vec, - /// The filter for transaction search ICQ + /// A stringified list of filters for remote transactions search. Only applicable for the TX + /// Interchain Queries. Example: "\[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}\]". + /// Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is limited + /// by the module's `max_transactions_filters` parameters. #[prost(string, tag = "5")] pub transactions_filter: ::prost::alloc::string::String, - /// The IBC connection ID for getting ConsensusState to verify proofs + /// The IBC connection ID to the remote chain (the source of querying data). Is used for getting + /// ConsensusState from the respective IBC client to verify query result proofs. #[prost(string, tag = "6")] #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, - /// Parameter that defines how often the query must be updated. + /// Parameter that defines the minimal delay between consecutive query executions (i.e. the + /// minimal delay between query results update). #[prost(uint64, tag = "7")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub update_period: u64, - /// The local chain last block height when the query result was updated. + /// The local chain block height of the last query results update. #[prost(uint64, tag = "8")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub last_submitted_result_local_height: u64, - /// The remote chain last block height when the query result was updated. + /// The remote chain block height that corresponds to the last query result update. #[prost(message, optional, tag = "9")] pub last_submitted_result_remote_height: ::core::option::Option, - /// Amount of coins deposited for the query. + /// Amount of coins paid for the Interchain Query registration. The deposit is paid back to the + /// remover. The remover can be either the query owner (during the submit timeout) or anybody. #[prost(message, repeated, tag = "10")] pub deposit: ::prost::alloc::vec::Vec, - /// Timeout before query becomes available for everybody to remove. + /// Duration in blocks that is required to pass since the query registration/update for the + /// query to become available for anybody to be removed. #[prost(uint64, tag = "11")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub submit_timeout: u64, - /// The local chain height when the query was registered. + /// The local chain block height of the Interchain Query registration. #[prost(uint64, tag = "12")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -121,6 +130,7 @@ pub struct RegisteredQuery { )] pub registered_at_height: u64, } +/// A path to an IAVL storage node. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -134,11 +144,11 @@ pub struct RegisteredQuery { )] #[proto_message(type_url = "/neutron.interchainqueries.KVKey")] pub struct KvKey { - /// Path (storage prefix) to the storage where you want to read value by key - /// (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + /// The first half of the storage path. It is supposed to be a substore name for the query + /// (e.g. bank, staking, etc.). #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, - /// Key you want to read from the storage + /// The second half of the storage path. The remaining part of the full path to an IAVL storage node. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -146,7 +156,7 @@ pub struct KvKey { )] pub key: ::prost::alloc::vec::Vec, } -/// GenesisState defines the interchainqueries module's genesis state. +/// The interchainqueries module's genesis state model. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -160,11 +170,14 @@ pub struct KvKey { )] #[proto_message(type_url = "/neutron.interchainqueries.GenesisState")] pub struct GenesisState { + /// The parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, + /// A list of registered Interchain Queries. #[prost(message, repeated, tag = "2")] pub registered_queries: ::prost::alloc::vec::Vec, } +/// Request type for the Msg/RegisterInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -178,31 +191,38 @@ pub struct GenesisState { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgRegisterInterchainQuery")] pub struct MsgRegisterInterchainQuery { - /// defines a query type: `kv` or `tx` now + /// The query type identifier: `kv` or `tx`. #[prost(string, tag = "1")] pub query_type: ::prost::alloc::string::String, - /// is used to define KV-storage keys for which we want to get values from - /// remote chain + /// The KV-storage keys for which we want to get values from remote chain. Only applicable for the + /// KV Interchain Queries. Max amount of keys is limited by the module's `max_kv_query_keys_count` + /// parameters. #[prost(message, repeated, tag = "2")] pub keys: ::prost::alloc::vec::Vec, - /// is used to define a filter for transaction search ICQ + /// A stringified list of filters for remote transactions search. Only applicable for the TX + /// Interchain Queries. Example: "\[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}\]". + /// Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + /// limited by the module's `max_transactions_filters` parameters. #[prost(string, tag = "3")] pub transactions_filter: ::prost::alloc::string::String, - /// is IBC connection ID for getting ConsensusState to verify proofs + /// The IBC connection ID to the remote chain (the source of querying data). Is used for getting + /// ConsensusState from the respective IBC client to verify query result proofs. #[prost(string, tag = "4")] #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, - /// is used to specify how often (in neutron blocks) the query must be updated + /// Parameter that defines the minimal delay between consecutive query executions (i.e. the + /// minimal delay between query results update). #[prost(uint64, tag = "5")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub update_period: u64, - /// is the signer of the message + /// The signer of the message. #[prost(string, tag = "6")] pub sender: ::prost::alloc::string::String, } +/// Response type for the Msg/RegisterInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -216,6 +236,7 @@ pub struct MsgRegisterInterchainQuery { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgRegisterInterchainQueryResponse")] pub struct MsgRegisterInterchainQueryResponse { + /// The ID assigned to the registered Interchain Query by the module. #[prost(uint64, tag = "1")] #[serde(alias = "ID")] #[serde( @@ -224,6 +245,7 @@ pub struct MsgRegisterInterchainQueryResponse { )] pub id: u64, } +/// Request type for the Msg/SubmitQueryResult RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -237,6 +259,7 @@ pub struct MsgRegisterInterchainQueryResponse { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgSubmitQueryResult")] pub struct MsgSubmitQueryResult { + /// The ID of the Interchain Query. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] #[serde( @@ -244,18 +267,27 @@ pub struct MsgSubmitQueryResult { deserialize_with = "crate::serde::as_str::deserialize" )] pub query_id: u64, + /// The signer of the message. #[prost(string, tag = "2")] pub sender: ::prost::alloc::string::String, - /// is the IBC client ID for an IBC connection between Neutron chain and target - /// chain (where the result was obtained from) + /// The IBC client ID that corresponds to the IBC connection to the remote chain (where the + /// query result is coming from). /// Deprecated: populating this field does not make any affect #[deprecated] #[prost(string, tag = "3")] #[serde(alias = "clientID")] pub client_id: ::prost::alloc::string::String, + /// The result of the Interchain Query execution. #[prost(message, optional, tag = "4")] pub result: ::core::option::Option, } +/// Contains different information about a single Interchain Query execution result. Currently, +/// this structure is used both in query result submission via an ICQ Relayer and as a query result +/// storage for read/write operations to interchainqueries module, but the structure fields are +/// populated in a bit different ways. When submitting a query result, all fields are populated and +/// provided to the interchainqueries module in order to verify the result against the IBC client's +/// state. But in order to lighten the chain state, the interchainqueries module removes the block +/// field and proofs from the kv_results. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -269,25 +301,35 @@ pub struct MsgSubmitQueryResult { )] #[proto_message(type_url = "/neutron.interchainqueries.QueryResult")] pub struct QueryResult { + /// A list of a KV Interchain Query execution results. Each result contains query parameters, a + /// response value and a proof. #[prost(message, repeated, tag = "1")] pub kv_results: ::prost::alloc::vec::Vec, + /// A TX Interchain Query execution result. Contains metainformation about the blocks of the query + /// execution height. Only populated when submitting an Interchain Query result for verification + /// and emptied when saving the result on chain. #[prost(message, optional, tag = "2")] pub block: ::core::option::Option, + /// The height of the chain at the moment of the Interchain Query execution. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub height: u64, + /// The revision number of the chain at the moment of the Interchain Query execution. #[prost(uint64, tag = "4")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub revision: u64, + /// Whether to send the query result to the owner contract as a sudo message. Only applicable for + /// KV type of Interchain Queries. #[prost(bool, tag = "5")] pub allow_kv_callbacks: bool, } +/// A verifiable result of performing a single KVKey read. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -301,28 +343,30 @@ pub struct QueryResult { )] #[proto_message(type_url = "/neutron.interchainqueries.StorageValue")] pub struct StorageValue { - /// is the substore name (acc, staking, etc.) + /// The first half of the storage path. It is supposed to be a substore name for the query + /// (e.g. bank, staking, etc.). #[prost(string, tag = "1")] pub storage_prefix: ::prost::alloc::string::String, - /// is the key in IAVL store + /// The second half of the storage path. The remaining part of the full path to an IAVL storage node. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub key: ::prost::alloc::vec::Vec, - /// is the value in IAVL store + /// A base64-encoded value read from the given storage path. #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub value: ::prost::alloc::vec::Vec, - /// is the Merkle Proof which proves existence of key-value pair in IAVL - /// storage + /// The Merkle Proof which proves existence of key-value pair in IAVL storage. Is used to verify + /// the pair against the respective remote chain's header. #[prost(message, optional, tag = "4")] pub proof: ::core::option::Option, } +/// A single verifiable result of an Interchain Query of TX type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -336,17 +380,20 @@ pub struct StorageValue { )] #[proto_message(type_url = "/neutron.interchainqueries.Block")] pub struct Block { - /// We need to know block X+1 to verify response of transaction for block X - /// since LastResultsHash is root hash of all results from the txs from the - /// previous block + /// The header of the block next to the block the transaction is included in. It is needed to know + /// block X+1 header to verify response of transaction for block X since LastResultsHash is root + /// hash of all results of the txs from the previous block. #[prost(message, optional, tag = "1")] pub next_block_header: ::core::option::Option, - /// We need to know block X to verify inclusion of transaction for block X + /// The header of the block the transaction is included in. It is needed to know block header to + /// verify inclusion of the transaction. #[prost(message, optional, tag = "2")] pub header: ::core::option::Option, + /// The transaction matched by the Interchain Query's transaction filter. #[prost(message, optional, tag = "3")] pub tx: ::core::option::Option, } +/// Contains transaction body, response, and proofs of inclusion and delivery. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -360,17 +407,17 @@ pub struct Block { )] #[proto_message(type_url = "/neutron.interchainqueries.TxValue")] pub struct TxValue { + /// The result of the transaction execution. #[prost(message, optional, tag = "1")] pub response: ::core::option::Option, - /// is the Merkle Proof which proves existence of response in block with height - /// next_block_header.Height + /// The Merkle Proof which proves existence of response in the block next to the block the + /// transaction is included in. #[prost(message, optional, tag = "2")] pub delivery_proof: ::core::option::Option, - /// is the Merkle Proof which proves existence of data in block with height - /// header.Height + /// The Merkle Proof which proves inclusion of the transaction in the block. #[prost(message, optional, tag = "3")] pub inclusion_proof: ::core::option::Option, - /// is body of the transaction + /// The arbitrary data typed body of the transaction. #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -378,6 +425,7 @@ pub struct TxValue { )] pub data: ::prost::alloc::vec::Vec, } +/// Response type for the Msg/SubmitQueryResult RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -391,6 +439,7 @@ pub struct TxValue { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgSubmitQueryResultResponse")] pub struct MsgSubmitQueryResultResponse {} +/// Request type for the Msg/RemoveInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -402,8 +451,9 @@ pub struct MsgSubmitQueryResultResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.MsgRemoveInterchainQueryRequest")] -pub struct MsgRemoveInterchainQueryRequest { +#[proto_message(type_url = "/neutron.interchainqueries.MsgRemoveInterchainQuery")] +pub struct MsgRemoveInterchainQuery { + /// The ID of the query to remove. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] #[serde( @@ -411,10 +461,11 @@ pub struct MsgRemoveInterchainQueryRequest { deserialize_with = "crate::serde::as_str::deserialize" )] pub query_id: u64, - /// is the signer of the message + /// The signer of the message. #[prost(string, tag = "2")] pub sender: ::prost::alloc::string::String, } +/// Response type for the Msg/RemoveInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -428,6 +479,7 @@ pub struct MsgRemoveInterchainQueryRequest { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgRemoveInterchainQueryResponse")] pub struct MsgRemoveInterchainQueryResponse {} +/// Request type for the Msg/UpdateInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -439,8 +491,9 @@ pub struct MsgRemoveInterchainQueryResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateInterchainQueryRequest")] -pub struct MsgUpdateInterchainQueryRequest { +#[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateInterchainQuery")] +pub struct MsgUpdateInterchainQuery { + /// The ID of the query to update. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] #[serde( @@ -448,20 +501,29 @@ pub struct MsgUpdateInterchainQueryRequest { deserialize_with = "crate::serde::as_str::deserialize" )] pub query_id: u64, + /// A new list of KV-storage keys for which to get values from the remote chain. Only applicable + /// for a KV Interchain Query. Max amount of keys is limited by the module's `max_kv_query_keys_count` + /// parameters. #[prost(message, repeated, tag = "2")] pub new_keys: ::prost::alloc::vec::Vec, + /// A new minimal delay between consecutive query executions. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub new_update_period: u64, + /// A new list of filters for remote transactions search. Only applicable for a TX Interchain + /// Query. Example: "\[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}\]". + /// Supported operators: "eq", "lt", "gt", "lte", "gte". Max amount of filter conditions is + /// limited by the module's `max_transactions_filters` parameters. #[prost(string, tag = "4")] pub new_transactions_filter: ::prost::alloc::string::String, - /// is the signer of the message + /// The signer of the message. #[prost(string, tag = "5")] pub sender: ::prost::alloc::string::String, } +/// Response type for the Msg/UpdateInterchainQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -475,9 +537,7 @@ pub struct MsgUpdateInterchainQueryRequest { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateInterchainQueryResponse")] pub struct MsgUpdateInterchainQueryResponse {} -/// MsgUpdateParams is the MsgUpdateParams request type. -/// -/// Since: 0.47 +/// Request type for the Msg/UpdateParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -491,19 +551,14 @@ pub struct MsgUpdateInterchainQueryResponse {} )] #[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateParams")] pub struct MsgUpdateParams { - /// Authority is the address of the governance account. + /// The address of the authority of the module. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, - /// params defines the x/interchainqueries parameters to update. - /// - /// NOTE: All parameters must be supplied. + /// The new parameters of the module. All parameters must be supplied. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: 0.47 +/// Response type for the Msg/UpdateParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -517,7 +572,7 @@ pub struct MsgUpdateParams { )] #[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateParamsResponse")] pub struct MsgUpdateParamsResponse {} -/// QueryParamsRequest is request type for the Query/Params RPC method. +/// Request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -535,7 +590,7 @@ pub struct MsgUpdateParamsResponse {} response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} -/// QueryParamsResponse is response type for the Query/Params RPC method. +/// Response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -549,10 +604,11 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/neutron.interchainqueries.QueryParamsResponse")] pub struct QueryParamsResponse { - /// params holds all the parameters of this module. + /// Stores all parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// Request type for the Query/RegisteredQueries RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -570,14 +626,23 @@ pub struct QueryParamsResponse { response_type = QueryRegisteredQueriesResponse )] pub struct QueryRegisteredQueriesRequest { + /// A list of owners of Interchain Queries. Query response will contain only Interchain Queries + /// that are owned by one of the owners in the list. If none, Interchain Queries are not filtered + /// out by the owner field. #[prost(string, repeated, tag = "1")] pub owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// IBC connection ID. Query response will contain only Interchain Queries that have the same IBC + /// connection ID parameter. If none, Interchain Queries are not filtered out by the connection ID + /// field. #[prost(string, tag = "2")] #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, + /// Pagination parameters for the request. Use values from previous response in the next request + /// in consecutive requests with paginated responses. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// Response type for the Query/RegisteredQueries RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -591,13 +656,16 @@ pub struct QueryRegisteredQueriesRequest { )] #[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueriesResponse")] pub struct QueryRegisteredQueriesResponse { + /// A list of registered Interchain Queries. #[prost(message, repeated, tag = "1")] pub registered_queries: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. + /// Current page information. Use values from previous response in the next request in consecutive + /// requests with paginated responses. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// Request type for the Query/RegisteredQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -615,6 +683,7 @@ pub struct QueryRegisteredQueriesResponse { response_type = QueryRegisteredQueryResponse )] pub struct QueryRegisteredQueryRequest { + /// ID of an Interchain Query. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] #[serde( @@ -623,6 +692,7 @@ pub struct QueryRegisteredQueryRequest { )] pub query_id: u64, } +/// Response type for the Query/RegisteredQuery RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -636,9 +706,11 @@ pub struct QueryRegisteredQueryRequest { )] #[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueryResponse")] pub struct QueryRegisteredQueryResponse { + /// A registered Interchain Query. #[prost(message, optional, tag = "1")] pub registered_query: ::core::option::Option, } +/// Request type for the Query/QueryResult RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -650,12 +722,13 @@ pub struct QueryRegisteredQueryResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueryResultRequest")] +#[proto_message(type_url = "/neutron.interchainqueries.QueryQueryResultRequest")] #[proto_query( path = "/neutron.interchainqueries.Query/QueryResult", - response_type = QueryRegisteredQueryResultResponse + response_type = QueryQueryResultResponse )] -pub struct QueryRegisteredQueryResultRequest { +pub struct QueryQueryResultRequest { + /// ID of an Interchain Query. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] #[serde( @@ -664,6 +737,7 @@ pub struct QueryRegisteredQueryResultRequest { )] pub query_id: u64, } +/// Response type for the Query/QueryResult RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -675,11 +749,13 @@ pub struct QueryRegisteredQueryResultRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueryResultResponse")] -pub struct QueryRegisteredQueryResultResponse { +#[proto_message(type_url = "/neutron.interchainqueries.QueryQueryResultResponse")] +pub struct QueryQueryResultResponse { + /// The last successfully submitted result of an Interchain Query. #[prost(message, optional, tag = "1")] pub result: ::core::option::Option, } +/// Request type for the Query/LastRemoteHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -691,49 +767,19 @@ pub struct QueryRegisteredQueryResultResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.Transaction")] -pub struct Transaction { - #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub id: u64, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: u64, - #[prost(bytes = "vec", tag = "3")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/neutron.interchainqueries.QueryLastRemoteHeight")] +#[proto_message(type_url = "/neutron.interchainqueries.QueryLastRemoteHeightRequest")] #[proto_query( path = "/neutron.interchainqueries.Query/LastRemoteHeight", response_type = QueryLastRemoteHeightResponse )] -pub struct QueryLastRemoteHeight { +pub struct QueryLastRemoteHeightRequest { + /// Connection ID of an IBC connection to a remote chain. Determines the IBC client used in query + /// handling. #[prost(string, tag = "1")] #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, } +/// Response type for the Query/LastRemoteHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -747,12 +793,20 @@ pub struct QueryLastRemoteHeight { )] #[proto_message(type_url = "/neutron.interchainqueries.QueryLastRemoteHeightResponse")] pub struct QueryLastRemoteHeightResponse { + /// The height of the chain that the IBC client is currently on. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub height: u64, + /// The revision of the chain that the IBC client is currently on. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision: u64, } pub struct InterchainqueriesQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, @@ -786,13 +840,13 @@ impl<'a, Q: cosmwasm_std::CustomQuery> InterchainqueriesQuerier<'a, Q> { pub fn query_result( &self, query_id: u64, - ) -> Result { - QueryRegisteredQueryResultRequest { query_id }.query(self.querier) + ) -> Result { + QueryQueryResultRequest { query_id }.query(self.querier) } pub fn last_remote_height( &self, connection_id: ::prost::alloc::string::String, ) -> Result { - QueryLastRemoteHeight { connection_id }.query(self.querier) + QueryLastRemoteHeightRequest { connection_id }.query(self.querier) } } diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index af7afdf..e28f9f9 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -24,7 +24,7 @@ const ADMIN_MODULE_REPO: &str = "https://github.com/neutron-org/admin-module.git const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "v5.0.0"; +const NEUTRON_REV: &str = "feat/refactor-icq-module-documentation"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron"; From c934c8ea2edae8e8e41cbe5e8591d80e9f6d36a3 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Mon, 18 Nov 2024 14:15:05 +0200 Subject: [PATCH 2/2] regen --- .../src/types/neutron/interchainqueries.rs | 61 ++++++++++++++----- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/packages/neutron-std/src/types/neutron/interchainqueries.rs b/packages/neutron-std/src/types/neutron/interchainqueries.rs index cbf1038..4caac8d 100644 --- a/packages/neutron-std/src/types/neutron/interchainqueries.rs +++ b/packages/neutron-std/src/types/neutron/interchainqueries.rs @@ -451,8 +451,8 @@ pub struct MsgSubmitQueryResultResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.MsgRemoveInterchainQuery")] -pub struct MsgRemoveInterchainQuery { +#[proto_message(type_url = "/neutron.interchainqueries.MsgRemoveInterchainQueryRequest")] +pub struct MsgRemoveInterchainQueryRequest { /// The ID of the query to remove. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] @@ -491,8 +491,8 @@ pub struct MsgRemoveInterchainQueryResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateInterchainQuery")] -pub struct MsgUpdateInterchainQuery { +#[proto_message(type_url = "/neutron.interchainqueries.MsgUpdateInterchainQueryRequest")] +pub struct MsgUpdateInterchainQueryRequest { /// The ID of the query to update. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] @@ -722,12 +722,12 @@ pub struct QueryRegisteredQueryResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.QueryQueryResultRequest")] +#[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueryResultRequest")] #[proto_query( path = "/neutron.interchainqueries.Query/QueryResult", - response_type = QueryQueryResultResponse + response_type = QueryRegisteredQueryResultResponse )] -pub struct QueryQueryResultRequest { +pub struct QueryRegisteredQueryResultRequest { /// ID of an Interchain Query. #[prost(uint64, tag = "1")] #[serde(alias = "queryID")] @@ -749,12 +749,45 @@ pub struct QueryQueryResultRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.QueryQueryResultResponse")] -pub struct QueryQueryResultResponse { +#[proto_message(type_url = "/neutron.interchainqueries.QueryRegisteredQueryResultResponse")] +pub struct QueryRegisteredQueryResultResponse { /// The last successfully submitted result of an Interchain Query. #[prost(message, optional, tag = "1")] pub result: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.interchainqueries.Transaction")] +pub struct Transaction { + #[prost(uint64, tag = "1")] + #[serde(alias = "ID")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} /// Request type for the Query/LastRemoteHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -767,12 +800,12 @@ pub struct QueryQueryResultResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/neutron.interchainqueries.QueryLastRemoteHeightRequest")] +#[proto_message(type_url = "/neutron.interchainqueries.QueryLastRemoteHeight")] #[proto_query( path = "/neutron.interchainqueries.Query/LastRemoteHeight", response_type = QueryLastRemoteHeightResponse )] -pub struct QueryLastRemoteHeightRequest { +pub struct QueryLastRemoteHeight { /// Connection ID of an IBC connection to a remote chain. Determines the IBC client used in query /// handling. #[prost(string, tag = "1")] @@ -840,13 +873,13 @@ impl<'a, Q: cosmwasm_std::CustomQuery> InterchainqueriesQuerier<'a, Q> { pub fn query_result( &self, query_id: u64, - ) -> Result { - QueryQueryResultRequest { query_id }.query(self.querier) + ) -> Result { + QueryRegisteredQueryResultRequest { query_id }.query(self.querier) } pub fn last_remote_height( &self, connection_id: ::prost::alloc::string::String, ) -> Result { - QueryLastRemoteHeightRequest { connection_id }.query(self.querier) + QueryLastRemoteHeight { connection_id }.query(self.querier) } }