Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Apr 13, 2024
1 parent c5beb34 commit df9dc68
Show file tree
Hide file tree
Showing 14 changed files with 1,300 additions and 293 deletions.
3 changes: 3 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: v1
directories:
- testpb
280 changes: 134 additions & 146 deletions cosmos.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.18
require (
github.com/google/go-cmp v0.6.0
github.com/stretchr/testify v1.9.0
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda
google.golang.org/protobuf v1.33.0
gotest.tools/v3 v3.5.1
pgregory.net/rapid v1.1.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38=
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
23 changes: 12 additions & 11 deletions proto/cosmos_proto/cosmos.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import "google/protobuf/descriptor.proto";

option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto";

extend google.protobuf.ServiceOptions {
extend google.protobuf.MethodOptions {

// since is used to indicate the version at which a service,message,field was added.
string since = 93001;
// method_added_since is used to indicate the version at which a method was added.
string method_added_since = 93001;
}

extend google.protobuf.MessageOptions {
Expand All @@ -19,6 +19,9 @@ extend google.protobuf.MessageOptions {
// interfaces. Interfaces should be declared using a declare_interface
// file option.
repeated string implements_interface = 93001;

// message_added_since is used to indicate the version at which a message was added.
string message_added_since = 93002;
}

extend google.protobuf.FieldOptions {
Expand All @@ -33,6 +36,9 @@ extend google.protobuf.FieldOptions {
// generators may choose to use this information to map this field to a
// language-specific type representing the scalar.
string scalar = 93002;

// field_added_since is used to indicate the version at which a field was added.
string field_added_since = 93003;
}

extend google.protobuf.FileOptions {
Expand All @@ -52,6 +58,9 @@ extend google.protobuf.FileOptions {
// expected that the declaration will be found in a protobuf file named
// a/b/scalars.proto in the file descriptor set.
repeated ScalarDescriptor declare_scalar = 793022;

// file_added_since is used to indicate the version at which a file was added.
string file_added_since = 793023;
}

// InterfaceDescriptor describes an interface type to be used with
Expand Down Expand Up @@ -100,12 +109,4 @@ enum ScalarType {
SCALAR_TYPE_UNSPECIFIED = 0;
SCALAR_TYPE_STRING = 1;
SCALAR_TYPE_BYTES = 2;
}

// SinceDescriptor describes the version at which a service, message or field was added.
// Scalars extend simple protobuf built-in types with additional
// syntax and semantics, for instance to represent versions.
message SinceDescriptor {
// version is the version at which the field was added.
string version = 1;
}
2 changes: 1 addition & 1 deletion testpb/1.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax="proto3";

import "testpb/2.proto";
import "2.proto";

option go_package = "github.com/cosmos/cosmos-proto/testpb";

Expand Down
199 changes: 100 additions & 99 deletions testpb/1.pulsar.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions testpb/2.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
syntax="proto3";

option go_package = "github.com/cosmos/cosmos-proto/testpb";

message ImportedMessage {
Expand Down
72 changes: 36 additions & 36 deletions testpb/2.pulsar.go

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

23 changes: 23 additions & 0 deletions testpb/3.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
syntax="proto3";

import "google/api/annotations.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/cosmos/cosmos-proto/testpb";

// Query defines the gRPC querier service.
service Query {
// CounterQuery queries a counter.
rpc CounterQuery(QueryCounter) returns (CounterQueryResponse) {
option (google.api.http).get = "/counter";
option (cosmos_proto.method_added_since) = "v1.0.1";
}
}

// QueryCounter defines the request type used to query the counter.
message QueryCounter {}

// CounterQueryResponse defines the response type for querying the counter.
message CounterQueryResponse {
uint64 counter = 1 [(cosmos_proto.field_added_since) = "v1.0.1"];
}
Loading

0 comments on commit df9dc68

Please sign in to comment.