Skip to content

Commit

Permalink
fix: remove some x/token,collection queries on listable collections (#…
Browse files Browse the repository at this point in the history
…881)

* Update protos

* Update logic

* Update tests

* Lint

* Update CHANGELOG.md
  • Loading branch information
0Tech committed Feb 9, 2023
1 parent f936c7d commit e2aa3ea
Show file tree
Hide file tree
Showing 19 changed files with 3,019 additions and 8,438 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection,token) [\#849](https://github.com/line/lbm-sdk/pull/849) Introduce codespace into x/collection,token
* (x/token,collection) [\#863](https://github.com/line/lbm-sdk/pull/863) Update x/collection,token proto
* (x/collection,token) [\#866](https://github.com/line/lbm-sdk/pull/866) Do not create account on x/token,collection
* (x/collection,token) [\#881](https://github.com/line/lbm-sdk/pull/881) Remove some x/token,collection queries on listable collections

### Removed
* [\#853](https://github.com/line/lbm-sdk/pull/853) remove useless stub BeginBlock, EndBlock methods from modules below
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

6,502 changes: 2,314 additions & 4,188 deletions client/docs/swagger-ui/swagger.yaml

Large diffs are not rendered by default.

140 changes: 0 additions & 140 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,6 @@
- [QueryTokenResponse](#lbm.collection.v1.QueryTokenResponse)
- [QueryTokenTypeRequest](#lbm.collection.v1.QueryTokenTypeRequest)
- [QueryTokenTypeResponse](#lbm.collection.v1.QueryTokenTypeResponse)
- [QueryTokenTypesRequest](#lbm.collection.v1.QueryTokenTypesRequest)
- [QueryTokenTypesResponse](#lbm.collection.v1.QueryTokenTypesResponse)
- [QueryTokensRequest](#lbm.collection.v1.QueryTokensRequest)
- [QueryTokensResponse](#lbm.collection.v1.QueryTokensResponse)
- [QueryTokensWithTokenTypeRequest](#lbm.collection.v1.QueryTokensWithTokenTypeRequest)
- [QueryTokensWithTokenTypeResponse](#lbm.collection.v1.QueryTokensWithTokenTypeResponse)

- [Query](#lbm.collection.v1.Query)

Expand Down Expand Up @@ -899,8 +893,6 @@
- [QueryBurntResponse](#lbm.token.v1.QueryBurntResponse)
- [QueryContractRequest](#lbm.token.v1.QueryContractRequest)
- [QueryContractResponse](#lbm.token.v1.QueryContractResponse)
- [QueryContractsRequest](#lbm.token.v1.QueryContractsRequest)
- [QueryContractsResponse](#lbm.token.v1.QueryContractsResponse)
- [QueryGranteeGrantsRequest](#lbm.token.v1.QueryGranteeGrantsRequest)
- [QueryGranteeGrantsResponse](#lbm.token.v1.QueryGranteeGrantsResponse)
- [QueryHoldersByOperatorRequest](#lbm.token.v1.QueryHoldersByOperatorRequest)
Expand Down Expand Up @@ -10589,103 +10581,6 @@ QueryTokenTypeResponse is the response type for the Query/TokenType RPC method.




<a name="lbm.collection.v1.QueryTokenTypesRequest"></a>

### QueryTokenTypesRequest
QueryTokenTypesRequest is the request type for the Query/TokenTypes RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contract_id` | [string](#string) | | contract id associated with the contract. |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |






<a name="lbm.collection.v1.QueryTokenTypesResponse"></a>

### QueryTokenTypesResponse
QueryTokenTypesResponse is the response type for the Query/TokenTypes RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `token_types` | [TokenType](#lbm.collection.v1.TokenType) | repeated | token types is the informations of all the token types. |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |






<a name="lbm.collection.v1.QueryTokensRequest"></a>

### QueryTokensRequest
QueryTokensRequest is the request type for the Query/Tokens RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contract_id` | [string](#string) | | contract id associated with the contract. |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |






<a name="lbm.collection.v1.QueryTokensResponse"></a>

### QueryTokensResponse
QueryTokensResponse is the response type for the Query/Tokens RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `tokens` | [google.protobuf.Any](#google.protobuf.Any) | repeated | informations of all the tokens. |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |






<a name="lbm.collection.v1.QueryTokensWithTokenTypeRequest"></a>

### QueryTokensWithTokenTypeRequest
QueryTokensWithTokenTypeRequest is the request type for the Query/TokensWithTokenType RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contract_id` | [string](#string) | | contract id associated with the contract. |
| `token_type` | [string](#string) | | token type associated with the token type. refer to TokenType for the definition. |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |






<a name="lbm.collection.v1.QueryTokensWithTokenTypeResponse"></a>

### QueryTokensWithTokenTypeResponse
QueryTokensWithTokenTypeResponse is the response type for the Query/TokensWithTokenType RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `tokens` | [google.protobuf.Any](#google.protobuf.Any) | repeated | informations of all the tokens. |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |





<!-- end messages -->

<!-- end enums -->
Expand Down Expand Up @@ -10713,10 +10608,7 @@ Query defines the gRPC querier service.

Since: 0.46.0 (finschia) | GET|/lbm/collection/v1/contracts/{contract_id}/token_classes/{class_id}/type_name|
| `TokenType` | [QueryTokenTypeRequest](#lbm.collection.v1.QueryTokenTypeRequest) | [QueryTokenTypeResponse](#lbm.collection.v1.QueryTokenTypeResponse) | TokenType queries metadata of a token type. | GET|/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}|
| `TokenTypes` | [QueryTokenTypesRequest](#lbm.collection.v1.QueryTokenTypesRequest) | [QueryTokenTypesResponse](#lbm.collection.v1.QueryTokenTypesResponse) | TokenTypes queries metadata of all the token types. | GET|/lbm/collection/v1/contracts/{contract_id}/token_types|
| `Token` | [QueryTokenRequest](#lbm.collection.v1.QueryTokenRequest) | [QueryTokenResponse](#lbm.collection.v1.QueryTokenResponse) | Token queries a metadata of a token from its token id. | GET|/lbm/collection/v1/contracts/{contract_id}/tokens/{token_id}|
| `TokensWithTokenType` | [QueryTokensWithTokenTypeRequest](#lbm.collection.v1.QueryTokensWithTokenTypeRequest) | [QueryTokensWithTokenTypeResponse](#lbm.collection.v1.QueryTokensWithTokenTypeResponse) | TokensWithTokenType queries all token metadata with token type. | GET|/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/tokens|
| `Tokens` | [QueryTokensRequest](#lbm.collection.v1.QueryTokensRequest) | [QueryTokensResponse](#lbm.collection.v1.QueryTokensResponse) | Tokens queries all token metadata. | GET|/lbm/collection/v1/contracts/{contract_id}/tokens|
| `Root` | [QueryRootRequest](#lbm.collection.v1.QueryRootRequest) | [QueryRootResponse](#lbm.collection.v1.QueryRootResponse) | Root queries the root of a given nft. | GET|/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/root|
| `Parent` | [QueryParentRequest](#lbm.collection.v1.QueryParentRequest) | [QueryParentResponse](#lbm.collection.v1.QueryParentResponse) | Parent queries the parent of a given nft. | GET|/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/parent|
| `Children` | [QueryChildrenRequest](#lbm.collection.v1.QueryChildrenRequest) | [QueryChildrenResponse](#lbm.collection.v1.QueryChildrenResponse) | Children queries the children of a given nft. | GET|/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/children|
Expand Down Expand Up @@ -13386,37 +13278,6 @@ QueryContractResponse is the response type for the Query/Contract RPC method



<a name="lbm.token.v1.QueryContractsRequest"></a>

### QueryContractsRequest
QueryContractsRequest is the request type for the Query/Contracts RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |






<a name="lbm.token.v1.QueryContractsResponse"></a>

### QueryContractsResponse
QueryContractsResponse is the response type for the Query/Contracts RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contracts` | [Contract](#lbm.token.v1.Contract) | repeated | information of the contracts. |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |






<a name="lbm.token.v1.QueryGranteeGrantsRequest"></a>

### QueryGranteeGrantsRequest
Expand Down Expand Up @@ -13593,7 +13454,6 @@ Query defines the gRPC querier service.
| `Minted` | [QueryMintedRequest](#lbm.token.v1.QueryMintedRequest) | [QueryMintedResponse](#lbm.token.v1.QueryMintedResponse) | Minted queries the number of minted tokens from the given contract id. | GET|/lbm/token/v1/token_classes/{contract_id}/minted|
| `Burnt` | [QueryBurntRequest](#lbm.token.v1.QueryBurntRequest) | [QueryBurntResponse](#lbm.token.v1.QueryBurntResponse) | Burnt queries the number of burnt tokens from the given contract id. | GET|/lbm/token/v1/token_classes/{contract_id}/burnt|
| `Contract` | [QueryContractRequest](#lbm.token.v1.QueryContractRequest) | [QueryContractResponse](#lbm.token.v1.QueryContractResponse) | Contract queries an token metadata based on its contract id. | GET|/lbm/token/v1/token_classes/{contract_id}|
| `Contracts` | [QueryContractsRequest](#lbm.token.v1.QueryContractsRequest) | [QueryContractsResponse](#lbm.token.v1.QueryContractsResponse) | Contracts queries all token metadata. | GET|/lbm/token/v1/token_classes|
| `GranteeGrants` | [QueryGranteeGrantsRequest](#lbm.token.v1.QueryGranteeGrantsRequest) | [QueryGranteeGrantsResponse](#lbm.token.v1.QueryGranteeGrantsResponse) | GranteeGrants queries permissions on a given grantee. | GET|/lbm/token/v1/token_classes/{contract_id}/grants/{grantee}|
| `IsOperatorFor` | [QueryIsOperatorForRequest](#lbm.token.v1.QueryIsOperatorForRequest) | [QueryIsOperatorForResponse](#lbm.token.v1.QueryIsOperatorForResponse) | IsOperatorFor queries authorization on a given operator holder pair. | |
| `HoldersByOperator` | [QueryHoldersByOperatorRequest](#lbm.token.v1.QueryHoldersByOperatorRequest) | [QueryHoldersByOperatorResponse](#lbm.token.v1.QueryHoldersByOperatorResponse) | HoldersByOperator queries holders on a given operator. | |
Expand Down
72 changes: 0 additions & 72 deletions proto/lbm/collection/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,11 @@ service Query {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}";
}

// TokenTypes queries metadata of all the token types.
rpc TokenTypes(QueryTokenTypesRequest) returns (QueryTokenTypesResponse) {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types";
}

// Token queries a metadata of a token from its token id.
rpc Token(QueryTokenRequest) returns (QueryTokenResponse) {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/tokens/{token_id}";
}

// TokensWithTokenType queries all token metadata with token type.
rpc TokensWithTokenType(QueryTokensWithTokenTypeRequest) returns (QueryTokensWithTokenTypeResponse) {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/tokens";
}

// Tokens queries all token metadata.
rpc Tokens(QueryTokensRequest) returns (QueryTokensResponse) {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/tokens";
}

// Root queries the root of a given nft.
rpc Root(QueryRootRequest) returns (QueryRootResponse) {
option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/root";
Expand Down Expand Up @@ -285,24 +270,6 @@ message QueryTokenTypeResponse {
TokenType token_type = 1 [(gogoproto.nullable) = false];
}

// QueryTokenTypesRequest is the request type for the Query/TokenTypes RPC method.
message QueryTokenTypesRequest {
// contract id associated with the contract.
string contract_id = 1;

// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryTokenTypesResponse is the response type for the Query/TokenTypes RPC method.
message QueryTokenTypesResponse {
// token types is the informations of all the token types.
repeated TokenType token_types = 1 [(gogoproto.nullable) = false];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryTokenRequest is the request type for the Query/Token RPC method.
message QueryTokenRequest {
// contract id associated with the contract.
Expand All @@ -317,45 +284,6 @@ message QueryTokenResponse {
google.protobuf.Any token = 1 [(gogoproto.nullable) = false];
}

// QueryTokensWithTokenTypeRequest is the request type for the Query/TokensWithTokenType RPC method.
message QueryTokensWithTokenTypeRequest {
// contract id associated with the contract.
string contract_id = 1;
// token type associated with the token type.
// refer to TokenType for the definition.
string token_type = 2;

// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
}

// QueryTokensWithTokenTypeResponse is the response type for the Query/TokensWithTokenType RPC method.
message QueryTokensWithTokenTypeResponse {
// informations of all the tokens.
repeated google.protobuf.Any tokens = 1 [(gogoproto.nullable) = false];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryTokensRequest is the request type for the Query/Tokens RPC method.
message QueryTokensRequest {
// contract id associated with the contract.
string contract_id = 1;

// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryTokensResponse is the response type for the Query/Tokens RPC method.
message QueryTokensResponse {
// informations of all the tokens.
repeated google.protobuf.Any tokens = 1 [(gogoproto.nullable) = false];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryRootRequest is the request type for the Query/Root RPC method.
message QueryRootRequest {
// contract id associated with the contract.
Expand Down
19 changes: 0 additions & 19 deletions proto/lbm/token/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ service Query {
option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}";
}

// Contracts queries all token metadata.
rpc Contracts(QueryContractsRequest) returns (QueryContractsResponse) {
option (google.api.http).get = "/lbm/token/v1/token_classes";
}

// GranteeGrants queries permissions on a given grantee.
rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) {
option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/grants/{grantee}";
Expand Down Expand Up @@ -114,20 +109,6 @@ message QueryContractResponse {
Contract contract = 1 [(gogoproto.nullable) = false];
}

// QueryContractsRequest is the request type for the Query/Contracts RPC method
message QueryContractsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

// QueryContractsResponse is the response type for the Query/Contracts RPC method
message QueryContractsResponse {
// information of the contracts.
repeated Contract contracts = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method
message QueryGranteeGrantsRequest {
// contract id associated with the contract.
Expand Down
Loading

0 comments on commit e2aa3ea

Please sign in to comment.