Skip to content

Commit

Permalink
uniform ICQ module msg request type names
Browse files Browse the repository at this point in the history
  • Loading branch information
sotnikov-s committed Nov 14, 2024
1 parent 2264e95 commit 0464849
Show file tree
Hide file tree
Showing 15 changed files with 419 additions and 410 deletions.
2 changes: 1 addition & 1 deletion app/proposals_allowlisting.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func isSdkMessageWhitelisted(msg sdk.Msg) bool {
*ibcclienttypes.MsgRecoverClient,
*ibcclienttypes.MsgIBCSoftwareUpgrade,
*tokenfactorytypes.MsgUpdateParams,
*interchainqueriestypes.MsgUpdateParamsRequest,
*interchainqueriestypes.MsgUpdateParams,
*interchaintxstypes.MsgUpdateParams,
*feeburnertypes.MsgUpdateParams,
*feerefundertypes.MsgUpdateParams,
Expand Down
2 changes: 1 addition & 1 deletion proto/neutron/interchainqueries/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ message RegisteredQuery {
string query_type = 3;
// 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.
// parameters.
repeated KVKey keys = 4;
// A stringified list of filters for remote transactions search. Only applicable for the TX
// Interchain Queries. Example: "[{\"field\":\"tx.height\",\"op\":\"Gte\",\"value\":2644737}]".
Expand Down
22 changes: 11 additions & 11 deletions proto/neutron/interchainqueries/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ service Msg {
//
// Returns an ID assigned to the registered query. Handle this message response via a reply
// handler in order to make use of the ID.
rpc RegisterInterchainQuery(MsgRegisterInterchainQueryRequest) returns (MsgRegisterInterchainQueryResponse);
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.
rpc SubmitQueryResult(MsgSubmitQueryResultRequest) returns (MsgSubmitQueryResultResponse);
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.
rpc RemoveInterchainQuery(MsgRemoveInterchainQueryRequest) returns (MsgRemoveInterchainQueryResponse);
rpc RemoveInterchainQuery(MsgRemoveInterchainQuery) returns (MsgRemoveInterchainQueryResponse);
// Updates parameters of a registered Interchain Query. Only callable by the owner of the query.
rpc UpdateInterchainQuery(MsgUpdateInterchainQueryRequest) returns (MsgUpdateInterchainQueryResponse);
rpc UpdateInterchainQuery(MsgUpdateInterchainQuery) returns (MsgUpdateInterchainQueryResponse);
// Updates params of the interchainqueries module. Only callable by the module's authority.
rpc UpdateParams(MsgUpdateParamsRequest) returns (MsgUpdateParamsResponse);
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

// Request type for the Msg/RegisterInterchainQuery RPC method.
message MsgRegisterInterchainQueryRequest {
message MsgRegisterInterchainQuery {
option (cosmos.msg.v1.signer) = "sender";
// The query type identifier: `kv` or `tx`.
string query_type = 1;
Expand Down Expand Up @@ -70,7 +70,7 @@ message MsgRegisterInterchainQueryResponse {
}

// Request type for the Msg/SubmitQueryResult RPC method.
message MsgSubmitQueryResultRequest {
message MsgSubmitQueryResult {
option (cosmos.msg.v1.signer) = "sender";
// The ID of the Interchain Query.
uint64 query_id = 1;
Expand Down Expand Up @@ -152,7 +152,7 @@ message TxValue {
message MsgSubmitQueryResultResponse {}

// Request type for the Msg/RemoveInterchainQuery RPC method.
message MsgRemoveInterchainQueryRequest {
message MsgRemoveInterchainQuery {
option (cosmos.msg.v1.signer) = "sender";
// The ID of the query to remove.
uint64 query_id = 1;
Expand All @@ -164,13 +164,13 @@ message MsgRemoveInterchainQueryRequest {
message MsgRemoveInterchainQueryResponse {}

// Request type for the Msg/UpdateInterchainQuery RPC method.
message MsgUpdateInterchainQueryRequest {
message MsgUpdateInterchainQuery {
option (cosmos.msg.v1.signer) = "sender";
// The ID of the query to update.
uint64 query_id = 1;
// 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.
// parameters.
repeated KVKey new_keys = 2;
// A new minimal delay between consecutive query executions.
uint64 new_update_period = 3;
Expand All @@ -187,7 +187,7 @@ message MsgUpdateInterchainQueryRequest {
message MsgUpdateInterchainQueryResponse {}

// Request type for the Msg/UpdateParams RPC method.
message MsgUpdateParamsRequest {
message MsgUpdateParams {
option (amino.name) = "interchainqueries/MsgUpdateParams";
option (cosmos.msg.v1.signer) = "authority";
// The address of the authority of the module.
Expand Down
6 changes: 3 additions & 3 deletions wasmbinding/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (m *CustomMessenger) updateInterchainQuery(ctx sdk.Context, contractAddr sd
}

func (m *CustomMessenger) performUpdateInterchainQuery(ctx sdk.Context, contractAddr sdk.AccAddress, updateQuery *bindings.UpdateInterchainQuery) (*icqtypes.MsgUpdateInterchainQueryResponse, error) {
msg := icqtypes.MsgUpdateInterchainQueryRequest{
msg := icqtypes.MsgUpdateInterchainQuery{
QueryId: updateQuery.QueryId,
NewKeys: updateQuery.NewKeys,
NewUpdatePeriod: updateQuery.NewUpdatePeriod,
Expand Down Expand Up @@ -402,7 +402,7 @@ func (m *CustomMessenger) removeInterchainQuery(ctx sdk.Context, contractAddr sd
}

func (m *CustomMessenger) performRemoveInterchainQuery(ctx sdk.Context, contractAddr sdk.AccAddress, updateQuery *bindings.RemoveInterchainQuery) (*icqtypes.MsgRemoveInterchainQueryResponse, error) {
msg := icqtypes.MsgRemoveInterchainQueryRequest{
msg := icqtypes.MsgRemoveInterchainQuery{
QueryId: updateQuery.QueryId,
Sender: contractAddr.String(),
}
Expand Down Expand Up @@ -945,7 +945,7 @@ func (m *CustomMessenger) registerInterchainQuery(ctx sdk.Context, contractAddr
}

func (m *CustomMessenger) performRegisterInterchainQuery(ctx sdk.Context, contractAddr sdk.AccAddress, reg *bindings.RegisterInterchainQuery) (*icqtypes.MsgRegisterInterchainQueryResponse, error) {
msg := icqtypes.MsgRegisterInterchainQueryRequest{
msg := icqtypes.MsgRegisterInterchainQuery{
Keys: reg.Keys,
TransactionsFilter: reg.TransactionsFilter,
QueryType: reg.QueryType,
Expand Down
2 changes: 1 addition & 1 deletion x/interchainqueries/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func SubmitQueryResultCmd() *cobra.Command {
return fmt.Errorf("failed to read query result file: %w", err)
}

msg := types.MsgSubmitQueryResultRequest{QueryId: queryID, Sender: string(sender)}
msg := types.MsgSubmitQueryResult{QueryId: queryID, Sender: string(sender)}
if err := json.Unmarshal(result, &msg.Result); err != nil {
return fmt.Errorf("failed to unmarshal query result: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions x/interchainqueries/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func (suite *KeeperTestSuite) TestQueryResult() {
contractOwner := wasmKeeper.RandomAccountAddress(suite.T())
codeID := suite.StoreTestCode(ctx, contractOwner, reflectContractPath)
contractAddress := suite.InstantiateTestContract(ctx, contractOwner, codeID)
registerMsg := iqtypes.MsgRegisterInterchainQueryRequest{
registerMsg := iqtypes.MsgRegisterInterchainQuery{
ConnectionId: suite.Path.EndpointA.ConnectionID,
Keys: []*iqtypes.KVKey{
{Path: ibchost.StoreKey, Key: clientKey},
Expand Down Expand Up @@ -508,7 +508,7 @@ func (suite *KeeperTestSuite) TestQueryResult() {
})
suite.Require().NoError(err)

msg := iqtypes.MsgSubmitQueryResultRequest{
msg := iqtypes.MsgSubmitQueryResult{
QueryId: regQuery1.Id,
Sender: contractAddress.String(),
Result: &iqtypes.QueryResult{
Expand Down
Loading

0 comments on commit 0464849

Please sign in to comment.