mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Filter Errored Keys from Returned Slashing Protection History in Standard API (#9968)
* add err condition * naming
This commit is contained in:
@@ -90,8 +90,14 @@ func (s *Server) DeleteKeystores(
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not delete keys: %v", err)
|
||||
}
|
||||
keysToFilter := req.PublicKeys
|
||||
exportedHistory, err := slashingprotection.ExportStandardProtectionJSON(ctx, s.valDB, keysToFilter...)
|
||||
// We select keys that were deleted for retrieving slashing protection history.
|
||||
filteredKeys := make([][]byte, 0, len(req.PublicKeys))
|
||||
for i, st := range statuses {
|
||||
if st.Status != ethpbservice.DeletedKeystoreStatus_ERROR {
|
||||
filteredKeys = append(filteredKeys, req.PublicKeys[i])
|
||||
}
|
||||
}
|
||||
exportedHistory, err := slashingprotection.ExportStandardProtectionJSON(ctx, s.valDB, filteredKeys...)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(
|
||||
codes.Internal,
|
||||
|
||||
Reference in New Issue
Block a user