Skip to content

Commit

Permalink
build(buf): Change buf.build package name (#453)
Browse files Browse the repository at this point in the history
* Change proto package name

* Activate buf breaking linter

* buf format -w

* Change DID and Resources URL structures

* make proto-gen
  • Loading branch information
ankurdotb authored Nov 25, 2022
1 parent ad5cc96 commit c8827fb
Show file tree
Hide file tree
Showing 29 changed files with 317 additions and 321 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
- uses: bufbuild/buf-lint-action@v1

# Breaking change detection
# - uses: bufbuild/buf-breaking-action@v1
# with:
# input: 'proto'
# against: 'https://github.com/cheqd/cheqd-node.git#branch=develop,ref=HEAD~1,subdir=proto'
- uses: bufbuild/buf-breaking-action@v1
with:
input: 'proto'
against: 'https://github.com/cheqd/cheqd-node.git#branch=develop,ref=HEAD~1,subdir=proto'

super-lint:
name: "Super Linter"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/tendermint/tendermint v0.34.22
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959
google.golang.org/grpc v1.50.0
google.golang.org/grpc v1.50.1
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1607,8 +1607,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.50.0 h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
Expand Down
2 changes: 1 addition & 1 deletion proto/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

version: v1

name: buf.build/cheqd/cheqd-proto
name: buf.build/cheqd/proto

deps:
- buf.build/cosmos/cosmos-sdk
Expand Down
6 changes: 3 additions & 3 deletions proto/cheqd/did/v1/did.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package cheqdid.cheqdnode.cheqd.v1;

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

import "google/protobuf/any.proto";
import "cheqd/did/v1/common.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

message Did {
repeated string context = 1; // optional
Expand Down
4 changes: 2 additions & 2 deletions proto/cheqd/did/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package cheqdid.cheqdnode.cheqd.v1;

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

import "cheqd/did/v1/stateValue.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

// GenesisState defines the cheqd module's genesis state.
message GenesisState {
string did_namespace = 1;
Expand Down
17 changes: 8 additions & 9 deletions proto/cheqd/did/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
syntax = "proto3";
package cheqdid.cheqdnode.cheqd.v1;

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

import "google/api/annotations.proto";
import "cheqd/did/v1/did.proto";
import "cheqd/did/v1/stateValue.proto";
import "google/api/annotations.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

// Query defines the gRPC querier service.
service Query {
rpc Did(QueryGetDidRequest) returns (QueryGetDidResponse) {
option (google.api.http).get = "/cheqd/v1/did/{id}";
}
rpc Did(QueryGetDidRequest) returns (QueryGetDidResponse) {
option (google.api.http).get = "/cheqd/v1/did/{id}";
}
}

message QueryGetDidRequest {
string id = 1;
string id = 1;
}

message QueryGetDidResponse {
Did did = 1;
Metadata metadata = 2;
Did did = 1;
Metadata metadata = 2;
}
1 change: 1 addition & 0 deletions proto/cheqd/did/v1/stateValue.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";
package cheqdid.cheqdnode.cheqd.v1;

import "google/protobuf/any.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";
Expand Down
11 changes: 5 additions & 6 deletions proto/cheqd/did/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package cheqdid.cheqdnode.cheqd.v1;

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

import "google/protobuf/any.proto";
import "cheqd/did/v1/did.proto";
import "cheqd/did/v1/stateValue.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types/v1";

// Msg defines the Msg service.
service Msg {
Expand All @@ -30,7 +30,6 @@ message MsgDeactivateDid {
repeated SignInfo signatures = 2;
}


message SignInfo {
string verification_method_id = 1;
string signature = 2;
Expand All @@ -41,8 +40,8 @@ message MsgDeactivateDidPayload {
}

message MsgDeactivateDidResponse {
Did did = 1;
Metadata metadata = 2;
Did did = 1;
Metadata metadata = 2;
}

message MsgCreateDidPayload {
Expand Down
30 changes: 15 additions & 15 deletions proto/cheqd/did/v2/fee.proto
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
syntax = "proto3";
package cheqd.did.v2;

option go_package = "github.com/cheqd/cheqd-node/x/did/types";
option (gogoproto.equal_all) = true;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cheqd/cheqd-node/x/did/types";
option (gogoproto.equal_all) = true;

// FeeParams defines the parameters for the `did` module fixed fee.
message FeeParams {
// Tx types define the fixed fee each for the `did` module.
map<string, cosmos.base.v1beta1.Coin> tx_types = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"tx_types\""
];
string burn_factor = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
// Tx types define the fixed fee each for the `did` module.
map<string, cosmos.base.v1beta1.Coin> tx_types = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"tx_types\""
];
string burn_factor = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
6 changes: 3 additions & 3 deletions proto/cheqd/did/v2/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ option go_package = "github.com/cheqd/cheqd-node/x/did/types";

service Query {
rpc DidDoc(QueryGetDidDocRequest) returns (QueryGetDidDocResponse) {
option (google.api.http).get = "/cheqd/did/v2/diddoc/{id}";
option (google.api.http).get = "/cheqd/did/v2/{id}";
}
rpc DidDocVersion(QueryGetDidDocVersionRequest) returns (QueryGetDidDocVersionResponse) {
option (google.api.http).get = "/cheqd/did/v2/diddoc/{id}/version/{version}";
option (google.api.http).get = "/cheqd/did/v2/{id}/version/{version}";
}
rpc AllDidDocVersionsMetadata(QueryGetAllDidDocVersionsMetadataRequest) returns (QueryGetAllDidDocVersionsMetadataResponse) {
option (google.api.http).get = "/cheqd/did/v2/diddoc/{id}/metadata";
option (google.api.http).get = "/cheqd/did/v2/{id}/metadata";
}
}

Expand Down
5 changes: 2 additions & 3 deletions proto/cheqd/resource/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
syntax = "proto3";
package cheqdid.cheqdnode.resource.v1;

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

import "cheqd/resource/v1/resource.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

// GenesisState defines the cheqd module's genesis state.
message GenesisState {
repeated Resource resourceList = 1;
}

5 changes: 2 additions & 3 deletions proto/cheqd/resource/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
syntax = "proto3";
package cheqdid.cheqdnode.resource.v1;

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

import "google/api/annotations.proto";
import "cheqd/resource/v1/resource.proto";
import "google/api/annotations.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

// Query defines the gRPC querier service.
service Query {
Expand Down
1 change: 0 additions & 1 deletion proto/cheqd/resource/v1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cheqdid.cheqdnode.resource.v1;

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";


message Resource {
ResourceHeader header = 1;
bytes data = 2;
Expand Down
4 changes: 2 additions & 2 deletions proto/cheqd/resource/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package cheqdid.cheqdnode.resource.v1;

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

import "cheqd/did/v1/tx.proto";
import "cheqd/resource/v1/resource.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types/v1";

// Msg defines the Msg service.
service Msg {
rpc CreateResource(MsgCreateResource) returns (MsgCreateResourceResponse);
Expand Down
30 changes: 15 additions & 15 deletions proto/cheqd/resource/v2/fee.proto
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
syntax = "proto3";
package cheqd.resource.v2;

option go_package = "github.com/cheqd/cheqd-node/x/resource/types";
option (gogoproto.equal_all) = true;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types";
option (gogoproto.equal_all) = true;

// FeeParams defines the parameters for the `resource` module fixed fee.
message FeeParams {
// Media types define the fixed fee each for the `resource` module.
map<string, cosmos.base.v1beta1.Coin> media_types = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"media_types\""
];
string burn_factor = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
// Media types define the fixed fee each for the `resource` module.
map<string, cosmos.base.v1beta1.Coin> media_types = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"media_types\""
];
string burn_factor = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
2 changes: 1 addition & 1 deletion proto/cheqd/resource/v2/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package cheqd.resource.v2;

import "cheqd/resource/v2/resource.proto";
import "cheqd/resource/v2/fee.proto";
import "cheqd/resource/v2/resource.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types";

Expand Down
8 changes: 4 additions & 4 deletions proto/cheqd/resource/v2/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ syntax = "proto3";

package cheqd.resource.v2;

import "google/api/annotations.proto";
import "cheqd/resource/v2/resource.proto";
import "google/api/annotations.proto";

option go_package = "github.com/cheqd/cheqd-node/x/resource/types";

service Query {
rpc Resource(QueryGetResourceRequest) returns (QueryGetResourceResponse) {
option (google.api.http).get = "/cheqd/resource/v2/collection/{collection_id}/resources/{id}";
option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/resources/{id}";
}
rpc ResourceMetadata(QueryGetResourceMetadataRequest) returns (QueryGetResourceMetadataResponse) {
option (google.api.http).get = "/cheqd/resource/v2/collection/{collection_id}/resources/{id}/metadata";
option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/resources/{id}/metadata";
}
rpc CollectionResources(QueryGetCollectionResourcesRequest) returns (QueryGetCollectionResourcesResponse) {
option (google.api.http).get = "/cheqd/resource/v2/collection/{collection_id}/resources";
option (google.api.http).get = "/cheqd/resource/v2/{collection_id}/metadata";
}
}

Expand Down
48 changes: 24 additions & 24 deletions x/did/types/fee.pb.go

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

Loading

0 comments on commit c8827fb

Please sign in to comment.