Skip to content

Commit

Permalink
improve grammar in ICQ docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sotnikov-s committed Nov 25, 2024
1 parent d57db4a commit eb2ec60
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 126 deletions.
14 changes: 8 additions & 6 deletions proto/neutron/interchainqueries/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types

// Defines the Query interface of the module.
service Query {
// Queries the current parameters of the module.
// Fetches the current parameters of the interchainqueries module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/neutron/interchainqueries/params";
}
// Queries all the registered Interchain Queries in the module with filtration by owner and/or
// connection ID.
// Retrieves all registered Interchain Queries in the module, with optional filtering by owner
// and/or connection ID.
rpc RegisteredQueries(QueryRegisteredQueriesRequest) returns (QueryRegisteredQueriesResponse) {
option (google.api.http).get = "/neutron/interchainqueries/registered_queries";
}
// Queries a registered Interchain Query by ID.
// Fetches details of a registered Interchain Query using its ID.
rpc RegisteredQuery(QueryRegisteredQueryRequest) returns (QueryRegisteredQueryResponse) {
option (google.api.http).get = "/neutron/interchainqueries/registered_query";
}
// Queries the last successfully submitted result of an Interchain Query.
// Retrieves the most recent successfully submitted result of an Interchain Query. This is only
// applicable for KV Interchain Queries.
rpc QueryResult(QueryRegisteredQueryResultRequest) returns (QueryRegisteredQueryResultResponse) {
option (google.api.http).get = "/neutron/interchainqueries/query_result";
}
// Queries the last height of a remote chain known to the IBC client behind a given connection ID.
// Retrieves the most recent height of a remote chain as known by the IBC client associated with
// a given connection ID.
rpc LastRemoteHeight(QueryLastRemoteHeight) returns (QueryLastRemoteHeightResponse) {
option (google.api.http).get = "/neutron/interchainqueries/remote_height";
}
Expand Down
32 changes: 17 additions & 15 deletions proto/neutron/interchainqueries/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ option go_package = "github.com/neutron-org/neutron/v5/x/interchainqueries/types
// Defines the Msg interface of the module.
service Msg {
option (cosmos.msg.v1.service) = true;
// Registers a new Interchain Query in the interchainqueries module. This message is supposed to
// be issued only by a smart contract. The caller contract is charged a query registration deposit
// automatically in the amount defined as the module's query deposit parameter. The deposit is
// paid back on the query removal. Make sure to have enough assets on the contract's account
// at the time of the message execution.
// Registers a new Interchain Query in the `interchainqueries` module. This message should only
// be issued by a smart contract. The calling contract is automatically charged a query
// registration deposit, based on the module's query deposit parameter. The deposit is refunded
// when the query is removed. Ensure the contract's account has sufficient assets at the time of
// message execution.
//
// Returns an ID assigned to the registered query. Handle this message response via a reply
// handler in order to make use of the ID.
// The response includes the ID assigned to the registered query. Use a reply handler to process
// this response and utilize the query ID.
rpc RegisterInterchainQuery(MsgRegisterInterchainQuery) returns (MsgRegisterInterchainQueryResponse);
// Submits a result of an Interchain Query execution to the chain. This message handling may
// include passing of the result to the query's owner smart contract for processing which might
// be a pretty gas-consumable operation.
// Submits the result of an Interchain Query execution to the chain. Handling this message may
// involve forwarding the result to the smart contract that owns the query for processing, which
// could require significant gas usage.
rpc SubmitQueryResult(MsgSubmitQueryResult) returns (MsgSubmitQueryResultResponse);
// Removes a given Interchain Query and its results from the module. Can be removed only by the
// owner of the query during the query's submit timeout, and by anyone after the query has been
// timed out. The query deposit is returned to the caller on a success call.
// Removes a specific Interchain Query and its results from the module. The query can only be
// removed by its owner during the query's submit timeout. After the timeout, anyone can remove
// it. Upon successful removal, the query deposit is refunded to the caller.
rpc RemoveInterchainQuery(MsgRemoveInterchainQueryRequest) returns (MsgRemoveInterchainQueryResponse);
// Updates parameters of a registered Interchain Query. Only callable by the owner of the query.
// Updates the parameters of a registered Interchain Query. This action can only be performed by
// the query's owner.
rpc UpdateInterchainQuery(MsgUpdateInterchainQueryRequest) returns (MsgUpdateInterchainQueryResponse);
// Updates params of the interchainqueries module. Only callable by the module's authority.
// Updates the parameters of the `interchainqueries` module. This action can only be performed
// by the module's authority.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

Expand Down
25 changes: 12 additions & 13 deletions x/contractmanager/types/sudo.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
)

// MessageTxQueryResult is the model of the sudo message sent to a smart contract on a TX
// Interchain Query result submission. The owner of a TX Interchain Query must define a `sudo`
// entry_point for handling `tx_query_result` messages and place the needed logic there.
// The `tx_query_result` handler is treated by the interchainqueries module as a callback that is
// called each time a TX query result is submitted.
// MessageTxQueryResult is the model of the `sudo` message sent to a smart contract when a TX
// Interchain Query result is submitted. The owner of a TX Interchain Query must implement a `sudo`
// entry point to handle `tx_query_result` messages and include the necessary logic in it. The
// `tx_query_result` handler functions as a callback, triggered by the `interchainqueries` module
// each time a TX query result is submitted.
type MessageTxQueryResult struct {
TxQueryResult struct {
// QueryID is the ID of the TX query which result is being submitted.
Expand All @@ -21,15 +21,14 @@ type MessageTxQueryResult struct {
} `json:"tx_query_result"`
}

// MessageKVQueryResult is the model of the sudo message sent to a smart contract on a KV
// Interchain Query result submission. If the owner of a KV Interchain Query wants to handle the
// query updates, it must define a `sudo` entry_point for handling `kv_query_result` messages
// and place the needed logic there. The `kv_query_result` handler is treated by the
// interchainqueries module as a callback that is called each time a KV query result is
// submitted.
// MessageKvQueryResult is the model of the `sudo` message sent to a smart contract when a KV
// Interchain Query result is submitted. If the owner of a KV Interchain Query wants to handle
// updates, they must implement a `sudo` entry point to process `kv_query_result` messages and
// include the necessary logic in it. The `kv_query_result` handler acts as a callback, triggered
// by the interchainqueries module whenever a KV query result is submitted.
//
// Note that there is no query result sent, only the query ID. In order to access the actual
// result, use the Query/QueryResult RPC of the interchainqueries module.
// Note that the message does not include the actual query result, only the query ID. To access the
// result data, use the `Query/QueryResult` RPC of the `interchainqueries` module.
type MessageKVQueryResult struct {
KVQueryResult struct {
// QueryID is the ID of the KV query which result is being submitted.
Expand Down
Loading

0 comments on commit eb2ec60

Please sign in to comment.