From 419549843fc9e093638a75008939b7c79c33f3e2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:04:16 -0400 Subject: [PATCH] decouple grpc and non validating full node flags (#1400) (#1414) (cherry picked from commit 2fffe31d74bd4d6367be779ffd8c7f7505156bf7) Co-authored-by: jayy04 <103467857+jayy04@users.noreply.github.com> --- protocol/app/flags/flags.go | 4 ---- protocol/app/flags/flags_test.go | 15 +++++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/protocol/app/flags/flags.go b/protocol/app/flags/flags.go index 18fa78a19b..a900e81b40 100644 --- a/protocol/app/flags/flags.go +++ b/protocol/app/flags/flags.go @@ -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 } diff --git a/protocol/app/flags/flags_test.go b/protocol/app/flags/flags_test.go index c170ec864f..dd6f12db85 100644 --- a/protocol/app/flags/flags_test.go +++ b/protocol/app/flags/flags_test.go @@ -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{