Skip to content

Commit

Permalink
decouple grpc and non validating full node flags (#1400) (#1414)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2fffe31)

Co-authored-by: jayy04 <[email protected]>
  • Loading branch information
mergify[bot] and jayy04 authored Apr 25, 2024
1 parent 2cd68a9 commit 4195498
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 0 additions & 4 deletions protocol/app/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ func (f *Flags) Validate() error {
if !f.GrpcEnable {
return fmt.Errorf("grpc.enable must be set to true - grpc streaming requires gRPC server")
}

if !f.NonValidatingFullNode {
return fmt.Errorf("grpc-streaming-enabled can only be set to true for non-validating full nodes")
}
}
return nil
}
Expand Down
15 changes: 7 additions & 8 deletions protocol/app/flags/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ func TestValidate(t *testing.T) {
NonValidatingFullNode: true,
},
},
"failure - gRPC disabled": {
flags: flags.Flags{
GrpcEnable: false,
},
expectedErr: fmt.Errorf("grpc.enable must be set to true - validating requires gRPC server"),
},
"failure - gRPC streaming enabled for validating nodes": {
"success - gRPC streaming enabled for validating nodes": {
flags: flags.Flags{
NonValidatingFullNode: false,
GrpcEnable: true,
GrpcStreamingEnabled: true,
},
expectedErr: fmt.Errorf("grpc-streaming-enabled can only be set to true for non-validating full nodes"),
},
"failure - gRPC disabled": {
flags: flags.Flags{
GrpcEnable: false,
},
expectedErr: fmt.Errorf("grpc.enable must be set to true - validating requires gRPC server"),
},
"failure - gRPC streaming enabled with gRPC disabled": {
flags: flags.Flags{
Expand Down

0 comments on commit 4195498

Please sign in to comment.