mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
adding nil checks on attestation interface (#14638)
* adding nil checks on interface * changelog * add linting * adding missed checks * review feedback * attestation bits should not be in nil check * fixing nil checks * simplifying function * fixing some missed items * more missed items * fixing more tests * reverting some changes and fixing more tests * adding in source check back in * missed test * sammy's review * radek feedback
This commit is contained in:
@@ -131,10 +131,9 @@ func (s *Store) SaveAttestationForPubKey(
|
||||
att ethpb.IndexedAtt,
|
||||
) error {
|
||||
// If there is no attestation, return on error.
|
||||
if att == nil || att.GetData() == nil || att.GetData().Source == nil || att.GetData().Target == nil {
|
||||
if att == nil || att.IsNil() || att.GetData().Source == nil || att.GetData().Target == nil {
|
||||
return errors.New("incoming attestation does not contain source and/or target epoch")
|
||||
}
|
||||
|
||||
// Get validator slashing protection.
|
||||
validatorSlashingProtection, err := s.validatorSlashingProtection(pubkey)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user