Skip to content

Commit

Permalink
Fix proto/secret/compute/v1beta1/query.proto
Browse files Browse the repository at this point in the history
- Duplicate endpoint /compute/v1beta1/code_hash/
- Rename ID to Id to play nice with some protobuf parsers
- Regenerate code from protobuf
- Rebuild Swagger UI
  • Loading branch information
assafmo committed Oct 12, 2022
1 parent c64d0a0 commit 256d9b2
Show file tree
Hide file tree
Showing 32 changed files with 530 additions and 530 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

# 1.4.0

- CosmWasm v1
- Bump WASM gas cost:
- Base WASM invocation 10k -> 100k
Expand Down Expand Up @@ -155,7 +156,7 @@ Secret-CosmWasm remains in a version that is compatabile with the v0.10 of vanil

A new feature has been added - plaintext logs. To send an unencrypted log (contract output), use `plaintext_log` instead of `log`.
This allows contracts to emit public events, and attach websockets to listen to specific events. To take advantage of this feature, compile contracts with
`cosmwasm-std = { git = "https://github.com/enigmampc/SecretNetwork", tag = "v1.2.0" }`
`cosmwasm-std = { git = "https://github.com/scrtlabs/SecretNetwork", tag = "v1.2.0" }`

## Known Issues

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=SecretNetwork \
-X github.com/cosmos/cosmos-sdk/version.AppName=secretd \
-X github.com/enigmampc/SecretNetwork/cmd/secretcli/version.ClientName=secretcli \
-X github.com/scrtlabs/SecretNetwork/cmd/secretcli/version.ClientName=secretcli \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)"
Expand Down Expand Up @@ -462,11 +462,12 @@ update-swagger-openapi-docs: statik-install proto-swagger-openapi-gen statik

protoVer=v0.2

proto-all: proto-format proto-lint proto-gen proto-swagger-openapi-gen
proto-all: proto-lint proto-gen proto-swagger-openapi-gen

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen:$(protoVer) sh ./scripts/protocgen.sh
go mod tidy

proto-lint:
@$(DOCKER_BUF) lint --error-format=json
Expand Down
12 changes: 6 additions & 6 deletions client/docs/static/openapi/index.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions client/docs/static/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32187,10 +32187,10 @@ paths:
format: uint64
tags:
- gRPC Gateway API
"/compute/v1beta1/code_hash/{code_id}":
"/compute/v1beta1/code_hash/by_code_id/{code_id}":
get:
summary: Query code hash by code id
operationId: CodeHashByCodeID
operationId: CodeHashByCodeId
responses:
"200":
description: A successful response.
Expand Down Expand Up @@ -32377,7 +32377,7 @@ paths:
format: uint64
tags:
- gRPC Gateway API
"/compute/v1beta1/code_hash/{contract_address}":
"/compute/v1beta1/code_hash/by_contract_address/{contract_address}":
get:
summary: Query code hash by contract address
operationId: CodeHashByContractAddress
Expand Down Expand Up @@ -32958,7 +32958,7 @@ paths:
"/compute/v1beta1/contracts/{code_id}":
get:
summary: Query code info by id
operationId: ContractsByCodeID
operationId: ContractsByCodeId
responses:
"200":
description: A successful response.
Expand Down Expand Up @@ -63095,7 +63095,7 @@ components:
properties:
label:
type: string
secret.compute.v1beta1.QueryContractsByCodeIDResponse:
secret.compute.v1beta1.QueryContractsByCodeIdResponse:
type: object
properties:
contract_infos:
Expand Down
10 changes: 5 additions & 5 deletions client/docs/static/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35293,10 +35293,10 @@ paths:
format: uint64
tags:
- gRPC Gateway API
/compute/v1beta1/code_hash/{code_id}:
/compute/v1beta1/code_hash/by_code_id/{code_id}:
get:
summary: Query code hash by code id
operationId: CodeHashByCodeID
operationId: CodeHashByCodeId
responses:
'200':
description: A successful response.
Expand Down Expand Up @@ -35502,7 +35502,7 @@ paths:
format: uint64
tags:
- gRPC Gateway API
/compute/v1beta1/code_hash/{contract_address}:
/compute/v1beta1/code_hash/by_contract_address/{contract_address}:
get:
summary: Query code hash by contract address
operationId: CodeHashByContractAddress
Expand Down Expand Up @@ -36143,7 +36143,7 @@ paths:
/compute/v1beta1/contracts/{code_id}:
get:
summary: Query code info by id
operationId: ContractsByCodeID
operationId: ContractsByCodeId
responses:
'200':
description: A successful response.
Expand Down Expand Up @@ -68211,7 +68211,7 @@ definitions:
properties:
label:
type: string
secret.compute.v1beta1.QueryContractsByCodeIDResponse:
secret.compute.v1beta1.QueryContractsByCodeIdResponse:
type: object
properties:
contract_infos:
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ contract_with_floats.wasm: $(Rust_Crate_Source)
cp ./target/wasm32-unknown-unknown/release/test_contract.wasm ./contract_with_floats.wasm

# Create a wasm with more than 192 memory pages (fails in init, handle & query, this is our limit)
# https://github.com/enigmampc/SecretNetwork/blob/9eef8591b2c04c586ceee12f424b92062598123e/cosmwasm/packages/wasmi-runtime/src/wasm/memory.rs#L39
# https://github.com/scrtlabs/SecretNetwork/blob/9eef8591b2c04c586ceee12f424b92062598123e/cosmwasm/packages/wasmi-runtime/src/wasm/memory.rs#L39
too-high-initial-memory.wasm: contract.wasm
wasm2wat ./contract.wasm | perl -pe 's/\(memory \(;0;\) 17\)/(memory (;0;) 193)/' > /tmp/too-high-initial-memory.wat
wat2wasm /tmp/too-high-initial-memory.wat -o ./too-high-initial-memory.wasm

# Create a wasm with more than 512 memory pages (fails in store, this is cosmwasm's limit)
# https://github.com/enigmampc/SecretNetwork/blob/9eef8591b2c04c586ceee12f424b92062598123e/cosmwasm/packages/sgx-vm/src/compatability.rs#L36
# https://github.com/scrtlabs/SecretNetwork/blob/9eef8591b2c04c586ceee12f424b92062598123e/cosmwasm/packages/sgx-vm/src/compatability.rs#L36
static-too-high-initial-memory.wasm: contract.wasm
wasm2wat ./contract.wasm | perl -pe 's/\(memory \(;0;\) 17\)/(memory (;0;) 513)/' > /tmp/static-too-high-initial-memory.wat
wat2wasm /tmp/static-too-high-initial-memory.wat -o ./static-too-high-initial-memory.wasm
Expand Down
2 changes: 1 addition & 1 deletion proto/secret/compute/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package secret.compute.v1beta1;
import "gogoproto/gogo.proto";
import "secret/compute/v1beta1/types.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/compute/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types";

// GenesisState - genesis state of x/wasm
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion proto/secret/compute/v1beta1/msg.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";
package secret.compute.v1beta1;

option go_package = "github.com/enigmampc/SecretNetwork/x/compute/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types";

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down
18 changes: 9 additions & 9 deletions proto/secret/compute/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "cosmos/base/abci/v1beta1/abci.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/compute/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand All @@ -20,8 +20,8 @@ service Query {
"/compute/v1beta1/info/{contract_address}";
}
// Query code info by id
rpc ContractsByCodeID(QueryByCodeIDRequest)
returns (QueryContractsByCodeIDResponse) {
rpc ContractsByCodeId(QueryByCodeIdRequest)
returns (QueryContractsByCodeIdResponse) {
option (google.api.http).get = "/compute/v1beta1/contracts/{code_id}";
}
// Query secret contract
Expand All @@ -31,7 +31,7 @@ service Query {
"/compute/v1beta1/query/{contract_address}";
}
// Query a specific contract code by id
rpc Code(QueryByCodeIDRequest) returns (QueryCodeResponse) {
rpc Code(QueryByCodeIdRequest) returns (QueryCodeResponse) {
option (google.api.http).get = "/compute/v1beta1/code/{code_id}";
}
// Query all contract codes on-chain
Expand All @@ -42,11 +42,11 @@ service Query {
rpc CodeHashByContractAddress(QueryByContractAddressRequest)
returns (QueryCodeHashResponse) {
option (google.api.http).get =
"/compute/v1beta1/code_hash/{contract_address}";
"/compute/v1beta1/code_hash/by_contract_address/{contract_address}";
}
// Query code hash by code id
rpc CodeHashByCodeID(QueryByCodeIDRequest) returns (QueryCodeHashResponse) {
option (google.api.http).get = "/compute/v1beta1/code_hash/{code_id}";
rpc CodeHashByCodeId(QueryByCodeIdRequest) returns (QueryCodeHashResponse) {
option (google.api.http).get = "/compute/v1beta1/code_hash/by_code_id/{code_id}";
}
// Query contract label by address
rpc LabelByAddress(QueryByContractAddressRequest)
Expand Down Expand Up @@ -75,7 +75,7 @@ message QueryByContractAddressRequest {
string contract_address = 1;
}

message QueryByCodeIDRequest { uint64 code_id = 1; }
message QueryByCodeIdRequest { uint64 code_id = 1; }

message QuerySecretContractResponse { bytes data = 1; }

Expand All @@ -95,7 +95,7 @@ message ContractInfoWithAddress {
[ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ];
}

message QueryContractsByCodeIDResponse {
message QueryContractsByCodeIdResponse {
repeated ContractInfoWithAddress contract_infos = 1
[ (gogoproto.nullable) = false ];
}
Expand Down
2 changes: 1 addition & 1 deletion proto/secret/compute/v1beta1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package secret.compute.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/compute/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
2 changes: 1 addition & 1 deletion proto/secret/intertx/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package secret.intertx.v1beta1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/mauth/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
2 changes: 1 addition & 1 deletion proto/secret/intertx/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/mauth/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
2 changes: 1 addition & 1 deletion proto/secret/registration/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto";
import "secret/registration/v1beta1/types.proto";
import "secret/registration/v1beta1/msg.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/registration/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
4 changes: 2 additions & 2 deletions proto/secret/registration/v1beta1/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package secret.registration.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/registration/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

message RaAuthenticate {
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
bytes certificate = 2 [(gogoproto.casttype) = "github.com/enigmampc/SecretNetwork/x/registration/remote_attestation.Certificate", (gogoproto.jsontag) = "ra_cert"];
bytes certificate = 2 [(gogoproto.casttype) = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation.Certificate", (gogoproto.jsontag) = "ra_cert"];
}

message MasterCertificate {
Expand Down
2 changes: 1 addition & 1 deletion proto/secret/registration/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/api/annotations.proto";
import "secret/registration/v1beta1/msg.proto";
import "secret/registration/v1beta1/genesis.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/registration/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package secret.registration.remote_attestation.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/registration/remote_attestation";
option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down
4 changes: 2 additions & 2 deletions proto/secret/registration/v1beta1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package secret.registration.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/enigmampc/SecretNetwork/x/registration/internal/types";
option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand All @@ -13,6 +13,6 @@ message SeedConfig {
}

message RegistrationNodeInfo {
bytes certificate = 1 [(gogoproto.casttype) = "github.com/enigmampc/SecretNetwork/x/registration/remote_attestation.Certificate"];
bytes certificate = 1 [(gogoproto.casttype) = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation.Certificate"];
bytes encrypted_seed = 2;
}
2 changes: 1 addition & 1 deletion scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ done
#$(find "$(pwd)/third_party/proto/ibc" -maxdepth 4 -name '*.proto')

# move proto files to the right places
cp -r github.com/enigmampc/SecretNetwork/* ./
cp -r github.com/scrtlabs/SecretNetwork/* ./
rm -rf github.com
58 changes: 29 additions & 29 deletions x/compute/internal/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 256d9b2

Please sign in to comment.