Revert grpc error in db package (#2076)

* Revert "status err code"

This reverts commit 27112ff2841ae7ccfb7d7eca665e06bbad81755d.

* imports
This commit is contained in:
Preston Van Loon 2019-03-26 16:11:21 -05:00 committed by GitHub
parent 699a8e9087
commit ec41d37cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -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",
],
)

View File

@ -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