mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-04-19 03:01:06 -04:00
James feedback
This commit is contained in:
@@ -111,6 +111,8 @@ func (s *Service) validateExecutionPayloadEnvelope(ctx context.Context, pid peer
|
||||
return pubsub.ValidationReject, err
|
||||
}
|
||||
|
||||
// For self-build, the state is retrived via how we retrieve for beacon block optimization
|
||||
// For builder index, the state is retrived via head state read only
|
||||
st, err := s.blockVerifyingState(ctx, block)
|
||||
if err != nil {
|
||||
return pubsub.ValidationIgnore, err
|
||||
|
||||
@@ -111,6 +111,18 @@ func TestValidateExecutionPayloadEnvelope_ErrorPathsWithMock(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateExecutionPayloadEnvelope_HappyPath(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s, msg, builderIdx, root := setupExecutionPayloadEnvelopeService(t, 1, 1)
|
||||
s.newExecutionPayloadEnvelopeVerifier = testNewExecutionPayloadEnvelopeVerifier(mockExecutionPayloadEnvelopeVerifier{})
|
||||
|
||||
require.Equal(t, false, s.hasSeenPayloadEnvelope(root, builderIdx))
|
||||
result, err := s.validateExecutionPayloadEnvelope(ctx, "", msg)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, result, pubsub.ValidationAccept)
|
||||
require.Equal(t, true, s.hasSeenPayloadEnvelope(root, builderIdx))
|
||||
}
|
||||
|
||||
type mockExecutionPayloadEnvelopeVerifier struct {
|
||||
errBlockRootSeen error
|
||||
errBlockRootValid error
|
||||
|
||||
Reference in New Issue
Block a user