testutil

package
v4.0.0-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveKey = bytesutil.ToBytes48([]byte("active"))

ActiveKey represents a public key whose status is ACTIVE.

View Source
var AllValidatorsAreExitedCtxKey = ctxKey("exited")

AllValidatorsAreExitedCtxKey represents the metadata context key used for exits.

Functions

func GenerateMultipleValidatorStatusResponse

func GenerateMultipleValidatorStatusResponse(pubkeys [][]byte) *ethpb.MultipleValidatorStatusResponse

GenerateMultipleValidatorStatusResponse prepares a response from the passed in keys.

Types

type FakeValidator

type FakeValidator struct {
	DoneCalled                        bool
	WaitForWalletInitializationCalled bool
	SlasherReadyCalled                bool
	NextSlotCalled                    bool
	UpdateDutiesCalled                bool
	UpdateProtectionsCalled           bool
	RoleAtCalled                      bool
	AttestToBlockHeadCalled           bool
	ProposeBlockCalled                bool
	LogValidatorGainsAndLossesCalled  bool
	SaveProtectionsCalled             bool
	DeleteProtectionCalled            bool
	SlotDeadlineCalled                bool
	HandleKeyReloadCalled             bool
	WaitForChainStartCalled           int
	WaitForSyncCalled                 int
	WaitForActivationCalled           int
	CanonicalHeadSlotCalled           int
	ReceiveBlocksCalled               int
	RetryTillSuccess                  int
	ProposeBlockArg1                  uint64
	AttestToBlockHeadArg1             uint64
	RoleAtArg1                        uint64
	UpdateDutiesArg1                  uint64
	NextSlotRet                       <-chan primitives.Slot
	PublicKey                         string
	UpdateDutiesRet                   error
	ProposerSettingsErr               error
	RolesAtRet                        []iface.ValidatorRole
	Balances                          map[[fieldparams.BLSPubkeyLength]byte]uint64
	IndexToPubkeyMap                  map[uint64][fieldparams.BLSPubkeyLength]byte
	PubkeyToIndexMap                  map[[fieldparams.BLSPubkeyLength]byte]uint64
	PubkeysToStatusesMap              map[[fieldparams.BLSPubkeyLength]byte]ethpb.ValidatorStatus

	ProposerSettingWait time.Duration
	Km                  keymanager.IKeymanager
	// contains filtered or unexported fields
}

FakeValidator for mocking.

func (*FakeValidator) AllValidatorsAreExited

func (_ *FakeValidator) AllValidatorsAreExited(ctx context.Context) (bool, error)

AllValidatorsAreExited for mocking

func (*FakeValidator) BalancesByPubkeys

func (fv *FakeValidator) BalancesByPubkeys(_ context.Context) map[[fieldparams.BLSPubkeyLength]byte]uint64

BalancesByPubkeys for mocking.

func (*FakeValidator) CanonicalHeadSlot

func (fv *FakeValidator) CanonicalHeadSlot(_ context.Context) (primitives.Slot, error)

CanonicalHeadSlot for mocking.

func (*FakeValidator) CheckDoppelGanger

func (_ *FakeValidator) CheckDoppelGanger(_ context.Context) error

CheckDoppelGanger for mocking

func (*FakeValidator) Done

func (fv *FakeValidator) Done()

Done for mocking.

func (*FakeValidator) HandleKeyReload

func (fv *FakeValidator) HandleKeyReload(_ context.Context, newKeys [][fieldparams.BLSPubkeyLength]byte) (anyActive bool, err error)

HandleKeyReload for mocking

func (*FakeValidator) HasProposerSettings

func (*FakeValidator) HasProposerSettings() bool

HasProposerSettings for mocking

func (*FakeValidator) IndicesToPubkeys

func (fv *FakeValidator) IndicesToPubkeys(_ context.Context) map[uint64][fieldparams.BLSPubkeyLength]byte

IndicesToPubkeys for mocking.

func (*FakeValidator) Keymanager

func (fv *FakeValidator) Keymanager() (keymanager.IKeymanager, error)

Keymanager for mocking

func (*FakeValidator) LogAttestationsSubmitted

func (_ *FakeValidator) LogAttestationsSubmitted()

LogAttestationsSubmitted for mocking.

func (*FakeValidator) LogSyncCommitteeMessagesSubmitted

func (fv *FakeValidator) LogSyncCommitteeMessagesSubmitted()

LogSyncCommitteeMessagesSubmitted --

func (*FakeValidator) LogValidatorGainsAndLosses

func (fv *FakeValidator) LogValidatorGainsAndLosses(_ context.Context, _ primitives.Slot) error

LogValidatorGainsAndLosses for mocking.

func (*FakeValidator) NextSlot

func (fv *FakeValidator) NextSlot() <-chan primitives.Slot

NextSlot for mocking.

func (*FakeValidator) ProposeBlock

ProposeBlock for mocking.

func (*FakeValidator) ProposerSettings

func (f *FakeValidator) ProposerSettings() *validatorserviceconfig.ProposerSettings

ProposerSettings for mocking

func (*FakeValidator) PubkeysToIndices

func (fv *FakeValidator) PubkeysToIndices(_ context.Context) map[[fieldparams.BLSPubkeyLength]byte]uint64

PubkeysToIndices for mocking.

func (*FakeValidator) PubkeysToStatuses

PubkeysToStatuses for mocking.

func (*FakeValidator) PushProposerSettings

func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, deadline time.Time) error

PushProposerSettings for mocking

func (*FakeValidator) ReceiveBlocks

func (fv *FakeValidator) ReceiveBlocks(_ context.Context, connectionErrorChannel chan<- error)

ReceiveBlocks for mocking

func (*FakeValidator) ResetAttesterProtectionData

func (fv *FakeValidator) ResetAttesterProtectionData()

ResetAttesterProtectionData for mocking.

func (*FakeValidator) RolesAt

RolesAt for mocking.

func (*FakeValidator) SetProposerSettings

func (f *FakeValidator) SetProposerSettings(settings *validatorserviceconfig.ProposerSettings)

SetProposerSettings for mocking

func (*FakeValidator) SetPubKeyToValidatorIndexMap

func (_ *FakeValidator) SetPubKeyToValidatorIndexMap(_ context.Context, _ keymanager.IKeymanager) error

SetPubKeyToValidatorIndexMap for mocking

func (*FakeValidator) SignValidatorRegistrationRequest

SignValidatorRegistrationRequest for mocking

func (*FakeValidator) SlasherReady

func (fv *FakeValidator) SlasherReady(_ context.Context) error

SlasherReady for mocking.

func (*FakeValidator) SlotDeadline

func (fv *FakeValidator) SlotDeadline(_ primitives.Slot) time.Time

SlotDeadline for mocking.

func (*FakeValidator) SubmitAggregateAndProof

func (_ *FakeValidator) SubmitAggregateAndProof(_ context.Context, _ primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte)

SubmitAggregateAndProof for mocking.

func (*FakeValidator) SubmitAttestation

func (fv *FakeValidator) SubmitAttestation(_ context.Context, slot primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte)

SubmitAttestation for mocking.

func (*FakeValidator) SubmitSignedContributionAndProof

func (_ *FakeValidator) SubmitSignedContributionAndProof(_ context.Context, _ primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte)

SubmitSignedContributionAndProof for mocking

func (*FakeValidator) SubmitSyncCommitteeMessage

func (_ *FakeValidator) SubmitSyncCommitteeMessage(_ context.Context, _ primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte)

SubmitSyncCommitteeMessage for mocking.

func (*FakeValidator) UpdateDomainDataCaches

func (_ *FakeValidator) UpdateDomainDataCaches(context.Context, primitives.Slot)

UpdateDomainDataCaches for mocking.

func (*FakeValidator) UpdateDuties

func (fv *FakeValidator) UpdateDuties(_ context.Context, slot primitives.Slot) error

UpdateDuties for mocking.

func (*FakeValidator) UpdateProtections

func (fv *FakeValidator) UpdateProtections(_ context.Context, _ uint64) error

UpdateProtections for mocking.

func (*FakeValidator) WaitForActivation

func (fv *FakeValidator) WaitForActivation(_ context.Context, accountChan chan [][fieldparams.BLSPubkeyLength]byte) error

WaitForActivation for mocking.

func (*FakeValidator) WaitForChainStart

func (fv *FakeValidator) WaitForChainStart(_ context.Context) error

WaitForChainStart for mocking.

func (*FakeValidator) WaitForKeymanagerInitialization

func (fv *FakeValidator) WaitForKeymanagerInitialization(_ context.Context) error

WaitForKeymanagerInitialization for mocking.

func (*FakeValidator) WaitForSync

func (fv *FakeValidator) WaitForSync(_ context.Context) error

WaitForSync for mocking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL