testing

package
v4.0.0-...-b8b0360 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TestMnemonic = "" /* 156-byte string literal not displayed */

TestMnemonic --

Variables

This section is empty.

Functions

func CreateMockRoots

func CreateMockRoots(numRoots int) [][32]byte

CreateMockRoots --

func CreateRandomPubKeys

func CreateRandomPubKeys(numValidators int) ([][dilithium2.CryptoPublicKeyBytes]byte, error)

CreateRandomPubKeys --

func MockAttestingAndProposalHistories

func MockAttestingAndProposalHistories(pubkeys [][dilithium2.CryptoPublicKeyBytes]byte) ([][]*kv.AttestationRecord, []kv.ProposalHistoryForPubkey)

MockAttestingAndProposalHistories given a number of validators, creates mock attesting and proposing histories within WEAK_SUBJECTIVITY_PERIOD bounds.

func MockSlashingProtectionJSON

func MockSlashingProtectionJSON(
	publicKeys [][dilithium2.CryptoPublicKeyBytes]byte,
	attestingHistories [][]*kv.AttestationRecord,
	proposalHistories []kv.ProposalHistoryForPubkey,
) (*format.EIPSlashingProtectionFormat, error)

MockSlashingProtectionJSON creates a mock, full slashing protection JSON struct using attesting and proposing histories provided.

Types

type MockProtector

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

MockProtector mocks the protector.

func (MockProtector) CheckAttestationSafety

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

CheckAttestationSafety returns bool with allow attestation value.

func (MockProtector) CheckBlockSafety

func (mp MockProtector) CheckBlockSafety(_ context.Context, _ *zond.SignedBeaconBlockHeader) bool

CheckBlockSafety returns bool with allow block value.

func (MockProtector) Status

func (mp MockProtector) Status() error

Status returns nil.

Jump to

Keyboard shortcuts

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