# Functions
AccountFixture returns a randomly generated account.
AccountKeyDefaultFixture returns a randomly generated ECDSA/SHA3 account key.
AccountKeyFixture returns a randomly generated account key.
No description provided by the author
No description provided by the author
AddVersionBeacon adds blocks sequence with given VersionBeacon so this service events takes effect in Flow protocol.
No description provided by the author
AlterTransactionForCluster modifies a transaction nonce until it is assigned to the target cluster.
No description provided by the author
AreNumericallyClose returns true if the two floats are within epsilon of each other.
AssertClosesBefore asserts that the given channel closes before the duration expires.
AssertEqualBlocksLenAndOrder asserts that both a segment of blocks have the same len and blocks are in the same order.
AssertErrSubstringMatch asserts that two errors match with substring checking on the Error method (`expected` must be a substring of `actual`, to account for the actual error being wrapped).
No description provided by the author
AssertNotClosesBefore asserts that the given channel does not close before the duration expires.
AssertReturnsBefore asserts that the given function returns before the duration expires.
No description provided by the author
AsSlashable returns the input message T, wrapped as a flow.Slashable instance with a random origin ID.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BlockEventsFixture returns a block events model populated with random events of length n.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BootstrapFixture generates all the artifacts necessary to bootstrap the protocol state.
No description provided by the author
CertifyBlock returns a quorum certificate for the given block header.
No description provided by the author
No description provided by the author
ChainFixture creates a list of blocks that forms a chain.
ChainFixtureFrom creates a chain of blocks starting from a given parent block, the total number of blocks in the chain is specified by the given count.
No description provided by the author
ChunkDataPackRequestFixture creates a chunk data request with some default values, i.e., one agree execution node, one disagree execution node, and height of zero.
ChunkDataPackRequestListFixture creates and returns a list of chunk data pack requests fixtures.
No description provided by the author
ChunkDataResponseMessageListFixture creates a list of chunk data response messages each with a single-transaction collection, and random chunk ID.
ChunkDataResponseMsgFixture creates a chunk data response message with a single-transaction collection, and random chunk ID.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChunkStatusListFixture receives an execution result, samples `n` chunks out of it and creates a chunk status for them.
ChunkStatusListToChunkLocatorFixture extracts chunk locators from a list of chunk statuses.
ClosedChannel returns a closed channel.
ClusterAssignment creates an assignment list with n clusters and with nodes evenly distributed among clusters.
No description provided by the author
No description provided by the author
ClusterBlockWithParent creates a new cluster consensus block that is valid with respect to the given parent block.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CompleteIdentitySet takes a number of identities and completes the missing roles.
No description provided by the author
CrashTest safely tests functions that crash (as the expected behavior) by checking that running the function creates an error and an expected error message.
CrashTestWithExpectedStatus checks for the test crashing with a specific exit code.
CreateNParticipantsWithMyRole creates a list of identities from given roles.
No description provided by the author
DKGBroadcastMessageFixture creates a single DKG broadcast message with random fields.
DKGMessageFixture creates a single DKG message with random fields.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EnsureEventsIndexSeq checks if values of given event index sequence are monotonically increasing.
No description provided by the author
No description provided by the author
No description provided by the author
EpochCommitFixtureByChainID returns an EpochCommit service event as a Cadence event representation and as a protocol model representation.
EpochProtocolStateEntryFixture returns a flow.MinEpochStateEntry fixture.
EpochRecoverFixture creates a valid EpochRecover with default properties for testing.
EpochRecoverFixtureByChainID returns an EpochRecover service event as a Cadence event representation and as a protocol model representation.
No description provided by the author
No description provided by the author
EpochSetupFixture creates a valid EpochSetup with default properties for testing.
EpochSetupFixtureByChainID returns an EpochSetup service event as a Cadence event representation and as a protocol model representation.
No description provided by the author
No description provided by the author
EpochStateFixture creates a fixture with correctly structured data.
EventFixture returns an event.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FailOnIrrecoverableError waits for either the done signal, or an error to be sent over the error channel.
FinalizedProtocolStateWithParticipants returns a protocol state with finalized participants.
No description provided by the author
No description provided by the author
GenerateRandomStringWithLen returns a string of random alpha characters of the provided length.
No description provided by the author
this is done by printing the state commitment in TestBootstrapLedger test with different chain ID.
GetFlowProtocolEventID returns the event ID for the event provided.
returns a deterministic math/rand PRG that can be used for deterministic randomness in tests only.
GossipSubMessageFixture returns a gossip sub message fixture for the specified topic.
GossipSubMessageFixtures returns a list of gossipsub message fixtures.
No description provided by the author
HeadersFromMap creates a storage header mock that backed by a given map.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IdentityFixture returns a node identity.
IdentityListFixture returns a list of node identity objects.
IdentityWithNetworkingKeyFixture returns a node identity and networking private key.
No description provided by the author
No description provided by the author
No description provided by the author
InsertAndFinalize inserts, then finalizes, the input block.
InterfafceToCdcValues decodes jsoncdc encoded values from interface -> cadence value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LibP2PResourceLimitOverrideFixture returns a random resource limit override for testing.
No description provided by the author
Logger returns a zerolog use -vv flag to print debugging logs for tests.
go:noinline.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MatchEpochExtension matches an epoch extension argument passed to a mocked component.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NetworkCodec returns cbor codec.
No description provided by the author
NetworkingPrivKeyFixture returns random ECDSAP256 private key.
NetworkTopology returns the default topology for testing purposes.
NewClusterStateChecker returns a state checker for the given state.
NewEpochBuilder returns a new EpochBuilder which will build epochs using the given states.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewProtectedMap returns a new ProtectedMap with the given types.
No description provided by the author
No description provided by the author
NewTestTime returns new TestTime.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NoopTxScript returns a Cadence script for a no-op transaction.
P2PRPCFixture returns a pubsub RPC fixture.
P2PRPCGraftFixture returns a control message rpc Graft fixture.
P2PRPCGraftFixtures returns n number of control message rpc Graft fixtures.
P2PRPCIHaveFixture returns a control message rpc iHave fixture.
P2PRPCIHaveFixtures returns n number of control message where n = len(topics) rpc iHave fixtures with m number of message ids each.
P2PRPCIWantFixture returns a control message rpc iWant fixture.
P2PRPCIWantFixtures returns n number of control message rpc iWant fixtures with m number of message ids each.
P2PRPCPruneFixture returns a control message rpc Prune fixture.
P2PRPCPruneFixtures returns n number of control message rpc Prune fixtures.
No description provided by the author
No description provided by the author
PeerIdFixture creates a random and unique peer ID (libp2p node ID).
PeerIdFixtures creates random and unique peer IDs (libp2p node IDs).
No description provided by the author
PrintHeapInfo prints heap object allocation through given logger.
PrivateKeyFixture returns a random private key with specified signature algorithm and seed length.
PrivateKeyFixtureByIdentifier returns a private key for a given node.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RandomByteSlice is a test helper that generates a cryptographically secure random byte slice of size n.
No description provided by the author
No description provided by the author
RandomStringFixture is a test helper that generates a cryptographically secure random string of size n.
No description provided by the author
No description provided by the author
ReadyDoneify sets up a generated mock to respond to Ready and Done lifecycle methods.
ReceiptAndSealForBlock returns a receipt with service events and a seal for them for a given block.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReconnectBlocksAndReceipts re-computes each block's PayloadHash and ParentID so that all the blocks are connected.
No description provided by the author
RegisterIDFixture returns a RegisterID with a fixed key and owner.
RequireCloseBefore requires that the given channel returns before the duration expires.
RequireClosed is a test helper function that fails the test if channel `ch` is not closed.
RequireComponentsDoneBefore invokes the done method of each of the input components concurrently, and fails the test if any components shutdown takes longer than the specified duration.
RequireComponentsReadyBefore invokes the ready method of each of the input components concurrently, and fails the test if any components startup takes longer than the specified duration.
RequireConcurrentCallsReturnBefore is a test helper that runs function `f` count-many times concurrently, and requires all invocations to return within duration.
No description provided by the author
RequireNeverClosedWithin is a test helper function that fails the test if channel `ch` is closed before the determined duration.
RequireNeverReturnBefore is a test helper that tries invoking function `f` and fails the test if either: - function `f` is not invoked within 1 second.
RequireNotClosed is a test helper function that fails the test if channel `ch` is closed.
RequireNumericallyClose is a wrapper around require.Equal that allows for a small epsilon difference between two floats.
RequireReturnsBefore requires that the given function returns before the duration expires.
No description provided by the author
RootEpochProtocolStateFixture creates a fixture with correctly structured Epoch sub-state.
RootSnapshotFixture returns a snapshot representing a root chain state, for example one as returned from BootstrapFixture.
No description provided by the author
No description provided by the author
No description provided by the author
RunWithTypedBadgerDB creates a Badger DB that is passed to f and closed after f returns.
SealBlock seals a block B by building two blocks on it, the first containing a receipt for the block (BR), the second (BS) containing a seal for the block.
SeedFixture returns a random []byte with length n.
SeedFixtures returns a list of m random []byte, each having length n.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StakingPrivKeyFixture returns a random BLS12381 private keyf.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TransactionForCluster generates a transaction that will be assigned to the target cluster ID.
No description provided by the author
No description provided by the author
No description provided by the author
Uint64InRange returns a uint64 value drawn from the uniform random distribution [min,max].
VerifiableChunkDataFixture returns a complete verifiable chunk with an execution receipt referencing the block/collections.
No description provided by the author
No description provided by the author
VersionBeaconFixtureByChainID returns a VersionTable service event as a Cadence event representation and as a protocol model representation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithAddress sets the network address of identity fixture.
No description provided by the author
WithAllRoles can be used used to ensure an IdentityList fixtures contains all the roles required for a valid genesis block.
Same as above, but omitting a certain role for cases where we are manually setting up nodes or a particular role.
WithAllTheFixins ensures a payload contains no empty slice fields.
No description provided by the author
WithApproximateSize sets the ChunkDataResponse to be approximately bytes in size.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithExecutionResults will add execution results to payload.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithGrafts sets the grafts on the rpc control message.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithIHaves sets the iHaves on the rpc control message.
WithInitialWeight sets the initial weight on an identity fixture.
WithIWants sets the iWants on the rpc control message.
No description provided by the author
WithNetworkingKey sets the networking public key of identity fixture.
WithNextEpochProtocolState creates a fixture with correctly structured data for next epoch.
WithNodeID adds a node ID with the given first byte to an identity.
No description provided by the author
No description provided by the author
WithParticipationStatus sets the epoch participation status on an identity fixture.
No description provided by the author
No description provided by the author
WithPrunes sets the prunes on the rpc control message.
No description provided by the author
WithRandomPublicKeys adds random public keys to an identity.
No description provided by the author
WithReceiptsAndNoResults will add receipt to payload only.
No description provided by the author
No description provided by the author
WithRole adds a role to an identity fixture.
No description provided by the author
No description provided by the author
No description provided by the author
WithStakingPubKey adds a staking public key to the identity.
No description provided by the author
No description provided by the author
No description provided by the author
WithValidDKG updated protocol state with correctly structured data for DKG.
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
Pre-calculated state commitment with root account with the above private key.
No description provided by the author
No description provided by the author
No description provided by the author
uses code that has been deprecated / disabled.
flaky.
long running.
requires the environment to be configured with GCP credentials.
resource intensive test.
not fully implemented or broken and needs to be fixed.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
ClusterStateChecker is a test utility for checking cluster state.
EpochBuilder is a testing utility for building epochs into chain state.
EpochHeights is a structure caching the results of building an epoch with EpochBuilder.
LoggerHook implements the zerolog.Hook interface and can be used to capture logs for testing purposes.
MockEntity implements a bare minimum entity for sake of test.
ProtectedMap is a thread-safe map.
TestTime is a fake time used for testing.
UpdatableIDProvider implements an IdentityProvider which can be manually updated by setting the IdentityList to a new value.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author