testing

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainService

type ChainService struct {
	State                       *pb.BeaconState
	Root                        []byte
	Block                       *ethpb.SignedBeaconBlock
	FinalizedCheckPoint         *ethpb.Checkpoint
	CurrentJustifiedCheckPoint  *ethpb.Checkpoint
	PreviousJustifiedCheckPoint *ethpb.Checkpoint
	BlocksReceived              []*ethpb.SignedBeaconBlock
	Balance                     *precompute.Balance
	Genesis                     time.Time
	Fork                        *pb.Fork
	DB                          db.Database
	// contains filtered or unexported fields
}

ChainService defines the mock interface for testing

func (*ChainService) CurrentFork added in v0.2.3

func (ms *ChainService) CurrentFork() *pb.Fork

CurrentFork mocks HeadState method in chain service.

func (*ChainService) CurrentJustifiedCheckpt added in v0.3.0

func (ms *ChainService) CurrentJustifiedCheckpt() *ethpb.Checkpoint

CurrentJustifiedCheckpt mocks CurrentJustifiedCheckpt method in chain service.

func (*ChainService) FinalizedCheckpt

func (ms *ChainService) FinalizedCheckpt() *ethpb.Checkpoint

FinalizedCheckpt mocks FinalizedCheckpt method in chain service.

func (*ChainService) GenesisTime

func (ms *ChainService) GenesisTime() time.Time

GenesisTime mocks the same method in the chain service.

func (*ChainService) HeadBlock

func (ms *ChainService) HeadBlock() *ethpb.SignedBeaconBlock

HeadBlock mocks HeadBlock method in chain service.

func (*ChainService) HeadRoot

func (ms *ChainService) HeadRoot() []byte

HeadRoot mocks HeadRoot method in chain service.

func (*ChainService) HeadSeed added in v0.3.0

func (ms *ChainService) HeadSeed(epoch uint64) ([32]byte, error)

HeadSeed mocks the same method in the chain service.

func (*ChainService) HeadSlot

func (ms *ChainService) HeadSlot() uint64

HeadSlot mocks HeadSlot method in chain service.

func (*ChainService) HeadState

func (ms *ChainService) HeadState(context.Context) (*pb.BeaconState, error)

HeadState mocks HeadState method in chain service.

func (*ChainService) HeadValidatorsIndices added in v0.3.0

func (ms *ChainService) HeadValidatorsIndices(epoch uint64) ([]uint64, error)

HeadValidatorsIndices mocks the same method in the chain service.

func (*ChainService) OperationNotifier added in v0.3.0

func (ms *ChainService) OperationNotifier() opfeed.Notifier

OperationNotifier mocks the same method in the chain service.

func (*ChainService) Participation added in v0.3.0

func (ms *ChainService) Participation(epoch uint64) *precompute.Balance

Participation mocks the same method in the chain service.

func (*ChainService) PreviousJustifiedCheckpt added in v0.3.0

func (ms *ChainService) PreviousJustifiedCheckpt() *ethpb.Checkpoint

PreviousJustifiedCheckpt mocks PreviousJustifiedCheckpt method in chain service.

func (*ChainService) ReceiveAttestation

func (ms *ChainService) ReceiveAttestation(context.Context, *ethpb.Attestation) error

ReceiveAttestation mocks ReceiveAttestation method in chain service.

func (*ChainService) ReceiveAttestationNoPubsub

func (ms *ChainService) ReceiveAttestationNoPubsub(context.Context, *ethpb.Attestation) error

ReceiveAttestationNoPubsub mocks ReceiveAttestationNoPubsub method in chain service.

func (*ChainService) ReceiveBlock

func (ms *ChainService) ReceiveBlock(ctx context.Context, block *ethpb.SignedBeaconBlock) error

ReceiveBlock mocks ReceiveBlock method in chain service.

func (*ChainService) ReceiveBlockNoPubsub

func (ms *ChainService) ReceiveBlockNoPubsub(ctx context.Context, block *ethpb.SignedBeaconBlock) error

ReceiveBlockNoPubsub mocks ReceiveBlockNoPubsub method in chain service.

func (*ChainService) ReceiveBlockNoPubsubForkchoice

func (ms *ChainService) ReceiveBlockNoPubsubForkchoice(ctx context.Context, block *ethpb.SignedBeaconBlock) error

ReceiveBlockNoPubsubForkchoice mocks ReceiveBlockNoPubsubForkchoice method in chain service.

func (*ChainService) ReceiveBlockNoVerify

func (ms *ChainService) ReceiveBlockNoVerify(ctx context.Context, block *ethpb.SignedBeaconBlock) error

ReceiveBlockNoVerify mocks ReceiveBlockNoVerify method in chain service.

func (*ChainService) StateNotifier added in v0.3.0

func (ms *ChainService) StateNotifier() statefeed.Notifier

StateNotifier mocks the same method in the chain service.

type MockOperationNotifier added in v0.3.0

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

MockOperationNotifier mocks the operation notifier.

func (*MockOperationNotifier) OperationFeed added in v0.3.0

func (mon *MockOperationNotifier) OperationFeed() *event.Feed

OperationFeed returns an operation feed.

type MockStateNotifier added in v0.3.0

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

MockStateNotifier mocks the state notifier.

func (*MockStateNotifier) StateFeed added in v0.3.0

func (msn *MockStateNotifier) StateFeed() *event.Feed

StateFeed returns a state feed.

Jump to

Keyboard shortcuts

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