From c4deb84012d201d9feced1e6101591cd97b0b004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 1 Sep 2022 05:40:20 +0200 Subject: [PATCH] Simplify `BeaconBlockIsNil()` (#11373) * Simplify `BeaconBlockIsNil()` * remove unused code Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- consensus-types/blocks/factory.go | 2 -- consensus-types/blocks/getters.go | 6 ------ 2 files changed, 8 deletions(-) diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index f64fda8bb2..c262c9676a 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -24,8 +24,6 @@ var ( ErrNilObject = errors.New("received nil object") // ErrNilSignedBeaconBlock is returned when a nil signed beacon block is received. ErrNilSignedBeaconBlock = errors.New("signed beacon block can't be nil") - errNilBeaconBlock = errors.New("beacon block can't be nil") - errNilBeaconBlockBody = errors.New("beacon block body can't be nil") ) // NewSignedBeaconBlock creates a signed beacon block from a protobuf signed beacon block. diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 21483c991d..00c1b5af3b 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -17,12 +17,6 @@ func BeaconBlockIsNil(b interfaces.SignedBeaconBlock) error { if b == nil || b.IsNil() { return ErrNilSignedBeaconBlock } - if b.Block().IsNil() { - return errNilBeaconBlock - } - if b.Block().Body().IsNil() { - return errNilBeaconBlockBody - } return nil }