Skip to content

Commit 2ce2faa

Browse files
authored
fix: modify wasm grpc query api path. (#453)
* fix: modify wasm grpc query api path. * chore: update changelog
1 parent 7184063 commit 2ce2faa

File tree

8 files changed

+206
-208
lines changed

8 files changed

+206
-208
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4242
### Improvements
4343

4444
### Bug Fixes
45+
* (x/wasm) [\#453](https://github.com/line/lbm-sdk/pull/453) modify wasm grpc query api path
4546

4647
### Breaking Changes
4748

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,8 @@ proto-all: proto-format proto-lint proto-gen
426426

427427
proto-gen:
428428
@echo "Generating Protobuf files"
429-
@$(DOCKER) run --rm -v $(CURDIR):/workspace \
430-
--workdir /workspace tendermintdev/docker-build-proto \
431-
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
429+
@if $(DOCKER) ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then $(DOCKER) start -a $(containerProtoGen); else $(DOCKER) run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
430+
sh ./scripts/protocgen.sh; fi
432431

433432
# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
434433
proto-gen-any:

client/docs/statik/statik.go

+3-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/docs/swagger-ui/swagger.yaml

+106-106
Original file line numberDiff line numberDiff line change
@@ -31049,7 +31049,7 @@ paths:
3104931049
format: byte
3105031050
tags:
3105131051
- Query
31052-
/line/wasm/v1/code:
31052+
/lbm/wasm/v1/code:
3105331053
get:
3105431054
summary: Codes gets the metadata for all stored wasm codes
3105531055
operationId: Codes
@@ -31354,7 +31354,7 @@ paths:
3135431354
format: boolean
3135531355
tags:
3135631356
- Query
31357-
'/line/wasm/v1/code/{code_id}':
31357+
'/lbm/wasm/v1/code/{code_id}':
3135831358
get:
3135931359
summary: Code gets the binary code and metadata for a singe wasm code
3136031360
operationId: Code
@@ -31600,7 +31600,7 @@ paths:
3160031600
format: uint64
3160131601
tags:
3160231602
- Query
31603-
'/line/wasm/v1/code/{code_id}/contracts':
31603+
'/lbm/wasm/v1/code/{code_id}/contracts':
3160431604
get:
3160531605
summary: ContractsByCode lists all smart contracts for a code id
3160631606
operationId: ContractsByCode
@@ -31880,7 +31880,7 @@ paths:
3188031880
format: boolean
3188131881
tags:
3188231882
- Query
31883-
'/line/wasm/v1/contract/{address}':
31883+
'/lbm/wasm/v1/contract/{address}':
3188431884
get:
3188531885
summary: ContractInfo gets the contract meta data
3188631886
operationId: ContractInfo
@@ -32328,7 +32328,7 @@ paths:
3232832328
type: string
3232932329
tags:
3233032330
- Query
32331-
'/line/wasm/v1/contract/{address}/history':
32331+
'/lbm/wasm/v1/contract/{address}/history':
3233232332
get:
3233332333
summary: ContractHistory gets the contract code history
3233432334
operationId: ContractHistory
@@ -32650,51 +32650,23 @@ paths:
3265032650
format: boolean
3265132651
tags:
3265232652
- Query
32653-
'/line/wasm/v1/contract/{address}/state':
32653+
'/lbm/wasm/v1/contract/{address}/raw/{query_data}':
3265432654
get:
32655-
summary: AllContractState gets all raw store data for a single contract
32656-
operationId: AllContractState
32655+
summary: RawContractState gets single key from the raw store data of a contract
32656+
operationId: RawContractState
3265732657
responses:
3265832658
'200':
3265932659
description: A successful response.
3266032660
schema:
3266132661
type: object
3266232662
properties:
32663-
models:
32664-
type: array
32665-
items:
32666-
type: object
32667-
properties:
32668-
key:
32669-
type: string
32670-
format: byte
32671-
title: hex-encode key to read it better (this is often ascii)
32672-
value:
32673-
type: string
32674-
format: byte
32675-
title: base64-encode raw value
32676-
title: Model is a struct that holds a KV pair
32677-
pagination:
32678-
description: pagination defines the pagination in the response.
32679-
type: object
32680-
properties:
32681-
next_key:
32682-
type: string
32683-
format: byte
32684-
title: |-
32685-
next_key is the key to be passed to PageRequest.key to
32686-
query the next page most efficiently
32687-
total:
32688-
type: string
32689-
format: uint64
32690-
title: >-
32691-
total is total number of results available if
32692-
PageRequest.count_total
32693-
32694-
was set, its value is undefined otherwise
32663+
data:
32664+
type: string
32665+
format: byte
32666+
title: Data contains the raw store data
3269532667
title: |-
32696-
QueryAllContractStateResponse is the response type for the
32697-
Query/AllContractState RPC method
32668+
QueryRawContractStateResponse is the response type for the
32669+
Query/RawContractState RPC method
3269832670
default:
3269932671
description: An unexpected error response
3270032672
schema:
@@ -32890,59 +32862,17 @@ paths:
3289032862
in: path
3289132863
required: true
3289232864
type: string
32893-
- name: pagination.key
32894-
description: |-
32895-
key is a value returned in PageResponse.next_key to begin
32896-
querying the next page most efficiently. Only one of offset or key
32897-
should be set.
32898-
in: query
32899-
required: false
32865+
- name: query_data
32866+
in: path
32867+
required: true
3290032868
type: string
3290132869
format: byte
32902-
- name: pagination.offset
32903-
description: >-
32904-
offset is a numeric offset that can be used when key is unavailable.
32905-
32906-
It is less efficient than using key. Only one of offset or key
32907-
should
32908-
32909-
be set.
32910-
in: query
32911-
required: false
32912-
type: string
32913-
format: uint64
32914-
- name: pagination.limit
32915-
description: >-
32916-
limit is the total number of results to be returned in the result
32917-
page.
32918-
32919-
If left empty it will default to a value to be set by each app.
32920-
in: query
32921-
required: false
32922-
type: string
32923-
format: uint64
32924-
- name: pagination.count_total
32925-
description: >-
32926-
count_total is set to true to indicate that the result set should
32927-
include
32928-
32929-
a count of the total number of items available for pagination in
32930-
UIs.
32931-
32932-
count_total is only respected when offset is used. It is ignored
32933-
when key
32934-
32935-
is set.
32936-
in: query
32937-
required: false
32938-
type: boolean
32939-
format: boolean
3294032870
tags:
3294132871
- Query
32942-
'/wasm/v1/contract/{address}/raw/{query_data}':
32872+
'/lbm/wasm/v1/contract/{address}/smart/{query_data}':
3294332873
get:
32944-
summary: RawContractState gets single key from the raw store data of a contract
32945-
operationId: RawContractState
32874+
summary: SmartContractState get smart query result from the contract
32875+
operationId: SmartContractState
3294632876
responses:
3294732877
'200':
3294832878
description: A successful response.
@@ -32952,10 +32882,10 @@ paths:
3295232882
data:
3295332883
type: string
3295432884
format: byte
32955-
title: Data contains the raw store data
32885+
title: Data contains the json data returned from the smart contract
3295632886
title: |-
32957-
QueryRawContractStateResponse is the response type for the
32958-
Query/RawContractState RPC method
32887+
QuerySmartContractStateResponse is the response type for the
32888+
Query/SmartContractState RPC method
3295932889
default:
3296032890
description: An unexpected error response
3296132891
schema:
@@ -33152,29 +33082,58 @@ paths:
3315233082
required: true
3315333083
type: string
3315433084
- name: query_data
33085+
description: QueryData contains the query data passed to the contract
3315533086
in: path
3315633087
required: true
3315733088
type: string
3315833089
format: byte
3315933090
tags:
3316033091
- Query
33161-
'/wasm/v1/contract/{address}/smart/{query_data}':
33092+
'/lbm/wasm/v1/contract/{address}/state':
3316233093
get:
33163-
summary: SmartContractState get smart query result from the contract
33164-
operationId: SmartContractState
33094+
summary: AllContractState gets all raw store data for a single contract
33095+
operationId: AllContractState
3316533096
responses:
3316633097
'200':
3316733098
description: A successful response.
3316833099
schema:
3316933100
type: object
3317033101
properties:
33171-
data:
33172-
type: string
33173-
format: byte
33174-
title: Data contains the json data returned from the smart contract
33102+
models:
33103+
type: array
33104+
items:
33105+
type: object
33106+
properties:
33107+
key:
33108+
type: string
33109+
format: byte
33110+
title: hex-encode key to read it better (this is often ascii)
33111+
value:
33112+
type: string
33113+
format: byte
33114+
title: base64-encode raw value
33115+
title: Model is a struct that holds a KV pair
33116+
pagination:
33117+
description: pagination defines the pagination in the response.
33118+
type: object
33119+
properties:
33120+
next_key:
33121+
type: string
33122+
format: byte
33123+
title: |-
33124+
next_key is the key to be passed to PageRequest.key to
33125+
query the next page most efficiently
33126+
total:
33127+
type: string
33128+
format: uint64
33129+
title: >-
33130+
total is total number of results available if
33131+
PageRequest.count_total
33132+
33133+
was set, its value is undefined otherwise
3317533134
title: |-
33176-
QuerySmartContractStateResponse is the response type for the
33177-
Query/SmartContractState RPC method
33135+
QueryAllContractStateResponse is the response type for the
33136+
Query/AllContractState RPC method
3317833137
default:
3317933138
description: An unexpected error response
3318033139
schema:
@@ -33370,12 +33329,53 @@ paths:
3337033329
in: path
3337133330
required: true
3337233331
type: string
33373-
- name: query_data
33374-
description: QueryData contains the query data passed to the contract
33375-
in: path
33376-
required: true
33332+
- name: pagination.key
33333+
description: |-
33334+
key is a value returned in PageResponse.next_key to begin
33335+
querying the next page most efficiently. Only one of offset or key
33336+
should be set.
33337+
in: query
33338+
required: false
3337733339
type: string
3337833340
format: byte
33341+
- name: pagination.offset
33342+
description: >-
33343+
offset is a numeric offset that can be used when key is unavailable.
33344+
33345+
It is less efficient than using key. Only one of offset or key
33346+
should
33347+
33348+
be set.
33349+
in: query
33350+
required: false
33351+
type: string
33352+
format: uint64
33353+
- name: pagination.limit
33354+
description: >-
33355+
limit is the total number of results to be returned in the result
33356+
page.
33357+
33358+
If left empty it will default to a value to be set by each app.
33359+
in: query
33360+
required: false
33361+
type: string
33362+
format: uint64
33363+
- name: pagination.count_total
33364+
description: >-
33365+
count_total is set to true to indicate that the result set should
33366+
include
33367+
33368+
a count of the total number of items available for pagination in
33369+
UIs.
33370+
33371+
count_total is only respected when offset is used. It is ignored
33372+
when key
33373+
33374+
is set.
33375+
in: query
33376+
required: false
33377+
type: boolean
33378+
format: boolean
3337933379
tags:
3338033380
- Query
3338133381
/lbm/consortium/v1/params:

docs/core/proto-docs.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -13003,14 +13003,14 @@ Query provides defines the gRPC querier service
1300313003

1300413004
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
1300513005
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
13006-
| `ContractInfo` | [QueryContractInfoRequest](#lbm.wasm.v1.QueryContractInfoRequest) | [QueryContractInfoResponse](#lbm.wasm.v1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | GET|/line/wasm/v1/contract/{address}|
13007-
| `ContractHistory` | [QueryContractHistoryRequest](#lbm.wasm.v1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#lbm.wasm.v1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | GET|/line/wasm/v1/contract/{address}/history|
13008-
| `ContractsByCode` | [QueryContractsByCodeRequest](#lbm.wasm.v1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#lbm.wasm.v1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | GET|/line/wasm/v1/code/{code_id}/contracts|
13009-
| `AllContractState` | [QueryAllContractStateRequest](#lbm.wasm.v1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#lbm.wasm.v1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | GET|/line/wasm/v1/contract/{address}/state|
13010-
| `RawContractState` | [QueryRawContractStateRequest](#lbm.wasm.v1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#lbm.wasm.v1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | GET|/wasm/v1/contract/{address}/raw/{query_data}|
13011-
| `SmartContractState` | [QuerySmartContractStateRequest](#lbm.wasm.v1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#lbm.wasm.v1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | GET|/wasm/v1/contract/{address}/smart/{query_data}|
13012-
| `Code` | [QueryCodeRequest](#lbm.wasm.v1.QueryCodeRequest) | [QueryCodeResponse](#lbm.wasm.v1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | GET|/line/wasm/v1/code/{code_id}|
13013-
| `Codes` | [QueryCodesRequest](#lbm.wasm.v1.QueryCodesRequest) | [QueryCodesResponse](#lbm.wasm.v1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | GET|/line/wasm/v1/code|
13006+
| `ContractInfo` | [QueryContractInfoRequest](#lbm.wasm.v1.QueryContractInfoRequest) | [QueryContractInfoResponse](#lbm.wasm.v1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | GET|/lbm/wasm/v1/contract/{address}|
13007+
| `ContractHistory` | [QueryContractHistoryRequest](#lbm.wasm.v1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#lbm.wasm.v1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | GET|/lbm/wasm/v1/contract/{address}/history|
13008+
| `ContractsByCode` | [QueryContractsByCodeRequest](#lbm.wasm.v1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#lbm.wasm.v1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | GET|/lbm/wasm/v1/code/{code_id}/contracts|
13009+
| `AllContractState` | [QueryAllContractStateRequest](#lbm.wasm.v1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#lbm.wasm.v1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | GET|/lbm/wasm/v1/contract/{address}/state|
13010+
| `RawContractState` | [QueryRawContractStateRequest](#lbm.wasm.v1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#lbm.wasm.v1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | GET|/lbm/wasm/v1/contract/{address}/raw/{query_data}|
13011+
| `SmartContractState` | [QuerySmartContractStateRequest](#lbm.wasm.v1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#lbm.wasm.v1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | GET|/lbm/wasm/v1/contract/{address}/smart/{query_data}|
13012+
| `Code` | [QueryCodeRequest](#lbm.wasm.v1.QueryCodeRequest) | [QueryCodeResponse](#lbm.wasm.v1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | GET|/lbm/wasm/v1/code/{code_id}|
13013+
| `Codes` | [QueryCodesRequest](#lbm.wasm.v1.QueryCodesRequest) | [QueryCodesResponse](#lbm.wasm.v1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | GET|/lbm/wasm/v1/code|
1301413014

1301513015
<!-- end services -->
1301613016

proto/lbm/wasm/v1/query.proto

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,35 @@ option (gogoproto.equal_all) = false;
1414
service Query {
1515
// ContractInfo gets the contract meta data
1616
rpc ContractInfo(QueryContractInfoRequest) returns (QueryContractInfoResponse) {
17-
option (google.api.http).get = "/line/wasm/v1/contract/{address}";
17+
option (google.api.http).get = "/lbm/wasm/v1/contract/{address}";
1818
}
1919
// ContractHistory gets the contract code history
2020
rpc ContractHistory(QueryContractHistoryRequest) returns (QueryContractHistoryResponse) {
21-
option (google.api.http).get = "/line/wasm/v1/contract/{address}/history";
21+
option (google.api.http).get = "/lbm/wasm/v1/contract/{address}/history";
2222
}
2323
// ContractsByCode lists all smart contracts for a code id
2424
rpc ContractsByCode(QueryContractsByCodeRequest) returns (QueryContractsByCodeResponse) {
25-
option (google.api.http).get = "/line/wasm/v1/code/{code_id}/contracts";
25+
option (google.api.http).get = "/lbm/wasm/v1/code/{code_id}/contracts";
2626
}
2727
// AllContractState gets all raw store data for a single contract
2828
rpc AllContractState(QueryAllContractStateRequest) returns (QueryAllContractStateResponse) {
29-
option (google.api.http).get = "/line/wasm/v1/contract/{address}/state";
29+
option (google.api.http).get = "/lbm/wasm/v1/contract/{address}/state";
3030
}
3131
// RawContractState gets single key from the raw store data of a contract
3232
rpc RawContractState(QueryRawContractStateRequest) returns (QueryRawContractStateResponse) {
33-
option (google.api.http).get = "/wasm/v1/contract/{address}/raw/{query_data}";
33+
option (google.api.http).get = "/lbm/wasm/v1/contract/{address}/raw/{query_data}";
3434
}
3535
// SmartContractState get smart query result from the contract
3636
rpc SmartContractState(QuerySmartContractStateRequest) returns (QuerySmartContractStateResponse) {
37-
option (google.api.http).get = "/wasm/v1/contract/{address}/smart/{query_data}";
37+
option (google.api.http).get = "/lbm/wasm/v1/contract/{address}/smart/{query_data}";
3838
}
3939
// Code gets the binary code and metadata for a singe wasm code
4040
rpc Code(QueryCodeRequest) returns (QueryCodeResponse) {
41-
option (google.api.http).get = "/line/wasm/v1/code/{code_id}";
41+
option (google.api.http).get = "/lbm/wasm/v1/code/{code_id}";
4242
}
4343
// Codes gets the metadata for all stored wasm codes
4444
rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) {
45-
option (google.api.http).get = "/line/wasm/v1/code";
45+
option (google.api.http).get = "/lbm/wasm/v1/code";
4646
}
4747
}
4848

0 commit comments

Comments
 (0)