Documentation ¶
Index ¶
- Constants
- func CreateMockRoots(numRoots int) [][32]byte
- func CreateRandomPubKeys(numValidators int) ([][48]byte, error)
- func MockAttestingAndProposalHistories(pubkeys [][48]byte) ([][]*kv.AttestationRecord, []kv.ProposalHistoryForPubkey)
- func MockSlashingProtectionJSON(publicKeys [][48]byte, attestingHistories [][]*kv.AttestationRecord, ...) (*format.EIPSlashingProtectionFormat, error)
- type MockProtector
- func (mp MockProtector) CheckAttestationSafety(_ context.Context, _ *eth.IndexedAttestation) bool
- func (mp MockProtector) CheckBlockSafety(_ context.Context, _ *eth.BeaconBlockHeader) bool
- func (mp MockProtector) CommitAttestation(_ context.Context, _ *eth.IndexedAttestation) bool
- func (mp MockProtector) CommitBlock(_ context.Context, _ *eth.SignedBeaconBlockHeader) (bool, error)
- func (mp MockProtector) Status() error
- type MockSlasher
- func (ms MockSlasher) HighestAttestations(ctx context.Context, req *slashpb.HighestAttestationRequest, ...) (*slashpb.HighestAttestationResponse, error)
- func (ms MockSlasher) IsSlashableAttestation(_ context.Context, in *eth.IndexedAttestation, _ ...grpc.CallOption) (*slashpb.AttesterSlashingResponse, error)
- func (ms MockSlasher) IsSlashableAttestationNoUpdate(_ context.Context, _ *eth.IndexedAttestation, _ ...grpc.CallOption) (*slashpb.Slashable, error)
- func (ms MockSlasher) IsSlashableBlock(_ context.Context, in *eth.SignedBeaconBlockHeader, _ ...grpc.CallOption) (*slashpb.ProposerSlashingResponse, error)
- func (ms MockSlasher) IsSlashableBlockNoUpdate(_ context.Context, _ *eth.BeaconBlockHeader, _ ...grpc.CallOption) (*slashpb.Slashable, error)
Constants ¶
const TestMnemonic = "" /* 156-byte string literal not displayed */
TestMnemonic --
Variables ¶
This section is empty.
Functions ¶
func CreateMockRoots ¶ added in v1.2.0
CreateMockRoots --
func CreateRandomPubKeys ¶ added in v1.2.0
CreateRandomPubKeys --
func MockAttestingAndProposalHistories ¶ added in v1.2.0
func MockAttestingAndProposalHistories(pubkeys [][48]byte) ([][]*kv.AttestationRecord, []kv.ProposalHistoryForPubkey)
MockAttestingAndProposalHistories given a number of validators, creates mock attesting and proposing histories within WEAK_SUBJECTIVITY_PERIOD bounds.
func MockSlashingProtectionJSON ¶ added in v1.2.0
func MockSlashingProtectionJSON( publicKeys [][48]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 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 ¶
func (mp MockProtector) CommitBlock(_ context.Context, _ *eth.SignedBeaconBlockHeader) (bool, error)
CommitBlock returns bool with allow block value.
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) HighestAttestations ¶
func (ms MockSlasher) HighestAttestations(ctx context.Context, req *slashpb.HighestAttestationRequest, _ ...grpc.CallOption) (*slashpb.HighestAttestationResponse, error)
HighestAttestations will return an empty array of attestations.
func (MockSlasher) IsSlashableAttestation ¶
func (ms MockSlasher) IsSlashableAttestation(_ context.Context, in *eth.IndexedAttestation, _ ...grpc.CallOption) (*slashpb.AttesterSlashingResponse, error)
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 ¶
func (ms MockSlasher) IsSlashableBlock(_ context.Context, in *eth.SignedBeaconBlockHeader, _ ...grpc.CallOption) (*slashpb.ProposerSlashingResponse, error)
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.