beacon

package
v1.3.9-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Overview

Package beacon is a generated GoMock package.

Package beacon is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchValidatorsMetadata

func FetchValidatorsMetadata(bc BeaconNode, pubKeys [][]byte) (map[string]*ValidatorMetadata, error)

FetchValidatorsMetadata is fetching validators data from beacon

func UpdateValidatorsMetadata

func UpdateValidatorsMetadata(logger *zap.Logger, pubKeys [][]byte, collection ValidatorMetadataStorage, bc BeaconNode, onUpdated OnUpdated) error

UpdateValidatorsMetadata updates validator information for the given public keys

Types

type BeaconNetwork added in v1.1.0

type BeaconNetwork interface {
	ForkVersion() [4]byte
	MinGenesisTime() uint64
	SlotDurationSec() time.Duration
	SlotsPerEpoch() uint64
	EstimatedCurrentSlot() phase0.Slot
	EstimatedSlotAtTime(time int64) phase0.Slot
	EstimatedTimeAtSlot(slot phase0.Slot) int64
	EstimatedCurrentEpoch() phase0.Epoch
	EstimatedEpochAtSlot(slot phase0.Slot) phase0.Epoch
	FirstSlotAtEpoch(epoch phase0.Epoch) phase0.Slot
	EpochStartTime(epoch phase0.Epoch) time.Time

	GetSlotStartTime(slot phase0.Slot) time.Time
	GetSlotEndTime(slot phase0.Slot) time.Time
	IsFirstSlotOfEpoch(slot phase0.Slot) bool
	GetEpochFirstSlot(epoch phase0.Epoch) phase0.Slot

	EpochsPerSyncCommitteePeriod() uint64
	EstimatedSyncCommitteePeriodAtEpoch(epoch phase0.Epoch) uint64
	FirstEpochOfSyncPeriod(period uint64) phase0.Epoch
	LastSlotOfSyncPeriod(period uint64) phase0.Slot

	GetNetwork() Network
	GetBeaconNetwork() spectypes.BeaconNetwork
}

type BeaconNode added in v1.1.0

type BeaconNode interface {
	specssv.BeaconNode // spec beacon interface
	// contains filtered or unexported methods
}

BeaconNode interface for all beacon duty calls

type DutyData

type DutyData struct {
	// Types that are valid to be assigned to Data:
	//	*InputValueAttestationData
	//	*InputValue_AggregationData
	//	*InputValue_BeaconBlock
	Data IsInputValueData `protobuf_oneof:"data"`
	// Types that are valid to be assigned to SignedData:
	//	*InputValueAttestation
	//	*InputValue_Aggregation
	//	*InputValue_Block
	SignedData IsInputValueSignedData `protobuf_oneof:"signed_data"`
}

DutyData represent unified duty types data

func (*DutyData) GetAttestation

func (m *DutyData) GetAttestation() *phase0.Attestation

GetAttestation return cast attestation input data

func (*DutyData) GetAttestationData

func (m *DutyData) GetAttestationData() *phase0.AttestationData

GetAttestationData return cast input data

func (*DutyData) GetData

func (m *DutyData) GetData() IsInputValueData

GetData returns input data

func (*DutyData) GetSignedData

func (m *DutyData) GetSignedData() IsInputValueSignedData

GetSignedData returns input data

type InputValueAttestation

type InputValueAttestation struct {
	Attestation *phase0.Attestation
}

InputValueAttestation implementing IsInputValueSignedData

type InputValueAttestationData

type InputValueAttestationData struct {
	AttestationData *phase0.AttestationData
}

InputValueAttestationData implementing IsInputValueData

type IsInputValueData

type IsInputValueData interface {
	// contains filtered or unexported methods
}

IsInputValueData interface representing input data

type IsInputValueSignedData

type IsInputValueSignedData interface {
	// contains filtered or unexported methods
}

IsInputValueSignedData interface representing input signed data

type MockBeaconNode added in v1.1.0

type MockBeaconNode struct {
	// contains filtered or unexported fields
}

MockBeaconNode is a mock of BeaconNode interface.

func NewMockBeaconNode added in v1.1.0

func NewMockBeaconNode(ctrl *gomock.Controller) *MockBeaconNode

NewMockBeaconNode creates a new mock instance.

func (*MockBeaconNode) AttesterDuties added in v1.1.0

func (m *MockBeaconNode) AttesterDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*v1.AttesterDuty, error)

AttesterDuties mocks base method.

func (*MockBeaconNode) ComputeSigningRoot added in v1.1.0

func (m *MockBeaconNode) ComputeSigningRoot(object interface{}, domain phase0.Domain) ([32]byte, error)

ComputeSigningRoot mocks base method.

func (*MockBeaconNode) DomainData added in v1.1.0

func (m *MockBeaconNode) DomainData(epoch phase0.Epoch, domain phase0.DomainType) (phase0.Domain, error)

DomainData mocks base method.

func (*MockBeaconNode) EXPECT added in v1.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBeaconNode) Events added in v1.1.0

func (m *MockBeaconNode) Events(ctx context.Context, topics []string, handler client.EventHandlerFunc) error

Events mocks base method.

func (*MockBeaconNode) GetAttestationData added in v1.1.0

func (m *MockBeaconNode) GetAttestationData(slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (ssz.Marshaler, spec.DataVersion, error)

GetAttestationData mocks base method.

func (*MockBeaconNode) GetBeaconBlock added in v1.1.0

func (m *MockBeaconNode) GetBeaconBlock(slot phase0.Slot, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error)

GetBeaconBlock mocks base method.

func (*MockBeaconNode) GetBeaconNetwork added in v1.1.0

func (m *MockBeaconNode) GetBeaconNetwork() types.BeaconNetwork

GetBeaconNetwork mocks base method.

func (*MockBeaconNode) GetBlindedBeaconBlock added in v1.1.0

func (m *MockBeaconNode) GetBlindedBeaconBlock(slot phase0.Slot, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error)

GetBlindedBeaconBlock mocks base method.

func (*MockBeaconNode) GetSyncCommitteeContribution added in v1.1.0

func (m *MockBeaconNode) GetSyncCommitteeContribution(slot phase0.Slot, selectionProofs []phase0.BLSSignature, subnetIDs []uint64) (ssz.Marshaler, spec.DataVersion, error)

GetSyncCommitteeContribution mocks base method.

func (*MockBeaconNode) GetSyncMessageBlockRoot added in v1.1.0

func (m *MockBeaconNode) GetSyncMessageBlockRoot(slot phase0.Slot) (phase0.Root, spec.DataVersion, error)

GetSyncMessageBlockRoot mocks base method.

func (*MockBeaconNode) GetValidatorData added in v1.1.0

func (m *MockBeaconNode) GetValidatorData(validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*v1.Validator, error)

GetValidatorData mocks base method.

func (*MockBeaconNode) IsSyncCommitteeAggregator added in v1.1.0

func (m *MockBeaconNode) IsSyncCommitteeAggregator(proof []byte) (bool, error)

IsSyncCommitteeAggregator mocks base method.

func (*MockBeaconNode) ProposerDuties added in v1.1.0

func (m *MockBeaconNode) ProposerDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*v1.ProposerDuty, error)

ProposerDuties mocks base method.

func (*MockBeaconNode) SubmitAggregateSelectionProof added in v1.1.0

func (m *MockBeaconNode) SubmitAggregateSelectionProof(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, committeeLength uint64, index phase0.ValidatorIndex, slotSig []byte) (ssz.Marshaler, spec.DataVersion, error)

SubmitAggregateSelectionProof mocks base method.

func (*MockBeaconNode) SubmitAttestation added in v1.1.0

func (m *MockBeaconNode) SubmitAttestation(attestation *phase0.Attestation) error

SubmitAttestation mocks base method.

func (*MockBeaconNode) SubmitBeaconBlock added in v1.1.0

func (m *MockBeaconNode) SubmitBeaconBlock(block *api.VersionedProposal, sig phase0.BLSSignature) error

SubmitBeaconBlock mocks base method.

func (*MockBeaconNode) SubmitBeaconCommitteeSubscriptions added in v1.1.0

func (m *MockBeaconNode) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscription []*v1.BeaconCommitteeSubscription) error

SubmitBeaconCommitteeSubscriptions mocks base method.

func (*MockBeaconNode) SubmitBlindedBeaconBlock added in v1.1.0

func (m *MockBeaconNode) SubmitBlindedBeaconBlock(block *api.VersionedBlindedProposal, sig phase0.BLSSignature) error

SubmitBlindedBeaconBlock mocks base method.

func (*MockBeaconNode) SubmitProposalPreparation added in v1.1.0

func (m *MockBeaconNode) SubmitProposalPreparation(feeRecipients map[phase0.ValidatorIndex]bellatrix.ExecutionAddress) error

SubmitProposalPreparation mocks base method.

func (*MockBeaconNode) SubmitSignedAggregateSelectionProof added in v1.1.0

func (m *MockBeaconNode) SubmitSignedAggregateSelectionProof(msg *phase0.SignedAggregateAndProof) error

SubmitSignedAggregateSelectionProof mocks base method.

func (*MockBeaconNode) SubmitSignedContributionAndProof added in v1.1.0

func (m *MockBeaconNode) SubmitSignedContributionAndProof(contribution *altair.SignedContributionAndProof) error

SubmitSignedContributionAndProof mocks base method.

func (*MockBeaconNode) SubmitSyncCommitteeSubscriptions added in v1.1.0

func (m *MockBeaconNode) SubmitSyncCommitteeSubscriptions(ctx context.Context, subscription []*v1.SyncCommitteeSubscription) error

SubmitSyncCommitteeSubscriptions mocks base method.

func (*MockBeaconNode) SubmitSyncMessage added in v1.1.0

func (m *MockBeaconNode) SubmitSyncMessage(msg *altair.SyncCommitteeMessage) error

SubmitSyncMessage mocks base method.

func (*MockBeaconNode) SubmitValidatorRegistration added in v1.1.0

func (m *MockBeaconNode) SubmitValidatorRegistration(pubkey []byte, feeRecipient bellatrix.ExecutionAddress, sig phase0.BLSSignature) error

SubmitValidatorRegistration mocks base method.

func (*MockBeaconNode) SubmitVoluntaryExit added in v1.1.0

func (m *MockBeaconNode) SubmitVoluntaryExit(voluntaryExit *phase0.SignedVoluntaryExit) error

SubmitVoluntaryExit mocks base method.

func (*MockBeaconNode) SyncCommitteeDuties added in v1.1.0

func (m *MockBeaconNode) SyncCommitteeDuties(ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex) ([]*v1.SyncCommitteeDuty, error)

SyncCommitteeDuties mocks base method.

func (*MockBeaconNode) SyncCommitteeSubnetID added in v1.1.0

func (m *MockBeaconNode) SyncCommitteeSubnetID(index phase0.CommitteeIndex) (uint64, error)

SyncCommitteeSubnetID mocks base method.

type MockBeaconNodeMockRecorder added in v1.1.0

type MockBeaconNodeMockRecorder struct {
	// contains filtered or unexported fields
}

MockBeaconNodeMockRecorder is the mock recorder for MockBeaconNode.

func (*MockBeaconNodeMockRecorder) AttesterDuties added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) AttesterDuties(ctx, epoch, validatorIndices interface{}) *gomock.Call

AttesterDuties indicates an expected call of AttesterDuties.

func (*MockBeaconNodeMockRecorder) ComputeSigningRoot added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call

ComputeSigningRoot indicates an expected call of ComputeSigningRoot.

func (*MockBeaconNodeMockRecorder) DomainData added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) DomainData(epoch, domain interface{}) *gomock.Call

DomainData indicates an expected call of DomainData.

func (*MockBeaconNodeMockRecorder) Events added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) Events(ctx, topics, handler interface{}) *gomock.Call

Events indicates an expected call of Events.

func (*MockBeaconNodeMockRecorder) GetAttestationData added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetAttestationData(slot, committeeIndex interface{}) *gomock.Call

GetAttestationData indicates an expected call of GetAttestationData.

func (*MockBeaconNodeMockRecorder) GetBeaconBlock added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetBeaconBlock(slot, graffiti, randao interface{}) *gomock.Call

GetBeaconBlock indicates an expected call of GetBeaconBlock.

func (*MockBeaconNodeMockRecorder) GetBeaconNetwork added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetBeaconNetwork() *gomock.Call

GetBeaconNetwork indicates an expected call of GetBeaconNetwork.

func (*MockBeaconNodeMockRecorder) GetBlindedBeaconBlock added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetBlindedBeaconBlock(slot, graffiti, randao interface{}) *gomock.Call

GetBlindedBeaconBlock indicates an expected call of GetBlindedBeaconBlock.

func (*MockBeaconNodeMockRecorder) GetSyncCommitteeContribution added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetSyncCommitteeContribution(slot, selectionProofs, subnetIDs interface{}) *gomock.Call

GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution.

func (*MockBeaconNodeMockRecorder) GetSyncMessageBlockRoot added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetSyncMessageBlockRoot(slot interface{}) *gomock.Call

GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot.

func (*MockBeaconNodeMockRecorder) GetValidatorData added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call

GetValidatorData indicates an expected call of GetValidatorData.

func (*MockBeaconNodeMockRecorder) IsSyncCommitteeAggregator added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) IsSyncCommitteeAggregator(proof interface{}) *gomock.Call

IsSyncCommitteeAggregator indicates an expected call of IsSyncCommitteeAggregator.

func (*MockBeaconNodeMockRecorder) ProposerDuties added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) ProposerDuties(ctx, epoch, validatorIndices interface{}) *gomock.Call

ProposerDuties indicates an expected call of ProposerDuties.

func (*MockBeaconNodeMockRecorder) SubmitAggregateSelectionProof added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitAggregateSelectionProof(slot, committeeIndex, committeeLength, index, slotSig interface{}) *gomock.Call

SubmitAggregateSelectionProof indicates an expected call of SubmitAggregateSelectionProof.

func (*MockBeaconNodeMockRecorder) SubmitAttestation added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitAttestation(attestation interface{}) *gomock.Call

SubmitAttestation indicates an expected call of SubmitAttestation.

func (*MockBeaconNodeMockRecorder) SubmitBeaconBlock added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitBeaconBlock(block, sig interface{}) *gomock.Call

SubmitBeaconBlock indicates an expected call of SubmitBeaconBlock.

func (*MockBeaconNodeMockRecorder) SubmitBeaconCommitteeSubscriptions added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitBeaconCommitteeSubscriptions(ctx, subscription interface{}) *gomock.Call

SubmitBeaconCommitteeSubscriptions indicates an expected call of SubmitBeaconCommitteeSubscriptions.

func (*MockBeaconNodeMockRecorder) SubmitBlindedBeaconBlock added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitBlindedBeaconBlock(block, sig interface{}) *gomock.Call

SubmitBlindedBeaconBlock indicates an expected call of SubmitBlindedBeaconBlock.

func (*MockBeaconNodeMockRecorder) SubmitProposalPreparation added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitProposalPreparation(feeRecipients interface{}) *gomock.Call

SubmitProposalPreparation indicates an expected call of SubmitProposalPreparation.

func (*MockBeaconNodeMockRecorder) SubmitSignedAggregateSelectionProof added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitSignedAggregateSelectionProof(msg interface{}) *gomock.Call

SubmitSignedAggregateSelectionProof indicates an expected call of SubmitSignedAggregateSelectionProof.

func (*MockBeaconNodeMockRecorder) SubmitSignedContributionAndProof added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitSignedContributionAndProof(contribution interface{}) *gomock.Call

SubmitSignedContributionAndProof indicates an expected call of SubmitSignedContributionAndProof.

func (*MockBeaconNodeMockRecorder) SubmitSyncCommitteeSubscriptions added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitSyncCommitteeSubscriptions(ctx, subscription interface{}) *gomock.Call

SubmitSyncCommitteeSubscriptions indicates an expected call of SubmitSyncCommitteeSubscriptions.

func (*MockBeaconNodeMockRecorder) SubmitSyncMessage added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitSyncMessage(msg interface{}) *gomock.Call

SubmitSyncMessage indicates an expected call of SubmitSyncMessage.

func (*MockBeaconNodeMockRecorder) SubmitValidatorRegistration added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitValidatorRegistration(pubkey, feeRecipient, sig interface{}) *gomock.Call

SubmitValidatorRegistration indicates an expected call of SubmitValidatorRegistration.

func (*MockBeaconNodeMockRecorder) SubmitVoluntaryExit added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SubmitVoluntaryExit(voluntaryExit interface{}) *gomock.Call

SubmitVoluntaryExit indicates an expected call of SubmitVoluntaryExit.

func (*MockBeaconNodeMockRecorder) SyncCommitteeDuties added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SyncCommitteeDuties(ctx, epoch, indices interface{}) *gomock.Call

SyncCommitteeDuties indicates an expected call of SyncCommitteeDuties.

func (*MockBeaconNodeMockRecorder) SyncCommitteeSubnetID added in v1.1.0

func (mr *MockBeaconNodeMockRecorder) SyncCommitteeSubnetID(index interface{}) *gomock.Call

SyncCommitteeSubnetID indicates an expected call of SyncCommitteeSubnetID.

type MockValidatorMetadataStorage

type MockValidatorMetadataStorage struct {
	// contains filtered or unexported fields
}

MockValidatorMetadataStorage is a mock of ValidatorMetadataStorage interface.

func NewMockValidatorMetadataStorage

func NewMockValidatorMetadataStorage(ctrl *gomock.Controller) *MockValidatorMetadataStorage

NewMockValidatorMetadataStorage creates a new mock instance.

func (*MockValidatorMetadataStorage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockValidatorMetadataStorage) UpdateValidatorMetadata

func (m *MockValidatorMetadataStorage) UpdateValidatorMetadata(pk string, metadata *ValidatorMetadata) error

UpdateValidatorMetadata mocks base method.

type MockValidatorMetadataStorageMockRecorder

type MockValidatorMetadataStorageMockRecorder struct {
	// contains filtered or unexported fields
}

MockValidatorMetadataStorageMockRecorder is the mock recorder for MockValidatorMetadataStorage.

func (*MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata

func (mr *MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata(pk, metadata interface{}) *gomock.Call

UpdateValidatorMetadata indicates an expected call of UpdateValidatorMetadata.

type MockbeaconDuties

type MockbeaconDuties struct {
	// contains filtered or unexported fields
}

MockbeaconDuties is a mock of beaconDuties interface.

func NewMockbeaconDuties

func NewMockbeaconDuties(ctrl *gomock.Controller) *MockbeaconDuties

NewMockbeaconDuties creates a new mock instance.

func (*MockbeaconDuties) AttesterDuties added in v1.1.0

func (m *MockbeaconDuties) AttesterDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*v1.AttesterDuty, error)

AttesterDuties mocks base method.

func (*MockbeaconDuties) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconDuties) Events added in v0.4.7

func (m *MockbeaconDuties) Events(ctx context.Context, topics []string, handler client.EventHandlerFunc) error

Events mocks base method.

func (*MockbeaconDuties) ProposerDuties added in v1.1.0

func (m *MockbeaconDuties) ProposerDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*v1.ProposerDuty, error)

ProposerDuties mocks base method.

func (*MockbeaconDuties) SyncCommitteeDuties added in v0.4.7

func (m *MockbeaconDuties) SyncCommitteeDuties(ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex) ([]*v1.SyncCommitteeDuty, error)

SyncCommitteeDuties mocks base method.

type MockbeaconDutiesMockRecorder

type MockbeaconDutiesMockRecorder struct {
	// contains filtered or unexported fields
}

MockbeaconDutiesMockRecorder is the mock recorder for MockbeaconDuties.

func (*MockbeaconDutiesMockRecorder) AttesterDuties added in v1.1.0

func (mr *MockbeaconDutiesMockRecorder) AttesterDuties(ctx, epoch, validatorIndices interface{}) *gomock.Call

AttesterDuties indicates an expected call of AttesterDuties.

func (*MockbeaconDutiesMockRecorder) Events added in v0.4.7

func (mr *MockbeaconDutiesMockRecorder) Events(ctx, topics, handler interface{}) *gomock.Call

Events indicates an expected call of Events.

func (*MockbeaconDutiesMockRecorder) ProposerDuties added in v1.1.0

func (mr *MockbeaconDutiesMockRecorder) ProposerDuties(ctx, epoch, validatorIndices interface{}) *gomock.Call

ProposerDuties indicates an expected call of ProposerDuties.

func (*MockbeaconDutiesMockRecorder) SyncCommitteeDuties added in v0.4.7

func (mr *MockbeaconDutiesMockRecorder) SyncCommitteeDuties(ctx, epoch, indices interface{}) *gomock.Call

SyncCommitteeDuties indicates an expected call of SyncCommitteeDuties.

type MockbeaconSubscriber

type MockbeaconSubscriber struct {
	// contains filtered or unexported fields
}

MockbeaconSubscriber is a mock of beaconSubscriber interface.

func NewMockbeaconSubscriber

func NewMockbeaconSubscriber(ctrl *gomock.Controller) *MockbeaconSubscriber

NewMockbeaconSubscriber creates a new mock instance.

func (*MockbeaconSubscriber) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconSubscriber) SubmitBeaconCommitteeSubscriptions added in v1.1.0

func (m *MockbeaconSubscriber) SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscription []*v1.BeaconCommitteeSubscription) error

SubmitBeaconCommitteeSubscriptions mocks base method.

func (*MockbeaconSubscriber) SubmitSyncCommitteeSubscriptions

func (m *MockbeaconSubscriber) SubmitSyncCommitteeSubscriptions(ctx context.Context, subscription []*v1.SyncCommitteeSubscription) error

SubmitSyncCommitteeSubscriptions mocks base method.

type MockbeaconSubscriberMockRecorder

type MockbeaconSubscriberMockRecorder struct {
	// contains filtered or unexported fields
}

MockbeaconSubscriberMockRecorder is the mock recorder for MockbeaconSubscriber.

func (*MockbeaconSubscriberMockRecorder) SubmitBeaconCommitteeSubscriptions added in v1.1.0

func (mr *MockbeaconSubscriberMockRecorder) SubmitBeaconCommitteeSubscriptions(ctx, subscription interface{}) *gomock.Call

SubmitBeaconCommitteeSubscriptions indicates an expected call of SubmitBeaconCommitteeSubscriptions.

func (*MockbeaconSubscriberMockRecorder) SubmitSyncCommitteeSubscriptions

func (mr *MockbeaconSubscriberMockRecorder) SubmitSyncCommitteeSubscriptions(ctx, subscription interface{}) *gomock.Call

SubmitSyncCommitteeSubscriptions indicates an expected call of SubmitSyncCommitteeSubscriptions.

type MockbeaconValidator

type MockbeaconValidator struct {
	// contains filtered or unexported fields
}

MockbeaconValidator is a mock of beaconValidator interface.

func NewMockbeaconValidator

func NewMockbeaconValidator(ctrl *gomock.Controller) *MockbeaconValidator

NewMockbeaconValidator creates a new mock instance.

func (*MockbeaconValidator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconValidator) GetValidatorData

func (m *MockbeaconValidator) GetValidatorData(validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*v1.Validator, error)

GetValidatorData mocks base method.

type MockbeaconValidatorMockRecorder

type MockbeaconValidatorMockRecorder struct {
	// contains filtered or unexported fields
}

MockbeaconValidatorMockRecorder is the mock recorder for MockbeaconValidator.

func (*MockbeaconValidatorMockRecorder) GetValidatorData

func (mr *MockbeaconValidatorMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call

GetValidatorData indicates an expected call of GetValidatorData.

type Mockproposer

type Mockproposer struct {
	// contains filtered or unexported fields
}

Mockproposer is a mock of proposer interface.

func NewMockproposer

func NewMockproposer(ctrl *gomock.Controller) *Mockproposer

NewMockproposer creates a new mock instance.

func (*Mockproposer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mockproposer) SubmitProposalPreparation

func (m *Mockproposer) SubmitProposalPreparation(feeRecipients map[phase0.ValidatorIndex]bellatrix.ExecutionAddress) error

SubmitProposalPreparation mocks base method.

type MockproposerMockRecorder

type MockproposerMockRecorder struct {
	// contains filtered or unexported fields
}

MockproposerMockRecorder is the mock recorder for Mockproposer.

func (*MockproposerMockRecorder) SubmitProposalPreparation

func (mr *MockproposerMockRecorder) SubmitProposalPreparation(feeRecipients interface{}) *gomock.Call

SubmitProposalPreparation indicates an expected call of SubmitProposalPreparation.

type Mocksigner

type Mocksigner struct {
	// contains filtered or unexported fields
}

Mocksigner is a mock of signer interface.

func NewMocksigner

func NewMocksigner(ctrl *gomock.Controller) *Mocksigner

NewMocksigner creates a new mock instance.

func (*Mocksigner) ComputeSigningRoot

func (m *Mocksigner) ComputeSigningRoot(object interface{}, domain phase0.Domain) ([32]byte, error)

ComputeSigningRoot mocks base method.

func (*Mocksigner) EXPECT

func (m *Mocksigner) EXPECT() *MocksignerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MocksignerMockRecorder

type MocksignerMockRecorder struct {
	// contains filtered or unexported fields
}

MocksignerMockRecorder is the mock recorder for Mocksigner.

func (*MocksignerMockRecorder) ComputeSigningRoot

func (mr *MocksignerMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call

ComputeSigningRoot indicates an expected call of ComputeSigningRoot.

type Network

type Network struct {
	spectypes.BeaconNetwork
	LocalTestNet bool
}

Network is a beacon chain network.

func NewLocalTestNetwork added in v1.1.0

func NewLocalTestNetwork(network spectypes.BeaconNetwork) Network

NewLocalTestNetwork creates a new local beacon chain network.

func NewNetwork

func NewNetwork(network spectypes.BeaconNetwork) Network

NewNetwork creates a new beacon chain network.

func (Network) EpochsPerSyncCommitteePeriod added in v1.1.0

func (n Network) EpochsPerSyncCommitteePeriod() uint64

EpochsPerSyncCommitteePeriod returns the number of epochs per sync committee period.

func (Network) EstimatedCurrentEpoch

func (n Network) EstimatedCurrentEpoch() phase0.Epoch

EstimatedCurrentEpoch estimates the current epoch https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#compute_start_slot_at_epoch

func (Network) EstimatedCurrentSlot

func (n Network) EstimatedCurrentSlot() phase0.Slot

EstimatedCurrentSlot returns the estimation of the current slot

func (Network) EstimatedEpochAtSlot

func (n Network) EstimatedEpochAtSlot(slot phase0.Slot) phase0.Epoch

EstimatedEpochAtSlot estimates epoch at the given slot

func (Network) EstimatedSlotAtTime

func (n Network) EstimatedSlotAtTime(time int64) phase0.Slot

EstimatedSlotAtTime estimates slot at the given time

func (Network) EstimatedSyncCommitteePeriodAtEpoch added in v0.4.7

func (n Network) EstimatedSyncCommitteePeriodAtEpoch(epoch phase0.Epoch) uint64

EstimatedSyncCommitteePeriodAtEpoch estimates the current sync committee period at the given Epoch

func (Network) FirstEpochOfSyncPeriod added in v0.4.7

func (n Network) FirstEpochOfSyncPeriod(period uint64) phase0.Epoch

FirstEpochOfSyncPeriod calculates the first epoch of the given sync period.

func (Network) GetBeaconNetwork added in v1.1.0

func (n Network) GetBeaconNetwork() spectypes.BeaconNetwork

GetBeaconNetwork returns the beacon network the node is on

func (Network) GetEpochFirstSlot

func (n Network) GetEpochFirstSlot(epoch phase0.Epoch) phase0.Slot

GetEpochFirstSlot returns the beacon node first slot in epoch

func (Network) GetNetwork added in v1.1.0

func (n Network) GetNetwork() Network

GetNetwork returns the network

func (Network) GetSlotEndTime added in v1.1.0

func (n Network) GetSlotEndTime(slot phase0.Slot) time.Time

GetSlotEndTime returns the end time for the given slot

func (Network) GetSlotStartTime

func (n Network) GetSlotStartTime(slot phase0.Slot) time.Time

GetSlotStartTime returns the start time for the given slot

func (Network) IsFirstSlotOfEpoch

func (n Network) IsFirstSlotOfEpoch(slot phase0.Slot) bool

IsFirstSlotOfEpoch estimates epoch at the given slot

func (Network) LastSlotOfSyncPeriod added in v0.4.7

func (n Network) LastSlotOfSyncPeriod(period uint64) phase0.Slot

LastSlotOfSyncPeriod calculates the first epoch of the given sync period.

func (Network) MarshalJSON added in v1.1.0

func (n Network) MarshalJSON() ([]byte, error)

func (Network) MinGenesisTime

func (n Network) MinGenesisTime() uint64

MinGenesisTime returns min genesis time value

func (Network) String added in v1.1.0

func (n Network) String() string

func (*Network) UnmarshalJSON added in v1.1.0

func (n *Network) UnmarshalJSON(b []byte) error

type OnUpdated

type OnUpdated func(pk string, meta *ValidatorMetadata)

OnUpdated represents a function to be called once validator's metadata was updated

type Options

type Options struct {
	Context        context.Context
	Network        Network
	BeaconNodeAddr string `yaml:"BeaconNodeAddr" env:"BEACON_NODE_ADDR" env-required:"true"`
	Graffiti       []byte
	GasLimit       uint64
	CommonTimeout  time.Duration // Optional.
	LongTimeout    time.Duration // Optional.
}

Options for controller struct creation

type ValidatorMetadata

type ValidatorMetadata struct {
	Balance         phase0.Gwei              `json:"balance"`
	Status          eth2apiv1.ValidatorState `json:"status"`
	Index           phase0.ValidatorIndex    `json:"index"` // pointer in order to support nil
	ActivationEpoch phase0.Epoch             `json:"activation_epoch"`
}

ValidatorMetadata represents validator metdata from beacon

func (*ValidatorMetadata) Activated

func (m *ValidatorMetadata) Activated() bool

Activated returns true if the validator is not unknown. It might be pending activation or active

func (*ValidatorMetadata) Equals

func (m *ValidatorMetadata) Equals(other *ValidatorMetadata) bool

Equals returns true if the given metadata is equal to current

func (*ValidatorMetadata) Exiting

func (m *ValidatorMetadata) Exiting() bool

Exiting returns true if the validator is existing or exited

func (*ValidatorMetadata) IsActive

func (m *ValidatorMetadata) IsActive() bool

IsActive returns true if the validator is currently active. Cant be other state

func (*ValidatorMetadata) IsAttesting added in v1.1.0

func (m *ValidatorMetadata) IsAttesting() bool

IsAttesting returns true if the validator should be attesting.

func (*ValidatorMetadata) Pending

func (m *ValidatorMetadata) Pending() bool

Pending returns true if the validator is pending

func (*ValidatorMetadata) Slashed

func (m *ValidatorMetadata) Slashed() bool

Slashed returns true if the validator is existing or exited due to slashing

type ValidatorMetadataStorage

type ValidatorMetadataStorage interface {
	UpdateValidatorMetadata(pk string, metadata *ValidatorMetadata) error
}

ValidatorMetadataStorage interface for validator metadata

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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