Documentation ¶
Index ¶
- Constants
- func CreateMockRoots(numRoots int) [][32]byte
- func CreateRandomPubKeys(numValidators int) ([][fieldparams.BLSPubkeyLength]byte, error)
- func MockAttestingAndProposalHistories(pubkeys [][fieldparams.BLSPubkeyLength]byte) ([][]*kv.AttestationRecord, []kv.ProposalHistoryForPubkey)
- func MockSlashingProtectionJSON(publicKeys [][fieldparams.BLSPubkeyLength]byte, ...) (*format.EIPSlashingProtectionFormat, error)
- type MockProtector
- type MockSlasher
- func (MockSlasher) HighestAttestations(_ context.Context, _ *eth.HighestAttestationRequest, _ ...grpc.CallOption) (*eth.HighestAttestationResponse, error)
- func (ms MockSlasher) IsSlashableAttestation(_ context.Context, in *eth.IndexedAttestation, _ ...grpc.CallOption) (*eth.AttesterSlashingResponse, error)
- func (ms MockSlasher) IsSlashableBlock(_ context.Context, in *eth.SignedBeaconBlockHeader, _ ...grpc.CallOption) (*eth.ProposerSlashingResponse, error)
Constants ¶
const TestMnemonic = "" /* 156-byte string literal not displayed */
TestMnemonic --
Variables ¶
This section is empty.
Functions ¶
func CreateRandomPubKeys ¶
func CreateRandomPubKeys(numValidators int) ([][fieldparams.BLSPubkeyLength]byte, error)
CreateRandomPubKeys --
func MockAttestingAndProposalHistories ¶
func MockAttestingAndProposalHistories(pubkeys [][fieldparams.BLSPubkeyLength]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 [][fieldparams.BLSPubkeyLength]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, _ *eth.IndexedAttestation) bool
CheckAttestationSafety returns bool with allow attestation value.
func (MockProtector) CheckBlockSafety ¶
func (mp MockProtector) CheckBlockSafety(_ context.Context, _ *eth.SignedBeaconBlockHeader) bool
CheckBlockSafety returns bool with allow block value.
type MockSlasher ¶
type MockSlasher struct { SlashAttestation bool SlashBlock bool IsSlashableAttestationCalled bool IsSlashableBlockCalled bool }
MockSlasher mocks the slasher rpc server.
func (MockSlasher) HighestAttestations ¶
func (MockSlasher) HighestAttestations(_ context.Context, _ *eth.HighestAttestationRequest, _ ...grpc.CallOption) (*eth.HighestAttestationResponse, error)
HighestAttestations will return an empty array of attestations.
func (MockSlasher) IsSlashableAttestation ¶
func (ms MockSlasher) IsSlashableAttestation(_ context.Context, in *eth.IndexedAttestation, _ ...grpc.CallOption) (*eth.AttesterSlashingResponse, error)
IsSlashableAttestation returns slashbale attestation if slash attestation is set to true.
func (MockSlasher) IsSlashableBlock ¶
func (ms MockSlasher) IsSlashableBlock(_ context.Context, in *eth.SignedBeaconBlockHeader, _ ...grpc.CallOption) (*eth.ProposerSlashingResponse, error)
IsSlashableBlock returns proposer slashing if slash block is set to true.