Skip to content

Commit

Permalink
Remove the grpc.CallOption field from ordered RPCs
Browse files Browse the repository at this point in the history
The field was not actually used for anything.
Removing it required some changes to the template variables though, as
one-way calls and RPCs do not have the same dependencies.
  • Loading branch information
johningve authored and meling committed Jul 20, 2020
1 parent 1765679 commit 85ea364
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
3 changes: 1 addition & 2 deletions cmd/protoc-gen-gorums/dev/zorums_ordered_gorums.pb.go

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

7 changes: 5 additions & 2 deletions cmd/protoc-gen-gorums/gengorums/template_ordered_qc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ var orderingVariables = `
{{$unexportMethod := unexport .Method.GoName}}
`

var orderedRPCVariables = orderingVariables + `
{{$context := use "context.Context" .GenFile}}
`

var orderedQCSignature = `func (c *Configuration) {{$method}}(` +
`ctx {{$context}}, in *{{$in}}` +
`{{perNodeFnType .GenFile .Method ", f"}})` +
Expand Down Expand Up @@ -85,8 +89,7 @@ var orderingReply = `
`

var orderingQC = commonVariables +
quorumCallVariables +
orderingVariables +
orderedRPCVariables +
quorumCallComment +
orderedQCSignature +
orderingPreamble +
Expand Down
6 changes: 2 additions & 4 deletions cmd/protoc-gen-gorums/gengorums/template_ordered_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package gengorums
var orderingRPCComment = `{{.Method.Comments.Leading}}`

var orderingRPCSignature = `func (n *Node) {{$method}}(` +
`ctx {{$context}}, in *{{$in}}, ` +
`opts ...{{$opts}})` +
`ctx {{$context}}, in *{{$in}}) ` +
`(resp *{{$out}}, err error) {
`

Expand Down Expand Up @@ -42,8 +41,7 @@ var orderingRPCBody = `
`

var orderingRPC = commonVariables +
quorumCallVariables +
orderingVariables +
orderedRPCVariables +
orderingRPCComment +
orderingRPCSignature +
orderingRPCPreamble +
Expand Down
17 changes: 9 additions & 8 deletions examples/storage/proto/storage_gorums.pb.go

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

0 comments on commit 85ea364

Please sign in to comment.