Skip to content

Commit

Permalink
chore: little proto fixes (backport #13883) (#14114)
Browse files Browse the repository at this point in the history
* chore: fix `make proto-all` (#13883)

(cherry picked from commit 3c565b1)

* updates

Co-authored-by: Ruslan Akhtariev <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
3 people authored Dec 1, 2022
1 parent d80078f commit 2bd2e13
Show file tree
Hide file tree
Showing 12 changed files with 382 additions and 367 deletions.
10 changes: 5 additions & 5 deletions orm/internal/codegen/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type queryProtoGen struct {
func (g queryProtoGen) gen() error {
g.imports[g.Desc.Path()] = true

g.svc.F("// %s queries the state of the tables specified by %s.", g.queryServiceName(), g.Desc.Path())
g.svc.F("service %s {", g.queryServiceName())
g.svc.F("// %sService queries the state of the tables specified by %s.", g.queryServiceName(), g.Desc.Path())
g.svc.F("service %sService {", g.queryServiceName())
g.svc.Indent()
for _, msg := range g.Messages {
tableDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor)
Expand Down Expand Up @@ -84,7 +84,7 @@ func (g queryProtoGen) gen() error {
func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.TableDescriptor) error {
name := msg.Desc.Name()
g.svc.F("// Get queries the %s table by its primary key.", name)
g.svc.F("rpc Get%s (Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway
g.svc.F("rpc Get%s(Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway

g.startRequestType("Get%sRequest", name)
g.msgs.Indent()
Expand Down Expand Up @@ -118,7 +118,7 @@ func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.Tab
fieldsCamel := fieldsToCamelCase(idx.Fields)
methodName := fmt.Sprintf("Get%sBy%s", name, fieldsCamel)
g.svc.F("// %s queries the %s table by its %s index", methodName, name, fieldsCamel)
g.svc.F("rpc %s (%sRequest) returns (%sResponse) {}", methodName, methodName, methodName) // TODO grpc gateway
g.svc.F("rpc %s(%sRequest) returns (%sResponse) {}", methodName, methodName, methodName) // TODO grpc gateway

g.startRequestType("%sRequest", methodName)
g.msgs.Indent()
Expand All @@ -144,7 +144,7 @@ func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.Tab

g.imports["cosmos/base/query/v1beta1/pagination.proto"] = true
g.svc.F("// List%s queries the %s table using prefix and range queries against defined indexes.", name, name)
g.svc.F("rpc List%s (List%sRequest) returns (List%sResponse) {}", name, name, name) // TODO grpc gateway
g.svc.F("rpc List%s(List%sRequest) returns (List%sResponse) {}", name, name, name) // TODO grpc gateway
g.startRequestType("List%sRequest", name)
g.msgs.Indent()
g.msgs.F("// IndexKey specifies the value of an index key to use in prefix and range queries.")
Expand Down
1 change: 0 additions & 1 deletion orm/internal/testpb/bank.cosmos_orm.go

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

2 changes: 1 addition & 1 deletion orm/internal/testpb/bank.pb.go

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

78 changes: 41 additions & 37 deletions orm/internal/testpb/bank_query.pb.go

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

4 changes: 2 additions & 2 deletions orm/internal/testpb/bank_query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package testpb;
import "cosmos/base/query/v1beta1/pagination.proto";
import "testpb/bank.proto";

// BankQuery queries the state of the tables specified by testpb/bank.proto.
service BankQuery {
// BankQueryService queries the state of the tables specified by testpb/bank.proto.
service BankQueryService {
// Get queries the Balance table by its primary key.
rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) {}
// ListBalance queries the Balance table using prefix and range queries against defined indexes.
Expand Down
Loading

0 comments on commit 2bd2e13

Please sign in to comment.