mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-04-19 03:01:06 -04:00
**What type of PR is this?**
Feature
**What does this PR do? Why is it needed?**
adding gloas block return on `/eth/v2/beacon/blocks/{block_id}` endpoint
-
[/eth/v1/beacon/blocks/{block_id}/root](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlockRoot)
should inherit this as well
reference
https://github.com/ethereum/beacon-APIs/pull/552/files#r2722805266
**Which issues(s) does this PR fix?**
Fixes #
**Other notes for review**
**Acknowledgements**
- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
100 lines
4.4 KiB
Go
100 lines
4.4 KiB
Go
package util
|
|
|
|
import (
|
|
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Bellatrix
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockBellatrix creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockBellatrix() *ethpb.SignedBeaconBlockBellatrix {
|
|
return HydrateSignedBeaconBlockBellatrix(ðpb.SignedBeaconBlockBellatrix{})
|
|
}
|
|
|
|
// NewBlindedBeaconBlockBellatrix creates a blinded beacon block with minimum marshalable fields.
|
|
func NewBlindedBeaconBlockBellatrix() *ethpb.SignedBlindedBeaconBlockBellatrix {
|
|
return HydrateSignedBlindedBeaconBlockBellatrix(ðpb.SignedBlindedBeaconBlockBellatrix{})
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Capella
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockCapella creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockCapella() *ethpb.SignedBeaconBlockCapella {
|
|
return HydrateSignedBeaconBlockCapella(ðpb.SignedBeaconBlockCapella{})
|
|
}
|
|
|
|
// NewBlindedBeaconBlockCapella creates a blinded beacon block with minimum marshalable fields.
|
|
func NewBlindedBeaconBlockCapella() *ethpb.SignedBlindedBeaconBlockCapella {
|
|
return HydrateSignedBlindedBeaconBlockCapella(ðpb.SignedBlindedBeaconBlockCapella{})
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Deneb
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockDeneb creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb {
|
|
return HydrateSignedBeaconBlockDeneb(ðpb.SignedBeaconBlockDeneb{})
|
|
}
|
|
|
|
// NewBeaconBlockContentsDeneb creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockContentsDeneb() *ethpb.SignedBeaconBlockContentsDeneb {
|
|
return HydrateSignedBeaconBlockContentsDeneb(ðpb.SignedBeaconBlockContentsDeneb{})
|
|
}
|
|
|
|
// NewBlindedBeaconBlockDeneb creates a blinded beacon block with minimum marshalable fields.
|
|
func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb {
|
|
return HydrateSignedBlindedBeaconBlockDeneb(ðpb.SignedBlindedBeaconBlockDeneb{})
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Electra
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockElectra creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockElectra() *ethpb.SignedBeaconBlockElectra {
|
|
return HydrateSignedBeaconBlockElectra(ðpb.SignedBeaconBlockElectra{})
|
|
}
|
|
|
|
// NewBeaconBlockContentsElectra creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockContentsElectra() *ethpb.SignedBeaconBlockContentsElectra {
|
|
return HydrateSignedBeaconBlockContentsElectra(ðpb.SignedBeaconBlockContentsElectra{})
|
|
}
|
|
|
|
// NewBlindedBeaconBlockElectra creates a blinded beacon block with minimum marshalable fields.
|
|
func NewBlindedBeaconBlockElectra() *ethpb.SignedBlindedBeaconBlockElectra {
|
|
return HydrateSignedBlindedBeaconBlockElectra(ðpb.SignedBlindedBeaconBlockElectra{})
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Fulu
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockFulu creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockFulu() *ethpb.SignedBeaconBlockFulu {
|
|
return HydrateSignedBeaconBlockFulu(ðpb.SignedBeaconBlockFulu{})
|
|
}
|
|
|
|
// NewBeaconBlockContentsFulu creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockContentsFulu() *ethpb.SignedBeaconBlockContentsFulu {
|
|
return HydrateSignedBeaconBlockContentsFulu(ðpb.SignedBeaconBlockContentsFulu{})
|
|
}
|
|
|
|
// NewBlindedBeaconBlockFulu creates a blinded beacon block with minimum marshalable fields.
|
|
func NewBlindedBeaconBlockFulu() *ethpb.SignedBlindedBeaconBlockFulu {
|
|
return HydrateSignedBlindedBeaconBlockFulu(ðpb.SignedBlindedBeaconBlockFulu{})
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Gloas
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// NewBeaconBlockGloas creates a beacon block with minimum marshalable fields.
|
|
func NewBeaconBlockGloas() *ethpb.SignedBeaconBlockGloas {
|
|
return HydrateSignedBeaconBlockGloas(ðpb.SignedBeaconBlockGloas{})
|
|
}
|