mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
Revert grpc error in db package (#2076)
* Revert "status err code"
This reverts commit 27112ff284.
* imports
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user