Documentation ¶
Overview ¶
Package testutil provides test utilities.
Index ¶
- func AvailableAddr(t *testing.T) *net.TCPAddr
- func CreateHost(t *testing.T, addr *net.TCPAddr) host.Host
- func RandomAltairBeaconBlock(t *testing.T) *altair.BeaconBlock
- func RandomAltairBeaconBlockBody(t *testing.T) *altair.BeaconBlockBody
- func RandomArray32() [32]byte
- func RandomAttestation() *eth2p0.Attestation
- func RandomAttestationData() *eth2p0.AttestationData
- func RandomAttestationDuty(t *testing.T) *eth2v1.AttesterDuty
- func RandomBellatrixBeaconBlock(t *testing.T) *bellatrix.BeaconBlock
- func RandomBellatrixBeaconBlockBody(t *testing.T) *bellatrix.BeaconBlockBody
- func RandomBitList() bitfield.Bitlist
- func RandomBytes32() []byte
- func RandomCheckpoint() *eth2p0.Checkpoint
- func RandomCommIdx() eth2p0.CommitteeIndex
- func RandomCorePubKey(t *testing.T) core.PubKey
- func RandomCoreSignature() core.Signature
- 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 RandomExecutionPayLoad() *bellatrix.ExecutionPayload
- func RandomExit() *eth2p0.SignedVoluntaryExit
- func RandomPhase0BeaconBlock() *eth2p0.BeaconBlock
- func RandomPhase0BeaconBlockBody() *eth2p0.BeaconBlockBody
- func RandomProposerDuty(t *testing.T) *eth2v1.ProposerDuty
- func RandomRoot() eth2p0.Root
- func RandomSlot() eth2p0.Slot
- func RandomSyncAggregate(t *testing.T) *altair.SyncAggregate
- func RandomUnsignedDataSet(t *testing.T) core.UnsignedDataSet
- func RandomVIdx() eth2p0.ValidatorIndex
- func RequireGoldenBytes(t *testing.T, data []byte)
- func RequireGoldenJSON(t *testing.T, data interface{})
- func SkipIfBindErr(t *testing.T, err error)
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 RandomAltairBeaconBlock ¶ added in v0.3.0
func RandomAltairBeaconBlock(t *testing.T) *altair.BeaconBlock
func RandomAltairBeaconBlockBody ¶ added in v0.3.0
func RandomAltairBeaconBlockBody(t *testing.T) *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 RandomBellatrixBeaconBlock ¶ added in v0.3.0
func RandomBellatrixBeaconBlock(t *testing.T) *bellatrix.BeaconBlock
func RandomBellatrixBeaconBlockBody ¶ added in v0.3.0
func RandomBellatrixBeaconBlockBody(t *testing.T) *bellatrix.BeaconBlockBody
func RandomBitList ¶
func RandomBitList() bitfield.Bitlist
func RandomBytes32 ¶ added in v0.3.0
func RandomBytes32() []byte
func RandomCheckpoint ¶
func RandomCheckpoint() *eth2p0.Checkpoint
func RandomCommIdx ¶
func RandomCommIdx() eth2p0.CommitteeIndex
func RandomCorePubKey ¶
RandomCorePubKey returns a random core workflow pubkey.
func RandomCoreSignature ¶
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 RandomExecutionPayLoad ¶ added in v0.3.0
func RandomExecutionPayLoad() *bellatrix.ExecutionPayload
func RandomExit ¶ added in v0.6.0
func RandomExit() *eth2p0.SignedVoluntaryExit
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 RandomSlot ¶
func RandomSyncAggregate ¶ added in v0.3.0
func RandomSyncAggregate(t *testing.T) *altair.SyncAggregate
func RandomUnsignedDataSet ¶ added in v0.4.0
func RandomUnsignedDataSet(t *testing.T) core.UnsignedDataSet
func RandomVIdx ¶
func RandomVIdx() eth2p0.ValidatorIndex
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 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.
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 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. |
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. |