mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Change the signature of ProcessPayload (#14610)
This commit is contained in:
@@ -56,10 +56,10 @@ func RunBlockHeaderTest(t *testing.T, config string, fork string, sszToBlock SSZ
|
||||
bodyRoot, err := block.Block().Body().HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
pr := block.Block().ParentRoot()
|
||||
beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Block().Slot(), block.Block().ProposerIndex(), pr[:], bodyRoot[:])
|
||||
_, err = blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Block().Slot(), block.Block().ProposerIndex(), pr[:], bodyRoot[:])
|
||||
if postSSZExists {
|
||||
require.NoError(t, err)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preBeaconState, beaconState)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preBeaconState)
|
||||
} else {
|
||||
// Note: This doesn't test anything worthwhile. It essentially tests
|
||||
// that *any* error has occurred, not any specific error.
|
||||
|
||||
@@ -54,10 +54,10 @@ func RunExecutionPayloadTest(t *testing.T, config string, fork string, sszToBloc
|
||||
config := &ExecutionConfig{}
|
||||
require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal")
|
||||
|
||||
gotState, err := blocks.ProcessPayload(preBeaconState, body)
|
||||
err = blocks.ProcessPayload(preBeaconState, body)
|
||||
if postSSZExists {
|
||||
require.NoError(t, err)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preBeaconState, gotState)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preBeaconState)
|
||||
} else if config.Valid {
|
||||
// Note: This doesn't test anything worthwhile. It essentially tests
|
||||
// that *any* error has occurred, not any specific error.
|
||||
|
||||
@@ -50,10 +50,10 @@ func RunBlockOperationTest(
|
||||
}
|
||||
|
||||
helpers.ClearCache()
|
||||
beaconState, err := operationFn(context.Background(), preState, wsb)
|
||||
_, err = operationFn(context.Background(), preState, wsb)
|
||||
if postSSZExists {
|
||||
require.NoError(t, err)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preState, beaconState)
|
||||
comparePostState(t, postSSZFilepath, sszToState, preState)
|
||||
} else {
|
||||
// Note: This doesn't test anything worthwhile. It essentially tests
|
||||
// that *any* error has occurred, not any specific error.
|
||||
@@ -65,7 +65,7 @@ func RunBlockOperationTest(
|
||||
}
|
||||
}
|
||||
|
||||
func comparePostState(t *testing.T, postSSZFilepath string, sszToState SSZToState, want state.BeaconState, got state.BeaconState) {
|
||||
func comparePostState(t *testing.T, postSSZFilepath string, sszToState SSZToState, want state.BeaconState) {
|
||||
postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304
|
||||
require.NoError(t, err)
|
||||
postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile)
|
||||
|
||||
Reference in New Issue
Block a user