mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
E2E deposit testing overhaul (#11667)
* rewrite/refactor deposit testing code keep track of sent deposits so that they can be compared in detail with the validator set retreived from the API. * fix bugs in evaluator and retry * lint + deepsource appeasement * typo s/Sprintf/Printf/ * gosec, more like nosec * fix gosec number - 204->304 * type switch to get signed block from container * improve comments * centralizing constants and adding comments * lock around Depositor to avoid future races Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
This commit is contained in:
@@ -288,3 +288,20 @@ func BuildSignedBeaconBlockFromExecutionPayload(
|
||||
|
||||
return NewSignedBeaconBlock(fullBlock)
|
||||
}
|
||||
|
||||
// BeaconBlockContainerToSignedBeaconBlock converts BeaconBlockContainer (API response) to a SignedBeaconBlock.
|
||||
// This is particularly useful for using the values from API calls.
|
||||
func BeaconBlockContainerToSignedBeaconBlock(obj *eth.BeaconBlockContainer) (interfaces.SignedBeaconBlock, error) {
|
||||
switch obj.Block.(type) {
|
||||
case *eth.BeaconBlockContainer_BlindedBellatrixBlock:
|
||||
return NewSignedBeaconBlock(obj.GetBlindedBellatrixBlock())
|
||||
case *eth.BeaconBlockContainer_BellatrixBlock:
|
||||
return NewSignedBeaconBlock(obj.GetBellatrixBlock())
|
||||
case *eth.BeaconBlockContainer_AltairBlock:
|
||||
return NewSignedBeaconBlock(obj.GetAltairBlock())
|
||||
case *eth.BeaconBlockContainer_Phase0Block:
|
||||
return NewSignedBeaconBlock(obj.GetPhase0Block())
|
||||
default:
|
||||
return nil, errors.New("container block type not recognized")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user