mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
|
package testing
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
||
|
"github.com/prysmaticlabs/prysm/v3/encoding/bytesutil"
|
||
|
v1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1"
|
||
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
||
|
)
|
||
|
|
||
|
// MockClient is a mock implementation of BuilderClient.
|
||
|
type MockClient struct {
|
||
|
RegisteredVals map[[48]byte]bool
|
||
|
}
|
||
|
|
||
|
// NewClient creates a new, correctly initialized mock.
|
||
|
func NewClient() MockClient {
|
||
|
return MockClient{RegisteredVals: map[[48]byte]bool{}}
|
||
|
}
|
||
|
|
||
|
// NodeURL --
|
||
|
func (MockClient) NodeURL() string {
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
// GetHeader --
|
||
|
func (MockClient) GetHeader(_ context.Context, _ types.Slot, _ [32]byte, _ [48]byte) (*ethpb.SignedBuilderBid, error) {
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
// RegisterValidator --
|
||
|
func (m MockClient) RegisterValidator(_ context.Context, svr []*ethpb.SignedValidatorRegistrationV1) error {
|
||
|
for _, r := range svr {
|
||
|
b := bytesutil.ToBytes48(r.Message.Pubkey)
|
||
|
m.RegisteredVals[b] = true
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// SubmitBlindedBlock --
|
||
|
func (MockClient) SubmitBlindedBlock(_ context.Context, _ *ethpb.SignedBlindedBeaconBlockBellatrix) (*v1.ExecutionPayload, error) {
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
// Status --
|
||
|
func (MockClient) Status(_ context.Context) error {
|
||
|
return nil
|
||
|
}
|