From ec41d37cf4ef57283aa5a62fa5f69f4dd562ea48 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 26 Mar 2019 16:11:21 -0500 Subject: [PATCH] Revert grpc error in db package (#2076) * Revert "status err code" This reverts commit 27112ff2841ae7ccfb7d7eca665e06bbad81755d. * imports --- beacon-chain/db/BUILD.bazel | 2 -- beacon-chain/db/validator.go | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/beacon-chain/db/BUILD.bazel b/beacon-chain/db/BUILD.bazel index 6766d52dc..586e97666 100644 --- a/beacon-chain/db/BUILD.bazel +++ b/beacon-chain/db/BUILD.bazel @@ -32,8 +32,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", - "@org_golang_google_grpc//codes:go_default_library", - "@org_golang_google_grpc//status:go_default_library", ], ) diff --git a/beacon-chain/db/validator.go b/beacon-chain/db/validator.go index 8bd1a0593..3e57e56fc 100644 --- a/beacon-chain/db/validator.go +++ b/beacon-chain/db/validator.go @@ -7,8 +7,6 @@ import ( "github.com/boltdb/bolt" "github.com/prysmaticlabs/prysm/shared/hashutil" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // SaveValidatorIndex accepts a public key and validator index and writes them to disk. @@ -41,7 +39,7 @@ func (db *BeaconDB) SaveValidatorIndexBatch(pubKey []byte, index int) error { // ValidatorIndex accepts a public key and returns the corresponding validator index. func (db *BeaconDB) ValidatorIndex(pubKey []byte) (uint64, error) { if !db.HasValidator(pubKey) { - return 0, status.Error(codes.NotFound, fmt.Sprintf("validator %#x does not exist", pubKey)) + return 0, fmt.Errorf("validator %#x does not exist", pubKey) } var index uint64