@@ -503,6 +503,32 @@ func Test_BeaconBlockBody_Execution(t *testing.T) {
503503 gas , err = eDenebHeader .ExcessBlobGas ()
504504 require .NoError (t , err )
505505 require .DeepEqual (t , gas , uint64 (223 ))
506+
507+ bb = & SignedBeaconBlock {version : version .Gloas , block : & BeaconBlock {version : version .Gloas , body : & BeaconBlockBody {version : version .Gloas }}}
508+ _ , err = bb .Block ().Body ().Execution ()
509+ require .ErrorIs (t , err , consensus_types .ErrUnsupportedField )
510+ }
511+
512+ func Test_BeaconBlockBody_ExecutionRequests (t * testing.T ) {
513+ t .Run ("unsupported before Electra" , func (t * testing.T ) {
514+ bb := & BeaconBlockBody {version : version .Deneb }
515+ _ , err := bb .ExecutionRequests ()
516+ require .ErrorIs (t , err , consensus_types .ErrUnsupportedField )
517+ })
518+
519+ t .Run ("electra returns requests" , func (t * testing.T ) {
520+ reqs := & pb.ExecutionRequests {}
521+ bb := & BeaconBlockBody {version : version .Electra , executionRequests : reqs }
522+ result , err := bb .ExecutionRequests ()
523+ require .NoError (t , err )
524+ require .Equal (t , reqs , result )
525+ })
526+
527+ t .Run ("unsupported for Gloas" , func (t * testing.T ) {
528+ bb := & BeaconBlockBody {version : version .Gloas }
529+ _ , err := bb .ExecutionRequests ()
530+ require .ErrorIs (t , err , consensus_types .ErrUnsupportedField )
531+ })
506532}
507533
508534func Test_BeaconBlockBody_HashTreeRoot (t * testing.T ) {
0 commit comments