testing

package
v1.0.0-beta.0.rc Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProtector

type MockProtector struct {
	AllowAttestation        bool
	AllowBlock              bool
	VerifyAttestationCalled bool
	CommitAttestationCalled bool
	VerifyBlockCalled       bool
	CommitBlockCalled       bool
	StatusCalled            bool
}

MockProtector mocks the protector.

func (MockProtector) CheckAttestationSafety

func (mp MockProtector) CheckAttestationSafety(_ context.Context, _ *eth.IndexedAttestation) bool

CheckAttestationSafety returns bool with allow attestation value.

func (MockProtector) CheckBlockSafety

func (mp MockProtector) CheckBlockSafety(_ context.Context, _ *eth.BeaconBlockHeader) bool

CheckBlockSafety returns bool with allow block value.

func (MockProtector) CommitAttestation

func (mp MockProtector) CommitAttestation(_ context.Context, _ *eth.IndexedAttestation) bool

CommitAttestation returns bool with allow attestation value.

func (MockProtector) CommitBlock

CommitBlock returns bool with allow block value.

func (MockProtector) Status

func (mp MockProtector) Status() error

Status returns nil.

type MockSlasher

type MockSlasher struct {
	SlashAttestation                     bool
	SlashBlock                           bool
	IsSlashableAttestationCalled         bool
	IsSlashableAttestationNoUpdateCalled bool
	IsSlashableBlockCalled               bool
	IsSlashableBlockNoUpdateCalled       bool
}

MockSlasher mocks the slasher rpc server.

func (MockSlasher) IsSlashableAttestation

IsSlashableAttestation returns slashbale attestation if slash attestation is set to true.

func (MockSlasher) IsSlashableAttestationNoUpdate

func (ms MockSlasher) IsSlashableAttestationNoUpdate(_ context.Context, _ *eth.IndexedAttestation, _ ...grpc.CallOption) (*slashpb.Slashable, error)

IsSlashableAttestationNoUpdate returns slashbale if slash attestation is set to true.

func (MockSlasher) IsSlashableBlock

IsSlashableBlock returns proposer slashing if slash block is set to true.

func (MockSlasher) IsSlashableBlockNoUpdate

func (ms MockSlasher) IsSlashableBlockNoUpdate(_ context.Context, _ *eth.BeaconBlockHeader, _ ...grpc.CallOption) (*slashpb.Slashable, error)

IsSlashableBlockNoUpdate returns slashbale if slash block is set to true.

Jump to

Keyboard shortcuts

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