Skip to content

Commit dca25e2

Browse files
committed
Better conditions for Execution()
1 parent 9646238 commit dca25e2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

consensus-types/blocks/getters.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,15 +1242,13 @@ func (b *BeaconBlockBody) SyncAggregate() (*eth.SyncAggregate, error) {
12421242

12431243
// Execution returns the execution payload of the block body.
12441244
func (b *BeaconBlockBody) Execution() (interfaces.ExecutionData, error) {
1245-
switch b.version {
1246-
case version.Phase0, version.Altair, version.Gloas:
1245+
if b.version <= version.Altair || b.version >= version.Gloas {
12471246
return nil, consensus_types.ErrNotSupported("Execution", b.version)
1248-
default:
1249-
if b.IsBlinded() {
1250-
return b.executionPayloadHeader, nil
1251-
}
1252-
return b.executionPayload, nil
12531247
}
1248+
if b.IsBlinded() {
1249+
return b.executionPayloadHeader, nil
1250+
}
1251+
return b.executionPayload, nil
12541252
}
12551253

12561254
func (b *BeaconBlockBody) BLSToExecutionChanges() ([]*eth.SignedBLSToExecutionChange, error) {

0 commit comments

Comments
 (0)