From af9b25923fe4e4d9268de646baac0dfd391cedf9 Mon Sep 17 00:00:00 2001 From: 170210 Date: Fri, 25 Aug 2023 14:12:33 +0900 Subject: [PATCH 1/5] docs: add clarification to the order of list response in query Signed-off-by: 170210 --- proto/cosmwasm/wasm/v1/query.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index a642811336..41da34ccb0 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -97,6 +97,7 @@ message QueryContractHistoryRequest { // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method message QueryContractHistoryResponse { + // return in the order of contract execution repeated ContractCodeHistoryEntry entries = 1 [ (gogoproto.nullable) = false ]; // pagination defines the pagination in the response. @@ -115,6 +116,7 @@ message QueryContractsByCodeRequest { // Query/ContractsByCode RPC method message QueryContractsByCodeResponse { // contracts are a set of contract addresses + // return in the order of instantiation repeated string contracts = 1; // pagination defines the pagination in the response. @@ -133,6 +135,7 @@ message QueryAllContractStateRequest { // QueryAllContractStateResponse is the response type for the // Query/AllContractState RPC method message QueryAllContractStateResponse { + // return in alphabetical order of the state's keys repeated Model models = 1 [ (gogoproto.nullable) = false ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -207,6 +210,7 @@ message QueryCodesRequest { // QueryCodesResponse is the response type for the Query/Codes RPC method message QueryCodesResponse { + // return in the order of code_id repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -222,6 +226,7 @@ message QueryPinnedCodesRequest { // QueryPinnedCodesResponse is the response type for the // Query/PinnedCodes RPC method message QueryPinnedCodesResponse { + // return in the order of code_id repeated uint64 code_ids = 1 [ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ]; // pagination defines the pagination in the response. From af96b8f388c8fd6ac9a004ffc1468ae27d1f640d Mon Sep 17 00:00:00 2001 From: 170210 Date: Fri, 25 Aug 2023 14:16:58 +0900 Subject: [PATCH 2/5] chore: make proto-gen and format Signed-off-by: 170210 --- docs/proto/proto-docs.md | 10 +++++----- x/wasm/types/query.pb.go | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index ef57304b5b..80538c203a 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -985,7 +985,7 @@ Query/AllContractState RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `models` | [Model](#cosmwasm.wasm.v1.Model) | repeated | | +| `models` | [Model](#cosmwasm.wasm.v1.Model) | repeated | return in alphabetical order of the state's keys | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -1047,7 +1047,7 @@ QueryCodesResponse is the response type for the Query/Codes RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_infos` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | repeated | | +| `code_infos` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | repeated | return in the order of code_id | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -1081,7 +1081,7 @@ Query/ContractHistory RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | | +| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | return in the order of contract execution | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -1148,7 +1148,7 @@ Query/ContractsByCode RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses | +| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses return in the order of instantiation | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -1206,7 +1206,7 @@ Query/PinnedCodes RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_ids` | [uint64](#uint64) | repeated | | +| `code_ids` | [uint64](#uint64) | repeated | return in the order of code_id | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index 7cb150cd94..2ca50f6201 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -177,6 +177,7 @@ var xxx_messageInfo_QueryContractHistoryRequest proto.InternalMessageInfo // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method type QueryContractHistoryResponse struct { + // return in the order of contract execution Entries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -270,6 +271,7 @@ var xxx_messageInfo_QueryContractsByCodeRequest proto.InternalMessageInfo // Query/ContractsByCode RPC method type QueryContractsByCodeResponse struct { // contracts are a set of contract addresses + // return in the order of instantiation Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -363,6 +365,7 @@ var xxx_messageInfo_QueryAllContractStateRequest proto.InternalMessageInfo // QueryAllContractStateResponse is the response type for the // Query/AllContractState RPC method type QueryAllContractStateResponse struct { + // return in alphabetical order of the state's keys Models []Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -768,6 +771,7 @@ var xxx_messageInfo_QueryCodesRequest proto.InternalMessageInfo // QueryCodesResponse is the response type for the Query/Codes RPC method type QueryCodesResponse struct { + // return in the order of code_id CodeInfos []CodeInfoResponse `protobuf:"bytes,1,rep,name=code_infos,json=codeInfos,proto3" json:"code_infos"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -859,6 +863,7 @@ var xxx_messageInfo_QueryPinnedCodesRequest proto.InternalMessageInfo // QueryPinnedCodesResponse is the response type for the // Query/PinnedCodes RPC method type QueryPinnedCodesResponse struct { + // return in the order of code_id CodeIDs []uint64 `protobuf:"varint,1,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` From 72a9a47fbee81ab9f070407ba5048cad8a2b7316 Mon Sep 17 00:00:00 2001 From: 170210 Date: Fri, 25 Aug 2023 13:59:25 +0900 Subject: [PATCH 3/5] chore: add this pr to CHANGELOG Signed-off-by: 170210 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6454f0de84..b0d24ca43a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ ### Document Updates * [\#54](https://github.com/Finschia/wasmd/pull/54) add documentation about errors (codespace and codes) * [\#92](https://github.com/Finschia/wasmd/pull/92) modify links in x/wasmplus README.md +* [\#103](https://github.com/Finschia/wasmd/pull/103) add clarifications to the order of list response in query ## [v0.1.4](https://github.com/Finschia/wasmd/releases/tag/v0.1.4) - 2023.05.22 From 32258b349e03dc702219372c63f757ff2ee16cd7 Mon Sep 17 00:00:00 2001 From: 170210 Date: Fri, 25 Aug 2023 18:01:59 +0900 Subject: [PATCH 4/5] fixup: fix for comment Signed-off-by: 170210 --- docs/proto/proto-docs.md | 4 ++-- go.mod | 2 +- proto/cosmwasm/wasm/v1/query.proto | 6 +++--- x/wasm/types/query.pb.go | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 80538c203a..5ecb719751 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1081,7 +1081,7 @@ Query/ContractHistory RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | return in the order of contract execution | +| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | return in the order of timestamps according to contract updates | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -1148,7 +1148,7 @@ Query/ContractsByCode RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses return in the order of instantiation | +| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses. return in the order of timestamps according to instantiation or migration | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | diff --git a/go.mod b/go.mod index de862264c7..abd141a54d 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/Finschia/finschia-sdk v0.48.0-rc1 github.com/Finschia/ostracon v1.1.1 github.com/Finschia/wasmvm v1.1.1-0.11.2.0.20230418093236-ce70a3856778 + github.com/cosmos/btcutil v1.0.5 github.com/cosmos/iavl v0.19.4 github.com/cosmos/ibc-go/v4 v4.3.1 github.com/dvsekhvalnov/jose2go v1.5.0 @@ -51,7 +52,6 @@ require ( github.com/coinbase/rosetta-sdk-go v0.8.3 // indirect github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index 41da34ccb0..3faa97c0b8 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -97,7 +97,7 @@ message QueryContractHistoryRequest { // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method message QueryContractHistoryResponse { - // return in the order of contract execution + // return in the order of timestamps according to contract updates repeated ContractCodeHistoryEntry entries = 1 [ (gogoproto.nullable) = false ]; // pagination defines the pagination in the response. @@ -115,8 +115,8 @@ message QueryContractsByCodeRequest { // QueryContractsByCodeResponse is the response type for the // Query/ContractsByCode RPC method message QueryContractsByCodeResponse { - // contracts are a set of contract addresses - // return in the order of instantiation + // contracts are a set of contract addresses. + // return in the order of timestamps according to instantiation or migration repeated string contracts = 1; // pagination defines the pagination in the response. diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index 2ca50f6201..1b10a7ee42 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -177,7 +177,7 @@ var xxx_messageInfo_QueryContractHistoryRequest proto.InternalMessageInfo // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method type QueryContractHistoryResponse struct { - // return in the order of contract execution + // return in the order of timestamps according to contract updates Entries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -270,8 +270,8 @@ var xxx_messageInfo_QueryContractsByCodeRequest proto.InternalMessageInfo // QueryContractsByCodeResponse is the response type for the // Query/ContractsByCode RPC method type QueryContractsByCodeResponse struct { - // contracts are a set of contract addresses - // return in the order of instantiation + // contracts are a set of contract addresses. + // return in the order of timestamps according to instantiation or migration Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` From 19c61d43a77522d930669126e5c9cb481fe05d51 Mon Sep 17 00:00:00 2001 From: 170210 Date: Fri, 25 Aug 2023 18:35:16 +0900 Subject: [PATCH 5/5] fixup: fix for comment Signed-off-by: 170210 --- docs/proto/proto-docs.md | 2 +- proto/cosmwasm/wasm/v1/query.proto | 2 +- x/wasm/types/query.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 5ecb719751..1ca5b041d3 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1081,7 +1081,7 @@ Query/ContractHistory RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | return in the order of timestamps according to contract updates | +| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | return in the order of timestamps according to when the contract was updated | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index 3faa97c0b8..c02e11fa9b 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -97,7 +97,7 @@ message QueryContractHistoryRequest { // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method message QueryContractHistoryResponse { - // return in the order of timestamps according to contract updates + // return in the order of timestamps according to when the contract was updated repeated ContractCodeHistoryEntry entries = 1 [ (gogoproto.nullable) = false ]; // pagination defines the pagination in the response. diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index 1b10a7ee42..376f93c69e 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -177,7 +177,7 @@ var xxx_messageInfo_QueryContractHistoryRequest proto.InternalMessageInfo // QueryContractHistoryResponse is the response type for the // Query/ContractHistory RPC method type QueryContractHistoryResponse struct { - // return in the order of timestamps according to contract updates + // return in the order of timestamps according to when the contract was updated Entries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`