mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +00:00
d077483577
* v3 import renamings * tidy * fmt * rev * Update beacon-chain/core/epoch/precompute/reward_penalty_test.go * Update beacon-chain/core/helpers/validators_test.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/iface/BUILD.bazel * Update beacon-chain/db/kv/kv.go * Update beacon-chain/db/kv/state.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/sync/initial-sync/service.go * fix deps * fix bad replacements * fix bad replacements * change back * gohashtree version * fix deps Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Potuz <potuz@prysmaticlabs.com>
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package testing
|
|
|
|
import (
|
|
"context"
|
|
|
|
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
|
v1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1"
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// MockBuilderService to mock builder.
|
|
type MockBuilderService struct {
|
|
HasConfigured bool
|
|
Payload *v1.ExecutionPayload
|
|
ErrSubmitBlindedBlock error
|
|
Bid *ethpb.SignedBuilderBid
|
|
ErrGetHeader error
|
|
ErrRegisterValidator error
|
|
}
|
|
|
|
// Configured for mocking.
|
|
func (s *MockBuilderService) Configured() bool {
|
|
return s.HasConfigured
|
|
}
|
|
|
|
// SubmitBlindedBlock for mocking.
|
|
func (s *MockBuilderService) SubmitBlindedBlock(context.Context, *ethpb.SignedBlindedBeaconBlockBellatrix) (*v1.ExecutionPayload, error) {
|
|
return s.Payload, s.ErrSubmitBlindedBlock
|
|
}
|
|
|
|
// GetHeader for mocking.
|
|
func (s *MockBuilderService) GetHeader(context.Context, types.Slot, [32]byte, [48]byte) (*ethpb.SignedBuilderBid, error) {
|
|
return s.Bid, s.ErrGetHeader
|
|
}
|
|
|
|
// RegisterValidator for mocking.
|
|
func (s *MockBuilderService) RegisterValidator(context.Context, []*ethpb.SignedValidatorRegistrationV1) error {
|
|
return s.ErrRegisterValidator
|
|
}
|