Documentation ¶
Overview ¶
Package testutil provides test utilities.
Index ¶
- func AvailableAddr(t *testing.T) *net.TCPAddr
- func AvailableMultiAddr(t *testing.T) multiaddr.Multiaddr
- func CreateHost(t *testing.T, addr *net.TCPAddr, opts ...libp2p.Option) host.Host
- func RandomAggregateAndProof() *eth2p0.AggregateAndProof
- func RandomAltairBeaconBlock() *altair.BeaconBlock
- func RandomAltairBeaconBlockBody() *altair.BeaconBlockBody
- func RandomArray32() [32]byte
- func RandomAttestation() *eth2p0.Attestation
- func RandomAttestationData() *eth2p0.AttestationData
- func RandomAttestationDuty(t *testing.T) *eth2v1.AttesterDuty
- func RandomBLSSignature() (*bls_sig.Signature, error)
- func RandomBeaconCommitteeSelection() *eth2exp.BeaconCommitteeSelection
- func RandomBellatrixBeaconBlock() *bellatrix.BeaconBlock
- func RandomBellatrixBeaconBlockBody() *bellatrix.BeaconBlockBody
- func RandomBellatrixBlindedBeaconBlock() *eth2bellatrix.BlindedBeaconBlock
- func RandomBellatrixBlindedBeaconBlockBody() *eth2bellatrix.BlindedBeaconBlockBody
- func RandomBellatrixCoreVersionedBeaconBlock() core.VersionedBeaconBlock
- func RandomBellatrixCoreVersionedSignedBeaconBlock() core.VersionedSignedBeaconBlock
- func RandomBellatrixExecutionPayLoad() *bellatrix.ExecutionPayload
- func RandomBellatrixExecutionPayloadHeader() *bellatrix.ExecutionPayloadHeader
- func RandomBellatrixVersionedBlindedBeaconBlock() core.VersionedBlindedBeaconBlock
- func RandomBellatrixVersionedSignedBlindedBeaconBlock() core.VersionedSignedBlindedBeaconBlock
- func RandomBitList() bitfield.Bitlist
- func RandomBitVec() bitfield.Bitvector128
- func RandomBytes20() []byte
- func RandomBytes32() []byte
- func RandomBytes48() []byte
- func RandomCapellaBeaconBlock() *capella.BeaconBlock
- func RandomCapellaBeaconBlockBody() *capella.BeaconBlockBody
- func RandomCapellaBlindedBeaconBlock() *eth2capella.BlindedBeaconBlock
- func RandomCapellaBlindedBeaconBlockBody() *eth2capella.BlindedBeaconBlockBody
- func RandomCapellaCoreVersionedBeaconBlock() core.VersionedBeaconBlock
- func RandomCapellaCoreVersionedSignedBeaconBlock() core.VersionedSignedBeaconBlock
- func RandomCapellaExecutionPayload() *capella.ExecutionPayload
- func RandomCapellaExecutionPayloadHeader() *capella.ExecutionPayloadHeader
- func RandomCapellaVersionedBlindedBeaconBlock() core.VersionedBlindedBeaconBlock
- func RandomCapellaVersionedSignedBeaconBlock() *spec.VersionedSignedBeaconBlock
- func RandomCapellaVersionedSignedBlindedBeaconBlock() core.VersionedSignedBlindedBeaconBlock
- func RandomCheckpoint() *eth2p0.Checkpoint
- func RandomCommIdx() eth2p0.CommitteeIndex
- func RandomCoreAttestationData(t *testing.T) core.AttestationData
- func RandomCoreBeaconCommitteeSelection() core.BeaconCommitteeSelection
- func RandomCorePubKey(t *testing.T) core.PubKey
- func RandomCoreSignature() core.Signature
- func RandomCoreSignedRandao() core.SignedRandao
- func RandomCoreSignedSyncContributionAndProof() core.SignedSyncContributionAndProof
- func RandomCoreSyncCommitteeSelection() core.SyncCommitteeSelection
- func RandomCoreSyncContribution() core.SyncContribution
- func RandomCoreVersionedSignedValidatorRegistration(t *testing.T) core.VersionedSignedValidatorRegistration
- func RandomENR(t *testing.T, random io.Reader) (*ecdsa.PrivateKey, enr.Record)
- func RandomETHAddress() string
- func RandomEpoch() eth2p0.Epoch
- func RandomEth2PubKey(t *testing.T) eth2p0.BLSPubKey
- func RandomEth2Signature() eth2p0.BLSSignature
- func RandomExecutionAddress() bellatrix.ExecutionAddress
- func RandomExit() *eth2p0.SignedVoluntaryExit
- func RandomGwei() eth2p0.Gwei
- func RandomPhase0BeaconBlock() *eth2p0.BeaconBlock
- func RandomPhase0BeaconBlockBody() *eth2p0.BeaconBlockBody
- func RandomProposerDuty(t *testing.T) *eth2v1.ProposerDuty
- func RandomRoot() eth2p0.Root
- func RandomSecp256k1Signature() []byte
- func RandomSignedAggregateAndProof() *eth2p0.SignedAggregateAndProof
- func RandomSignedSyncContributionAndProof() *altair.SignedContributionAndProof
- func RandomSignedValidatorRegistration(t *testing.T) *eth2v1.SignedValidatorRegistration
- func RandomSlot() eth2p0.Slot
- func RandomSyncAggregate() *altair.SyncAggregate
- func RandomSyncCommitteeContribution() *altair.SyncCommitteeContribution
- func RandomSyncCommitteeDuty(t *testing.T) *eth2v1.SyncCommitteeDuty
- func RandomSyncCommitteeMessage() *altair.SyncCommitteeMessage
- func RandomSyncCommitteeSelection() *eth2exp.SyncCommitteeSelection
- func RandomSyncContributionAndProof() *altair.ContributionAndProof
- func RandomUnsignedDataSet(t *testing.T) core.UnsignedDataSet
- func RandomVIdx() eth2p0.ValidatorIndex
- func RandomValidator(t *testing.T) *eth2v1.Validator
- func RandomValidatorRegistration(t *testing.T) *eth2v1.ValidatorRegistration
- func RandomVersionedSignedValidatorRegistration(t *testing.T) *eth2api.VersionedSignedValidatorRegistration
- func RandomWithdrawalIdx() capella.WithdrawalIndex
- func RandomWithdrawals() []*capella.Withdrawal
- func RequireGoldenBytes(t *testing.T, data []byte, opts ...func(*string))
- func RequireGoldenJSON(t *testing.T, data interface{}, opts ...func(*string))
- func RequireNoError(t *testing.T, err error)
- func SkipIfBindErr(t *testing.T, err error)
- func WithFilename(name string) func(*string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableAddr ¶
AvailableAddr returns an available local tcp address.
Note that this is unfortunately only best-effort. Since the port is not "locked" or "reserved", other processes sometimes grab the port. Remember to call SkipIfBindErr as workaround for this issue.
func AvailableMultiAddr ¶ added in v0.10.0
AvailableMultiAddr returns an available local tcp address as a multiaddr.
Note that this is unfortunately only best-effort. Since the port is not "locked" or "reserved", other processes sometimes grab the port. Remember to call SkipIfBindErr as workaround for this issue.
func RandomAggregateAndProof ¶ added in v0.10.1
func RandomAggregateAndProof() *eth2p0.AggregateAndProof
func RandomAltairBeaconBlock ¶ added in v0.3.0
func RandomAltairBeaconBlock() *altair.BeaconBlock
func RandomAltairBeaconBlockBody ¶ added in v0.3.0
func RandomAltairBeaconBlockBody() *altair.BeaconBlockBody
func RandomArray32 ¶ added in v0.3.0
func RandomArray32() [32]byte
func RandomAttestation ¶
func RandomAttestation() *eth2p0.Attestation
func RandomAttestationData ¶
func RandomAttestationData() *eth2p0.AttestationData
func RandomAttestationDuty ¶
func RandomAttestationDuty(t *testing.T) *eth2v1.AttesterDuty
func RandomBLSSignature ¶ added in v0.7.0
func RandomBeaconCommitteeSelection ¶ added in v0.11.0
func RandomBeaconCommitteeSelection() *eth2exp.BeaconCommitteeSelection
func RandomBellatrixBeaconBlock ¶ added in v0.3.0
func RandomBellatrixBeaconBlock() *bellatrix.BeaconBlock
func RandomBellatrixBeaconBlockBody ¶ added in v0.3.0
func RandomBellatrixBeaconBlockBody() *bellatrix.BeaconBlockBody
func RandomBellatrixBlindedBeaconBlock ¶ added in v0.9.0
func RandomBellatrixBlindedBeaconBlock() *eth2bellatrix.BlindedBeaconBlock
func RandomBellatrixBlindedBeaconBlockBody ¶ added in v0.9.0
func RandomBellatrixBlindedBeaconBlockBody() *eth2bellatrix.BlindedBeaconBlockBody
func RandomBellatrixCoreVersionedBeaconBlock ¶ added in v0.13.0
func RandomBellatrixCoreVersionedBeaconBlock() core.VersionedBeaconBlock
func RandomBellatrixCoreVersionedSignedBeaconBlock ¶ added in v0.13.0
func RandomBellatrixCoreVersionedSignedBeaconBlock() core.VersionedSignedBeaconBlock
func RandomBellatrixExecutionPayLoad ¶ added in v0.13.0
func RandomBellatrixExecutionPayLoad() *bellatrix.ExecutionPayload
func RandomBellatrixExecutionPayloadHeader ¶ added in v0.13.0
func RandomBellatrixExecutionPayloadHeader() *bellatrix.ExecutionPayloadHeader
func RandomBellatrixVersionedBlindedBeaconBlock ¶ added in v0.13.0
func RandomBellatrixVersionedBlindedBeaconBlock() core.VersionedBlindedBeaconBlock
func RandomBellatrixVersionedSignedBlindedBeaconBlock ¶ added in v0.13.0
func RandomBellatrixVersionedSignedBlindedBeaconBlock() core.VersionedSignedBlindedBeaconBlock
func RandomBitList ¶
func RandomBitList() bitfield.Bitlist
func RandomBitVec ¶ added in v0.10.1
func RandomBitVec() bitfield.Bitvector128
func RandomBytes20 ¶ added in v0.10.1
func RandomBytes20() []byte
func RandomBytes32 ¶ added in v0.3.0
func RandomBytes32() []byte
func RandomBytes48 ¶ added in v0.12.0
func RandomBytes48() []byte
func RandomCapellaBeaconBlock ¶ added in v0.13.0
func RandomCapellaBeaconBlock() *capella.BeaconBlock
func RandomCapellaBeaconBlockBody ¶ added in v0.13.0
func RandomCapellaBeaconBlockBody() *capella.BeaconBlockBody
func RandomCapellaBlindedBeaconBlock ¶ added in v0.13.0
func RandomCapellaBlindedBeaconBlock() *eth2capella.BlindedBeaconBlock
func RandomCapellaBlindedBeaconBlockBody ¶ added in v0.13.0
func RandomCapellaBlindedBeaconBlockBody() *eth2capella.BlindedBeaconBlockBody
func RandomCapellaCoreVersionedBeaconBlock ¶ added in v0.13.0
func RandomCapellaCoreVersionedBeaconBlock() core.VersionedBeaconBlock
func RandomCapellaCoreVersionedSignedBeaconBlock ¶ added in v0.13.0
func RandomCapellaCoreVersionedSignedBeaconBlock() core.VersionedSignedBeaconBlock
func RandomCapellaExecutionPayload ¶ added in v0.13.0
func RandomCapellaExecutionPayload() *capella.ExecutionPayload
func RandomCapellaExecutionPayloadHeader ¶ added in v0.13.0
func RandomCapellaExecutionPayloadHeader() *capella.ExecutionPayloadHeader
func RandomCapellaVersionedBlindedBeaconBlock ¶ added in v0.13.0
func RandomCapellaVersionedBlindedBeaconBlock() core.VersionedBlindedBeaconBlock
func RandomCapellaVersionedSignedBeaconBlock ¶ added in v0.13.0
func RandomCapellaVersionedSignedBeaconBlock() *spec.VersionedSignedBeaconBlock
RandomCapellaVersionedSignedBeaconBlock returns a random signed capella beacon block.
func RandomCapellaVersionedSignedBlindedBeaconBlock ¶ added in v0.13.0
func RandomCapellaVersionedSignedBlindedBeaconBlock() core.VersionedSignedBlindedBeaconBlock
func RandomCheckpoint ¶
func RandomCheckpoint() *eth2p0.Checkpoint
func RandomCommIdx ¶
func RandomCommIdx() eth2p0.CommitteeIndex
func RandomCoreAttestationData ¶ added in v0.7.0
func RandomCoreAttestationData(t *testing.T) core.AttestationData
func RandomCoreBeaconCommitteeSelection ¶ added in v0.11.0
func RandomCoreBeaconCommitteeSelection() core.BeaconCommitteeSelection
func RandomCorePubKey ¶
RandomCorePubKey returns a random core workflow pubkey.
func RandomCoreSignature ¶
func RandomCoreSignedRandao ¶ added in v0.12.0
func RandomCoreSignedRandao() core.SignedRandao
func RandomCoreSignedSyncContributionAndProof ¶ added in v0.12.0
func RandomCoreSignedSyncContributionAndProof() core.SignedSyncContributionAndProof
func RandomCoreSyncCommitteeSelection ¶ added in v0.12.0
func RandomCoreSyncCommitteeSelection() core.SyncCommitteeSelection
func RandomCoreSyncContribution ¶ added in v0.10.1
func RandomCoreSyncContribution() core.SyncContribution
func RandomCoreVersionedSignedValidatorRegistration ¶ added in v0.10.0
func RandomCoreVersionedSignedValidatorRegistration(t *testing.T) core.VersionedSignedValidatorRegistration
func RandomETHAddress ¶ added in v0.4.0
func RandomETHAddress() string
func RandomEpoch ¶
func RandomEth2PubKey ¶
RandomEth2PubKey returns a random eth2 phase0 bls pubkey.
func RandomEth2Signature ¶
func RandomEth2Signature() eth2p0.BLSSignature
func RandomExecutionAddress ¶ added in v0.10.0
func RandomExecutionAddress() bellatrix.ExecutionAddress
func RandomExit ¶ added in v0.6.0
func RandomExit() *eth2p0.SignedVoluntaryExit
func RandomGwei ¶ added in v0.13.0
func RandomPhase0BeaconBlock ¶ added in v0.3.0
func RandomPhase0BeaconBlock() *eth2p0.BeaconBlock
func RandomPhase0BeaconBlockBody ¶ added in v0.3.0
func RandomPhase0BeaconBlockBody() *eth2p0.BeaconBlockBody
func RandomProposerDuty ¶
func RandomProposerDuty(t *testing.T) *eth2v1.ProposerDuty
func RandomRoot ¶
func RandomSecp256k1Signature ¶ added in v0.10.1
func RandomSecp256k1Signature() []byte
RandomSecp256k1Signature returns a random secp256k1 ECDSA signature with the last byte set to 0, 1, 27 or 28.
func RandomSignedAggregateAndProof ¶ added in v0.10.1
func RandomSignedAggregateAndProof() *eth2p0.SignedAggregateAndProof
func RandomSignedSyncContributionAndProof ¶ added in v0.10.1
func RandomSignedSyncContributionAndProof() *altair.SignedContributionAndProof
func RandomSignedValidatorRegistration ¶ added in v0.10.0
func RandomSignedValidatorRegistration(t *testing.T) *eth2v1.SignedValidatorRegistration
func RandomSlot ¶
func RandomSyncAggregate ¶ added in v0.3.0
func RandomSyncAggregate() *altair.SyncAggregate
func RandomSyncCommitteeContribution ¶ added in v0.10.1
func RandomSyncCommitteeContribution() *altair.SyncCommitteeContribution
func RandomSyncCommitteeDuty ¶ added in v0.12.0
func RandomSyncCommitteeDuty(t *testing.T) *eth2v1.SyncCommitteeDuty
func RandomSyncCommitteeMessage ¶ added in v0.11.0
func RandomSyncCommitteeMessage() *altair.SyncCommitteeMessage
func RandomSyncCommitteeSelection ¶ added in v0.12.0
func RandomSyncCommitteeSelection() *eth2exp.SyncCommitteeSelection
func RandomSyncContributionAndProof ¶ added in v0.10.1
func RandomSyncContributionAndProof() *altair.ContributionAndProof
func RandomUnsignedDataSet ¶ added in v0.4.0
func RandomUnsignedDataSet(t *testing.T) core.UnsignedDataSet
func RandomVIdx ¶
func RandomVIdx() eth2p0.ValidatorIndex
func RandomValidatorRegistration ¶ added in v0.10.0
func RandomValidatorRegistration(t *testing.T) *eth2v1.ValidatorRegistration
func RandomVersionedSignedValidatorRegistration ¶ added in v0.10.0
func RandomVersionedSignedValidatorRegistration(t *testing.T) *eth2api.VersionedSignedValidatorRegistration
func RandomWithdrawalIdx ¶ added in v0.13.0
func RandomWithdrawalIdx() capella.WithdrawalIndex
func RandomWithdrawals ¶ added in v0.13.0
func RandomWithdrawals() []*capella.Withdrawal
func RequireGoldenBytes ¶
RequireGoldenBytes asserts that a golden testdata file exists containing the exact data. This is heavily inspired from https://github.com/sebdah/goldie.
func RequireGoldenJSON ¶
RequireGoldenJSON asserts that a golden testdata file exists containing the JSON serialised form of the data object. This is heavily inspired from https://github.com/sebdah/goldie.
func RequireNoError ¶ added in v0.10.1
RequireNoError extends require.NoError with additional error stack trace and structured field logging for improved test debugging.
func SkipIfBindErr ¶ added in v0.3.0
SkipIfBindErr skips the test if the error is "bind: address already in use". This is a workaround for the issue related to AvailableAddr.
func WithFilename ¶ added in v0.10.0
WithFilename configures a custom golden test filename.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package beaconmock provides a mock beacon node server and client primarily for testing.
|
Package beaconmock provides a mock beacon node server and client primarily for testing. |
Command combine combines threshold BLS secret shares into the group/root BLS secret.
|
Command combine combines threshold BLS secret shares into the group/root BLS secret. |
Command compose provides a tool to run, test, debug local charon clusters using docker-compose.
|
Command compose provides a tool to run, test, debug local charon clusters using docker-compose. |
Command genchangelog provides a tool to generate a changelog.md file from a git commit range.
|
Command genchangelog provides a tool to generate a changelog.md file from a git commit range. |
Command trackpr tracks a PR without a ticket and adds it to GitHub project board.
|
Command trackpr tracks a PR without a ticket and adds it to GitHub project board. |
Package validatormock provides mock validator client functionality.
|
Package validatormock provides mock validator client functionality. |
Command verifypr provides a tool to verify charon PRs against the template defined in docs/contibuting.md.
|
Command verifypr provides a tool to verify charon PRs against the template defined in docs/contibuting.md. |