@@ -161,6 +161,18 @@ func Test_NewSignedBeaconBlock(t *testing.T) {
161161 assert .Equal (t , version .Deneb , b .Version ())
162162 assert .Equal (t , true , b .IsBlinded ())
163163 })
164+ t .Run ("SignedBeaconBlockGloas" , func (t * testing.T ) {
165+ pb := & eth.SignedBeaconBlockGloas {
166+ Block : & eth.BeaconBlockGloas {
167+ Body : & eth.BeaconBlockBodyGloas {},
168+ },
169+ Signature : []byte ("sig" ),
170+ }
171+ b , err := NewSignedBeaconBlock (pb )
172+ require .NoError (t , err )
173+ assert .Equal (t , version .Gloas , b .Version ())
174+ assert .Equal (t , false , b .IsBlinded ())
175+ })
164176 t .Run ("nil" , func (t * testing.T ) {
165177 _ , err := NewSignedBeaconBlock (nil )
166178 assert .ErrorContains (t , "received nil object" , err )
@@ -276,6 +288,13 @@ func Test_NewBeaconBlock(t *testing.T) {
276288 assert .Equal (t , version .Deneb , b .Version ())
277289 assert .Equal (t , true , b .IsBlinded ())
278290 })
291+ t .Run ("BeaconBlockGloas" , func (t * testing.T ) {
292+ pb := & eth.BeaconBlockGloas {Body : & eth.BeaconBlockBodyGloas {}}
293+ b , err := NewBeaconBlock (pb )
294+ require .NoError (t , err )
295+ assert .Equal (t , version .Gloas , b .Version ())
296+ assert .Equal (t , false , b .IsBlinded ())
297+ })
279298 t .Run ("nil" , func (t * testing.T ) {
280299 _ , err := NewBeaconBlock (nil )
281300 assert .ErrorContains (t , "received nil object" , err )
@@ -354,6 +373,15 @@ func Test_NewBeaconBlockBody(t *testing.T) {
354373 assert .Equal (t , version .Deneb , b .version )
355374 assert .Equal (t , true , b .IsBlinded ())
356375 })
376+ t .Run ("BeaconBlockBodyGloas" , func (t * testing.T ) {
377+ pb := & eth.BeaconBlockBodyGloas {}
378+ i , err := NewBeaconBlockBody (pb )
379+ require .NoError (t , err )
380+ b , ok := i .(* BeaconBlockBody )
381+ require .Equal (t , true , ok )
382+ assert .Equal (t , version .Gloas , b .version )
383+ assert .Equal (t , false , b .IsBlinded ())
384+ })
357385 t .Run ("nil" , func (t * testing.T ) {
358386 _ , err := NewBeaconBlockBody (nil )
359387 assert .ErrorContains (t , "received nil object" , err )
@@ -425,6 +453,14 @@ func Test_BuildSignedBeaconBlock(t *testing.T) {
425453 assert .Equal (t , version .Deneb , sb .Version ())
426454 assert .Equal (t , true , sb .IsBlinded ())
427455 })
456+ t .Run ("Gloas" , func (t * testing.T ) {
457+ b := & BeaconBlock {version : version .Gloas , body : & BeaconBlockBody {version : version .Gloas }}
458+ sb , err := BuildSignedBeaconBlock (b , sig [:])
459+ require .NoError (t , err )
460+ assert .DeepEqual (t , sig , sb .Signature ())
461+ assert .Equal (t , version .Gloas , sb .Version ())
462+ assert .Equal (t , false , sb .IsBlinded ())
463+ })
428464}
429465
430466func TestBuildSignedBeaconBlockFromExecutionPayload (t * testing.T ) {
@@ -535,4 +571,21 @@ func TestBuildSignedBeaconBlockFromExecutionPayload(t *testing.T) {
535571 require .DeepEqual (t , uint64 (123 ), payload .ExcessBlobGas )
536572 require .DeepEqual (t , uint64 (321 ), payload .BlobGasUsed )
537573 })
574+ t .Run ("gloas execution unsupported" , func (t * testing.T ) {
575+ base := & SignedBeaconBlock {
576+ version : version .Gloas ,
577+ block : & BeaconBlock {version : version .Gloas , body : & BeaconBlockBody {version : version .Gloas }},
578+ }
579+ blinded := & testBlindedSignedBeaconBlock {SignedBeaconBlock : base }
580+ _ , err := BuildSignedBeaconBlockFromExecutionPayload (blinded , nil )
581+ require .ErrorContains (t , "Execution is not supported for gloas" , err )
582+ })
583+ }
584+
585+ type testBlindedSignedBeaconBlock struct {
586+ * SignedBeaconBlock
587+ }
588+
589+ func (b * testBlindedSignedBeaconBlock ) IsBlinded () bool {
590+ return true
538591}
0 commit comments