Documentation
¶
Index ¶
- Variables
- func AdjustEventsMetadata(events []flow.Event) []flow.Event
- func Assert(conditional bool, msg string)
- func Assertf(conditional bool, msg string, args ...any)
- func CorruptAddress(addr flow.Address, chainID flow.ChainID) flow.Address
- func InclusiveRange[T ~uint64 | ~uint32 | ~uint | ~int64 | ~int32 | ~int](g *RandomGenerator, min, max T) T
- func NoError(err error)
- func RandomElement[T any](g *RandomGenerator, slice []T) T
- func ToCadenceEventType(eventType flow.EventType) *cadence.EventType
- func ToSDKAddress(addr flow.Address) sdk.Address
- type AddressGenerator
- func (g *AddressGenerator) Fixture(opts ...AddressOption) flow.Address
- func (g *AddressGenerator) List(n int, opts ...AddressOption) []flow.Address
- func (f AddressGenerator) ServiceAddress() AddressOption
- func (f AddressGenerator) WithChainID(chainID flow.ChainID) AddressOption
- func (f AddressGenerator) WithIndex(index uint64) AddressOption
- type AddressOption
- type AggregatedSignatureGenerator
- func (g *AggregatedSignatureGenerator) Fixture(opts ...AggregatedSignatureOption) flow.AggregatedSignature
- func (g *AggregatedSignatureGenerator) List(n int, opts ...AggregatedSignatureOption) []flow.AggregatedSignature
- func (f AggregatedSignatureGenerator) WithSignerIDs(signerIDs flow.IdentifierList) AggregatedSignatureOption
- func (f AggregatedSignatureGenerator) WithVerifierSignatures(sigs ...crypto.Signature) AggregatedSignatureOption
- type AggregatedSignatureOption
- type BlockExecutionDataEntityGenerator
- func (g *BlockExecutionDataEntityGenerator) Fixture(opts ...BlockExecutionDataOption) *execution_data.BlockExecutionDataEntity
- func (g *BlockExecutionDataEntityGenerator) List(n int, opts ...BlockExecutionDataOption) []*execution_data.BlockExecutionDataEntity
- func (f BlockExecutionDataEntityGenerator) WithBlockID(blockID flow.Identifier) BlockExecutionDataOption
- func (f BlockExecutionDataEntityGenerator) WithChunkExecutionDatas(chunks ...*execution_data.ChunkExecutionData) BlockExecutionDataOption
- type BlockExecutionDataGenerator
- func (g *BlockExecutionDataGenerator) Fixture(opts ...BlockExecutionDataOption) *execution_data.BlockExecutionData
- func (g *BlockExecutionDataGenerator) List(n int, opts ...BlockExecutionDataOption) []*execution_data.BlockExecutionData
- func (f BlockExecutionDataGenerator) WithBlockID(blockID flow.Identifier) BlockExecutionDataOption
- func (f BlockExecutionDataGenerator) WithChunkExecutionDatas(chunks ...*execution_data.ChunkExecutionData) BlockExecutionDataOption
- type BlockExecutionDataOption
- type BlockGenerator
- func (g *BlockGenerator) Fixture(opts ...BlockOption) *flow.Block
- func (g *BlockGenerator) Genesis(opts ...BlockOption) *flow.Block
- func (g *BlockGenerator) List(n int, opts ...BlockOption) []*flow.Block
- func (f BlockGenerator) WithChainID(chainID flow.ChainID) BlockOption
- func (f BlockGenerator) WithHeaderBody(headerBody *flow.HeaderBody) BlockOption
- func (f BlockGenerator) WithHeight(height uint64) BlockOption
- func (f BlockGenerator) WithLastViewTC(lastViewTC *flow.TimeoutCertificate) BlockOption
- func (f BlockGenerator) WithParent(parentID flow.Identifier, parentView uint64, parentHeight uint64) BlockOption
- func (f BlockGenerator) WithParentHeader(parent *flow.Header) BlockOption
- func (f BlockGenerator) WithParentView(view uint64) BlockOption
- func (f BlockGenerator) WithParentVoterIndices(indices []byte) BlockOption
- func (f BlockGenerator) WithParentVoterSigData(data []byte) BlockOption
- func (f BlockGenerator) WithPayload(payload *flow.Payload) BlockOption
- func (f BlockGenerator) WithProposerID(proposerID flow.Identifier) BlockOption
- func (f BlockGenerator) WithTimestamp(timestamp uint64) BlockOption
- func (f BlockGenerator) WithView(view uint64) BlockOption
- type BlockOption
- type ChunkExecutionDataGenerator
- func (g *ChunkExecutionDataGenerator) Fixture(opts ...ChunkExecutionDataOption) *execution_data.ChunkExecutionData
- func (g *ChunkExecutionDataGenerator) List(n int, opts ...ChunkExecutionDataOption) []*execution_data.ChunkExecutionData
- func (f ChunkExecutionDataGenerator) WithCollection(collection *flow.Collection) ChunkExecutionDataOption
- func (f ChunkExecutionDataGenerator) WithEvents(events flow.EventsList) ChunkExecutionDataOption
- func (f ChunkExecutionDataGenerator) WithMinSize(minSize int) ChunkExecutionDataOption
- func (f ChunkExecutionDataGenerator) WithTransactionResults(results ...flow.LightTransactionResult) ChunkExecutionDataOption
- func (f ChunkExecutionDataGenerator) WithTrieUpdate(trieUpdate *ledger.TrieUpdate) ChunkExecutionDataOption
- type ChunkExecutionDataOption
- type ChunkGenerator
- func (g *ChunkGenerator) Fixture(opts ...ChunkOption) *flow.Chunk
- func (g *ChunkGenerator) List(n int, opts ...ChunkOption) []*flow.Chunk
- func (f ChunkGenerator) WithBlockID(blockID flow.Identifier) ChunkOption
- func (f ChunkGenerator) WithCollectionIndex(collectionIndex uint) ChunkOption
- func (f ChunkGenerator) WithEndState(endState flow.StateCommitment) ChunkOption
- func (f ChunkGenerator) WithEventCollection(eventCollection flow.Identifier) ChunkOption
- func (f ChunkGenerator) WithIndex(index uint64) ChunkOption
- func (f ChunkGenerator) WithNumberOfTransactions(numTxs uint64) ChunkOption
- func (f ChunkGenerator) WithServiceEventCount(count uint16) ChunkOption
- func (f ChunkGenerator) WithStartState(startState flow.StateCommitment) ChunkOption
- func (f ChunkGenerator) WithTotalComputationUsed(computation uint64) ChunkOption
- type ChunkOption
- type CollectionGenerator
- func (g *CollectionGenerator) Fixture(opts ...CollectionOption) *flow.Collection
- func (g *CollectionGenerator) List(n int, opts ...CollectionOption) []*flow.Collection
- func (f CollectionGenerator) WithTransactions(transactions ...*flow.TransactionBody) CollectionOption
- func (f CollectionGenerator) WithTxCount(count int) CollectionOption
- type CollectionGuaranteeGenerator
- func (g *CollectionGuaranteeGenerator) Fixture(opts ...CollectionGuaranteeOption) *flow.CollectionGuarantee
- func (g *CollectionGuaranteeGenerator) List(n int, opts ...CollectionGuaranteeOption) []*flow.CollectionGuarantee
- func (f CollectionGuaranteeGenerator) WithClusterChainID(clusterChainID flow.ChainID) CollectionGuaranteeOption
- func (f CollectionGuaranteeGenerator) WithCollectionID(collectionID flow.Identifier) CollectionGuaranteeOption
- func (f CollectionGuaranteeGenerator) WithReferenceBlockID(blockID flow.Identifier) CollectionGuaranteeOption
- func (f CollectionGuaranteeGenerator) WithSignature(signature crypto.Signature) CollectionGuaranteeOption
- func (f CollectionGuaranteeGenerator) WithSignerIndices(signerIndices []byte) CollectionGuaranteeOption
- type CollectionGuaranteeOption
- type CollectionOption
- type CryptoGenerator
- func (g *CryptoGenerator) NetworkingPrivateKey(opts ...PrivateKeyOption) crypto.PrivateKey
- func (g *CryptoGenerator) PrivateKey(algo crypto.SigningAlgorithm, opts ...PrivateKeyOption) crypto.PrivateKey
- func (g *CryptoGenerator) PublicKeys(n int, algo crypto.SigningAlgorithm, opts ...PrivateKeyOption) []crypto.PublicKey
- func (g *CryptoGenerator) StakingPrivateKey(opts ...PrivateKeyOption) crypto.PrivateKey
- func (f CryptoGenerator) WithSeed(seed []byte) PrivateKeyOption
- type EjectNodeGenerator
- type EjectNodeOption
- type EpochCommitGenerator
- func (g *EpochCommitGenerator) Fixture(opts ...EpochCommitOption) *flow.EpochCommit
- func (g *EpochCommitGenerator) List(n int, opts ...EpochCommitOption) []*flow.EpochCommit
- func (f EpochCommitGenerator) WithClusterQCs(qcs ...flow.ClusterQCVoteData) EpochCommitOption
- func (f EpochCommitGenerator) WithClusterQCsFromAssignments(assignments flow.AssignmentList) EpochCommitOption
- func (f EpochCommitGenerator) WithCounter(counter uint64) EpochCommitOption
- func (f EpochCommitGenerator) WithDKGFromParticipants(participants flow.IdentitySkeletonList) EpochCommitOption
- type EpochCommitOption
- type EpochRecoverGenerator
- func (g *EpochRecoverGenerator) Fixture(opts ...EpochRecoverOption) *flow.EpochRecover
- func (g *EpochRecoverGenerator) List(n int, opts ...EpochRecoverOption) []*flow.EpochRecover
- func (f EpochRecoverGenerator) WithEpochCommit(commit flow.EpochCommit) EpochRecoverOption
- func (f EpochRecoverGenerator) WithEpochSetup(setup flow.EpochSetup) EpochRecoverOption
- type EpochRecoverOption
- type EpochSetupGenerator
- func (g *EpochSetupGenerator) Fixture(opts ...EpochSetupOption) *flow.EpochSetup
- func (g *EpochSetupGenerator) List(n int, opts ...EpochSetupOption) []*flow.EpochSetup
- func (f EpochSetupGenerator) WithAssignments(assignments flow.AssignmentList) EpochSetupOption
- func (f EpochSetupGenerator) WithCounter(counter uint64) EpochSetupOption
- func (f EpochSetupGenerator) WithDKGFinalViews(phase1, phase2, phase3 uint64) EpochSetupOption
- func (f EpochSetupGenerator) WithFinalView(view uint64) EpochSetupOption
- func (f EpochSetupGenerator) WithFirstView(view uint64) EpochSetupOption
- func (f EpochSetupGenerator) WithParticipants(participants flow.IdentitySkeletonList) EpochSetupOption
- func (f EpochSetupGenerator) WithRandomSource(source []byte) EpochSetupOption
- func (f EpochSetupGenerator) WithTargetDuration(duration uint64) EpochSetupOption
- func (f EpochSetupGenerator) WithTargetEndTime(endTime uint64) EpochSetupOption
- type EpochSetupOption
- type EventGenerator
- func (g *EventGenerator) Fixture(opts ...EventOption) flow.Event
- func (g *EventGenerator) ForTransaction(transactionID flow.Identifier, transactionIndex uint32, eventCount int, ...) []flow.Event
- func (g *EventGenerator) ForTransactions(transactionIDs []flow.Identifier, eventsPerTransaction int, ...) []flow.Event
- func (g *EventGenerator) List(n int, opts ...EventOption) []flow.Event
- func (f EventGenerator) WithEncoding(encoding entities.EventEncodingVersion) EventOption
- func (f EventGenerator) WithEventIndex(eventIndex uint32) EventOption
- func (f EventGenerator) WithEventType(eventType flow.EventType) EventOption
- func (f EventGenerator) WithPayload(payload []byte) EventOption
- func (f EventGenerator) WithTransactionID(transactionID flow.Identifier) EventOption
- func (f EventGenerator) WithTransactionIndex(transactionIndex uint32) EventOption
- type EventOption
- type EventTypeGenerator
- func (g *EventTypeGenerator) Fixture(opts ...EventTypeOption) flow.EventType
- func (g *EventTypeGenerator) List(n int, opts ...EventTypeOption) []flow.EventType
- func (f EventTypeGenerator) WithAddress(address flow.Address) EventTypeOption
- func (f EventTypeGenerator) WithContractName(contractName string) EventTypeOption
- func (f EventTypeGenerator) WithEventName(eventName string) EventTypeOption
- type EventTypeOption
- type ExecutionReceiptGenerator
- func (g *ExecutionReceiptGenerator) Fixture(opts ...ExecutionReceiptOption) *flow.ExecutionReceipt
- func (g *ExecutionReceiptGenerator) List(n int, opts ...ExecutionReceiptOption) []*flow.ExecutionReceipt
- func (f ExecutionReceiptGenerator) WithExecutionResult(result flow.ExecutionResult) ExecutionReceiptOption
- func (f ExecutionReceiptGenerator) WithExecutorID(executorID flow.Identifier) ExecutionReceiptOption
- func (f ExecutionReceiptGenerator) WithExecutorSignature(executorSignature crypto.Signature) ExecutionReceiptOption
- func (f ExecutionReceiptGenerator) WithSpocks(spocks ...crypto.Signature) ExecutionReceiptOption
- type ExecutionReceiptOption
- type ExecutionReceiptStubGenerator
- func (g *ExecutionReceiptStubGenerator) Fixture(opts ...ExecutionReceiptStubOption) *flow.ExecutionReceiptStub
- func (g *ExecutionReceiptStubGenerator) List(n int, opts ...ExecutionReceiptStubOption) []*flow.ExecutionReceiptStub
- func (f ExecutionReceiptStubGenerator) WithExecutorID(executorID flow.Identifier) ExecutionReceiptStubOption
- func (f ExecutionReceiptStubGenerator) WithExecutorSignature(executorSignature crypto.Signature) ExecutionReceiptStubOption
- func (f ExecutionReceiptStubGenerator) WithResultID(resultID flow.Identifier) ExecutionReceiptStubOption
- func (f ExecutionReceiptStubGenerator) WithSpocks(spocks ...crypto.Signature) ExecutionReceiptStubOption
- type ExecutionReceiptStubOption
- type ExecutionResultGenerator
- func (g *ExecutionResultGenerator) Fixture(opts ...ExecutionResultOption) *flow.ExecutionResult
- func (g *ExecutionResultGenerator) List(n int, opts ...ExecutionResultOption) []*flow.ExecutionResult
- func (f ExecutionResultGenerator) WithBlock(block *flow.Block) ExecutionResultOption
- func (f ExecutionResultGenerator) WithBlockID(blockID flow.Identifier) ExecutionResultOption
- func (f ExecutionResultGenerator) WithChunks(chunks flow.ChunkList) ExecutionResultOption
- func (f ExecutionResultGenerator) WithExecutionDataID(executionDataID flow.Identifier) ExecutionResultOption
- func (f ExecutionResultGenerator) WithFinalState(finalState flow.StateCommitment) ExecutionResultOption
- func (f ExecutionResultGenerator) WithPreviousResult(previousResult *flow.ExecutionResult) ExecutionResultOption
- func (f ExecutionResultGenerator) WithPreviousResultID(previousResultID flow.Identifier) ExecutionResultOption
- func (f ExecutionResultGenerator) WithServiceEvents(serviceEvents flow.ServiceEventList) ExecutionResultOption
- type ExecutionResultOption
- type GeneratorSuite
- func (g *GeneratorSuite) Addresses() *AddressGenerator
- func (g *GeneratorSuite) AggregatedSignatures() *AggregatedSignatureGenerator
- func (g *GeneratorSuite) BlockExecutionDataEntities() *BlockExecutionDataEntityGenerator
- func (g *GeneratorSuite) BlockExecutionDatas() *BlockExecutionDataGenerator
- func (g *GeneratorSuite) Blocks() *BlockGenerator
- func (g *GeneratorSuite) ChainID() flow.ChainID
- func (g *GeneratorSuite) ChunkExecutionDatas() *ChunkExecutionDataGenerator
- func (g *GeneratorSuite) Chunks() *ChunkGenerator
- func (g *GeneratorSuite) Collections() *CollectionGenerator
- func (g *GeneratorSuite) Crypto() *CryptoGenerator
- func (g *GeneratorSuite) EjectNodes() *EjectNodeGenerator
- func (g *GeneratorSuite) EpochCommits() *EpochCommitGenerator
- func (g *GeneratorSuite) EpochRecovers() *EpochRecoverGenerator
- func (g *GeneratorSuite) EpochSetups() *EpochSetupGenerator
- func (g *GeneratorSuite) EventTypes() *EventTypeGenerator
- func (g *GeneratorSuite) Events() *EventGenerator
- func (g *GeneratorSuite) ExecutionReceiptStubs() *ExecutionReceiptStubGenerator
- func (g *GeneratorSuite) ExecutionReceipts() *ExecutionReceiptGenerator
- func (g *GeneratorSuite) ExecutionResults() *ExecutionResultGenerator
- func (g *GeneratorSuite) Guarantees() *CollectionGuaranteeGenerator
- func (g *GeneratorSuite) Headers() *HeaderGenerator
- func (g *GeneratorSuite) Identifiers() *IdentifierGenerator
- func (g *GeneratorSuite) Identities() *IdentityGenerator
- func (g *GeneratorSuite) LedgerPaths() *LedgerPathGenerator
- func (g *GeneratorSuite) LedgerPayloads() *LedgerPayloadGenerator
- func (g *GeneratorSuite) LedgerValues() *LedgerValueGenerator
- func (g *GeneratorSuite) LightTransactionResults() *LightTransactionResultGenerator
- func (g *GeneratorSuite) Payloads() *PayloadGenerator
- func (g *GeneratorSuite) ProposalKeys() *ProposalKeyGenerator
- func (g *GeneratorSuite) ProtocolStateVersionUpgrades() *ProtocolStateVersionUpgradeGenerator
- func (g *GeneratorSuite) QuorumCertificates() *QuorumCertificateGenerator
- func (g *GeneratorSuite) QuorumCertificatesWithSignerIDs() *QuorumCertificateWithSignerIDsGenerator
- func (g *GeneratorSuite) Random() *RandomGenerator
- func (g *GeneratorSuite) Seals() *SealGenerator
- func (g *GeneratorSuite) ServiceEvents() *ServiceEventGenerator
- func (g *GeneratorSuite) SetEpochExtensionViewCounts() *SetEpochExtensionViewCountGenerator
- func (g *GeneratorSuite) Signatures() *SignatureGenerator
- func (g *GeneratorSuite) SignerIndices() *SignerIndicesGenerator
- func (g *GeneratorSuite) StateCommitments() *StateCommitmentGenerator
- func (g *GeneratorSuite) Time() *TimeGenerator
- func (g *GeneratorSuite) TimeoutCertificates() *TimeoutCertificateGenerator
- func (g *GeneratorSuite) TransactionResults() *TransactionResultGenerator
- func (g *GeneratorSuite) TransactionSignatures() *TransactionSignatureGenerator
- func (g *GeneratorSuite) Transactions() *TransactionGenerator
- func (g *GeneratorSuite) TrieUpdates() *TrieUpdateGenerator
- func (g *GeneratorSuite) VersionBeacons() *VersionBeaconGenerator
- type GeneratorSuiteOption
- type HeaderGenerator
- func (g *HeaderGenerator) Fixture(opts ...HeaderOption) *flow.Header
- func (g *HeaderGenerator) Genesis(opts ...HeaderOption) *flow.Header
- func (g *HeaderGenerator) List(n int, opts ...HeaderOption) []*flow.Header
- func (f HeaderGenerator) WithChainID(chainID flow.ChainID) HeaderOption
- func (f HeaderGenerator) WithHeight(height uint64) HeaderOption
- func (f HeaderGenerator) WithLastViewTC(lastViewTC *flow.TimeoutCertificate) HeaderOption
- func (f HeaderGenerator) WithParent(parentID flow.Identifier, parentView uint64, parentHeight uint64) HeaderOption
- func (f HeaderGenerator) WithParentHeader(parent *flow.Header) HeaderOption
- func (f HeaderGenerator) WithParentView(view uint64) HeaderOption
- func (f HeaderGenerator) WithParentVoterIndices(indices []byte) HeaderOption
- func (f HeaderGenerator) WithParentVoterSigData(data []byte) HeaderOption
- func (f HeaderGenerator) WithPayloadHash(hash flow.Identifier) HeaderOption
- func (f HeaderGenerator) WithProposerID(proposerID flow.Identifier) HeaderOption
- func (f HeaderGenerator) WithSourceOfRandomness(source []byte) HeaderOption
- func (f HeaderGenerator) WithTimestamp(timestamp uint64) HeaderOption
- func (f HeaderGenerator) WithView(view uint64) HeaderOption
- type HeaderOption
- type IdentifierGenerator
- type IdentifierOption
- type IdentityGenerator
- func (g *IdentityGenerator) Fixture(opts ...IdentityOption) *flow.Identity
- func (g *IdentityGenerator) List(n int, opts ...IdentityOption) flow.IdentityList
- func (f IdentityGenerator) WithAddress(address string) IdentityOption
- func (f IdentityGenerator) WithAllRoles() IdentityOption
- func (f IdentityGenerator) WithAllRolesExcept(except ...flow.Role) IdentityOption
- func (f IdentityGenerator) WithEpochParticipationStatus(status flow.EpochParticipationStatus) IdentityOption
- func (f IdentityGenerator) WithInitialWeight(weight uint64) IdentityOption
- func (f IdentityGenerator) WithNetworkPubKey(key crypto.PublicKey) IdentityOption
- func (f IdentityGenerator) WithNodeID(nodeID flow.Identifier) IdentityOption
- func (f IdentityGenerator) WithRole(role flow.Role) IdentityOption
- func (f IdentityGenerator) WithStakingPubKey(key crypto.PublicKey) IdentityOption
- type IdentityOption
- type LedgerPathGenerator
- type LedgerPathOption
- type LedgerPayloadGenerator
- func (g *LedgerPayloadGenerator) Fixture(opts ...LedgerPayloadOption) *ledger.Payload
- func (g *LedgerPayloadGenerator) List(n int, opts ...LedgerPayloadOption) []*ledger.Payload
- func (f LedgerPayloadGenerator) WithSize(minSize, maxSize int) LedgerPayloadOption
- func (f LedgerPayloadGenerator) WithValue(value ledger.Value) LedgerPayloadOption
- type LedgerPayloadOption
- type LedgerValueGenerator
- type LedgerValueOption
- type LightTransactionResultGenerator
- func (g *LightTransactionResultGenerator) Fixture(opts ...LightTransactionResultOption) flow.LightTransactionResult
- func (g *LightTransactionResultGenerator) List(n int, opts ...LightTransactionResultOption) []flow.LightTransactionResult
- func (f LightTransactionResultGenerator) WithComputationUsed(computationUsed uint64) TransactionResultOption
- func (f LightTransactionResultGenerator) WithErrorMessage(errorMessage string) TransactionResultOption
- func (f LightTransactionResultGenerator) WithTransactionID(transactionID flow.Identifier) TransactionResultOption
- type LightTransactionResultOption
- type PayloadGenerator
- func (g *PayloadGenerator) Fixture(opts ...PayloadOption) *flow.Payload
- func (g *PayloadGenerator) List(n int, opts ...PayloadOption) []*flow.Payload
- func (f PayloadGenerator) WithGuarantees(guarantees ...*flow.CollectionGuarantee) PayloadOption
- func (f PayloadGenerator) WithProtocolStateID(protocolStateID flow.Identifier) PayloadOption
- func (f PayloadGenerator) WithReceiptStubs(receipts ...*flow.ExecutionReceiptStub) PayloadOption
- func (f PayloadGenerator) WithReceipts(receipts ...*flow.ExecutionReceipt) PayloadOption
- func (f PayloadGenerator) WithResults(results flow.ExecutionResultList) PayloadOption
- func (f PayloadGenerator) WithSeals(seals ...*flow.Seal) PayloadOption
- type PayloadOption
- type PrivateKeyOption
- type ProposalKeyGenerator
- func (g *ProposalKeyGenerator) Fixture(opts ...ProposalKeyOption) flow.ProposalKey
- func (g *ProposalKeyGenerator) List(n int, opts ...ProposalKeyOption) []flow.ProposalKey
- func (f ProposalKeyGenerator) WithAddress(address flow.Address) ProposalKeyOption
- func (f ProposalKeyGenerator) WithKeyIndex(keyIndex uint32) ProposalKeyOption
- func (f ProposalKeyGenerator) WithSequenceNumber(sequenceNumber uint64) ProposalKeyOption
- type ProposalKeyOption
- type ProtocolStateVersionUpgradeGenerator
- func (g *ProtocolStateVersionUpgradeGenerator) Fixture(opts ...ProtocolStateVersionUpgradeOption) *flow.ProtocolStateVersionUpgrade
- func (g *ProtocolStateVersionUpgradeGenerator) List(n int, opts ...ProtocolStateVersionUpgradeOption) []*flow.ProtocolStateVersionUpgrade
- func (f ProtocolStateVersionUpgradeGenerator) WithActiveView(view uint64) ProtocolStateVersionUpgradeOption
- func (f ProtocolStateVersionUpgradeGenerator) WithNewProtocolStateVersion(version uint64) ProtocolStateVersionUpgradeOption
- type ProtocolStateVersionUpgradeOption
- type QuorumCertificateGenerator
- func (f QuorumCertificateGenerator) CertifiesBlock(header *flow.Header) QuorumCertificateOption
- func (g *QuorumCertificateGenerator) Fixture(opts ...QuorumCertificateOption) *flow.QuorumCertificate
- func (g *QuorumCertificateGenerator) List(n int, opts ...QuorumCertificateOption) []*flow.QuorumCertificate
- func (g *QuorumCertificateGenerator) QCSigDataWithSoR(source []byte) []byte
- func (f QuorumCertificateGenerator) WithBlockID(blockID flow.Identifier) QuorumCertificateOption
- func (f QuorumCertificateGenerator) WithRandomnessSource(source []byte) QuorumCertificateOption
- func (f QuorumCertificateGenerator) WithRootBlockID(blockID flow.Identifier) QuorumCertificateOption
- func (f QuorumCertificateGenerator) WithSignerIndices(signerIndices []byte) QuorumCertificateOption
- func (f QuorumCertificateGenerator) WithView(view uint64) QuorumCertificateOption
- type QuorumCertificateOption
- type QuorumCertificateWithSignerIDsGenerator
- func (g *QuorumCertificateWithSignerIDsGenerator) Fixture(opts ...QuorumCertificateWithSignerIDsOption) *flow.QuorumCertificateWithSignerIDs
- func (g *QuorumCertificateWithSignerIDsGenerator) List(n int, opts ...QuorumCertificateWithSignerIDsOption) []*flow.QuorumCertificateWithSignerIDs
- func (f QuorumCertificateWithSignerIDsGenerator) WithBlockID(blockID flow.Identifier) QuorumCertificateWithSignerIDsOption
- func (f QuorumCertificateWithSignerIDsGenerator) WithSigData(sigData []byte) QuorumCertificateWithSignerIDsOption
- func (f QuorumCertificateWithSignerIDsGenerator) WithSignerIDs(signerIDs flow.IdentifierList) QuorumCertificateWithSignerIDsOption
- func (f QuorumCertificateWithSignerIDsGenerator) WithView(view uint64) QuorumCertificateWithSignerIDsOption
- type QuorumCertificateWithSignerIDsOption
- type RandomGenerator
- func (g *RandomGenerator) Bool() bool
- func (g *RandomGenerator) Int32InRange(min, max int32) int32
- func (g *RandomGenerator) Int64InRange(min, max int64) int64
- func (g *RandomGenerator) IntInRange(min, max int) int
- func (g *RandomGenerator) RandomBytes(n int) []byte
- func (g *RandomGenerator) RandomString(length uint) string
- func (g *RandomGenerator) Uint16n(n uint16) uint16
- func (g *RandomGenerator) Uint32InRange(min, max uint32) uint32
- func (g *RandomGenerator) Uint32n(n uint32) uint32
- func (g *RandomGenerator) Uint64InRange(min, max uint64) uint64
- func (g *RandomGenerator) Uint64n(n uint64) uint64
- func (g *RandomGenerator) UintInRange(min, max uint) uint
- func (g *RandomGenerator) Uintn(n uint) uint
- type SealGenerator
- func (g *SealGenerator) Fixture(opts ...SealOption) *flow.Seal
- func (g *SealGenerator) List(n int, opts ...SealOption) []*flow.Seal
- func (f SealGenerator) WithAggregatedApprovalSigs(sigs ...flow.AggregatedSignature) SealOption
- func (f SealGenerator) WithBlockID(blockID flow.Identifier) SealOption
- func (f SealGenerator) WithFinalState(finalState flow.StateCommitment) SealOption
- func (f SealGenerator) WithResultID(resultID flow.Identifier) SealOption
- type SealOption
- type ServiceEventGenerator
- func (g *ServiceEventGenerator) Fixture(opts ...ServiceEventOption) flow.ServiceEvent
- func (g *ServiceEventGenerator) List(n int, opts ...ServiceEventOption) []flow.ServiceEvent
- func (f ServiceEventGenerator) WithEvent(eventData interface{}) ServiceEventOption
- func (f ServiceEventGenerator) WithType(eventType flow.ServiceEventType) ServiceEventOption
- type ServiceEventOption
- type SetEpochExtensionViewCountGenerator
- func (g *SetEpochExtensionViewCountGenerator) Fixture(opts ...SetEpochExtensionViewCountOption) *flow.SetEpochExtensionViewCount
- func (g *SetEpochExtensionViewCountGenerator) List(n int, opts ...SetEpochExtensionViewCountOption) []*flow.SetEpochExtensionViewCount
- func (f SetEpochExtensionViewCountGenerator) WithValue(value uint64) SetEpochExtensionViewCountOption
- type SetEpochExtensionViewCountOption
- type SignatureGenerator
- type SignatureOption
- type SignerIndicesGenerator
- func (g *SignerIndicesGenerator) Fixture(opts ...SignerIndicesOption) []byte
- func (g *SignerIndicesGenerator) List(n int, opts ...SignerIndicesOption) [][]byte
- func (f SignerIndicesGenerator) WithIndices(authorizedSigners int, indices []int) SignerIndicesOption
- func (f SignerIndicesGenerator) WithSignerCount(authorizedSigners, contributingSigners int) SignerIndicesOption
- type SignerIndicesOption
- type StateCommitmentGenerator
- func (g *StateCommitmentGenerator) Fixture(opts ...StateCommitmentOption) flow.StateCommitment
- func (g *StateCommitmentGenerator) List(n int, opts ...StateCommitmentOption) []flow.StateCommitment
- func (f StateCommitmentGenerator) WithEmptyState() StateCommitmentOption
- func (f StateCommitmentGenerator) WithHash(h hash.Hash) StateCommitmentOption
- type StateCommitmentOption
- type TimeGenerator
- func (g *TimeGenerator) Fixture(opts ...TimeOption) time.Time
- func (g *TimeGenerator) List(n int, opts ...TimeOption) []time.Time
- func (f TimeGenerator) WithBaseTime(baseTime time.Time) TimeOption
- func (f TimeGenerator) WithOffset(offset time.Duration) TimeOption
- func (f TimeGenerator) WithOffsetRandom(max time.Duration) TimeOption
- func (f TimeGenerator) WithTimezone(tz *time.Location) TimeOption
- type TimeOption
- type TimeoutCertificateGenerator
- func (g *TimeoutCertificateGenerator) Fixture(opts ...TimeoutCertificateOption) *flow.TimeoutCertificate
- func (g *TimeoutCertificateGenerator) List(n int, opts ...TimeoutCertificateOption) []*flow.TimeoutCertificate
- func (f TimeoutCertificateGenerator) WithNewestQC(qc *flow.QuorumCertificate) TimeoutCertificateOption
- func (f TimeoutCertificateGenerator) WithNewestQCViews(views []uint64) TimeoutCertificateOption
- func (f TimeoutCertificateGenerator) WithSigData(sigData []byte) TimeoutCertificateOption
- func (f TimeoutCertificateGenerator) WithSignerIndices(indices []byte) TimeoutCertificateOption
- func (f TimeoutCertificateGenerator) WithView(view uint64) TimeoutCertificateOption
- type TimeoutCertificateOption
- type TransactionGenerator
- func (g *TransactionGenerator) Fixture(opts ...TransactionOption) *flow.TransactionBody
- func (g *TransactionGenerator) List(n int, opts ...TransactionOption) []*flow.TransactionBody
- func (f TransactionGenerator) WithAuthorizers(authorizers ...flow.Address) TransactionOption
- func (f TransactionGenerator) WithEnvelopeSignatures(signatures ...flow.TransactionSignature) TransactionOption
- func (f TransactionGenerator) WithGasLimit(gasLimit uint64) TransactionOption
- func (f TransactionGenerator) WithPayer(payer flow.Address) TransactionOption
- func (f TransactionGenerator) WithProposalKey(proposalKey flow.ProposalKey) TransactionOption
- func (f TransactionGenerator) WithReferenceBlockID(blockID flow.Identifier) TransactionOption
- func (f TransactionGenerator) WithScript(script []byte) TransactionOption
- type TransactionOption
- type TransactionResultGenerator
- func (g *TransactionResultGenerator) Fixture(opts ...TransactionResultOption) flow.TransactionResult
- func (g *TransactionResultGenerator) List(n int, opts ...TransactionResultOption) []flow.TransactionResult
- func (f TransactionResultGenerator) WithComputationUsed(computationUsed uint64) TransactionResultOption
- func (f TransactionResultGenerator) WithErrorMessage(errorMessage string) TransactionResultOption
- func (f TransactionResultGenerator) WithTransactionID(transactionID flow.Identifier) TransactionResultOption
- type TransactionResultOption
- type TransactionSignatureGenerator
- func (g *TransactionSignatureGenerator) Fixture(opts ...TransactionSignatureOption) flow.TransactionSignature
- func (g *TransactionSignatureGenerator) List(n int, opts ...TransactionSignatureOption) []flow.TransactionSignature
- func (f TransactionSignatureGenerator) WithAddress(address flow.Address) TransactionSignatureOption
- func (f TransactionSignatureGenerator) WithKeyIndex(keyIndex uint32) TransactionSignatureOption
- func (f TransactionSignatureGenerator) WithSignature(sig crypto.Signature) TransactionSignatureOption
- func (f TransactionSignatureGenerator) WithSignerIndex(signerIndex int) TransactionSignatureOption
- type TransactionSignatureOption
- type TrieUpdateGenerator
- func (g *TrieUpdateGenerator) Fixture(opts ...TrieUpdateOption) *ledger.TrieUpdate
- func (g *TrieUpdateGenerator) List(n int, opts ...TrieUpdateOption) []*ledger.TrieUpdate
- func (f TrieUpdateGenerator) WithNumPaths(numPaths int) TrieUpdateOption
- func (f TrieUpdateGenerator) WithPaths(paths ...ledger.Path) TrieUpdateOption
- func (f TrieUpdateGenerator) WithPayloadSize(minSize, maxSize int) TrieUpdateOption
- func (f TrieUpdateGenerator) WithPayloads(payloads ...*ledger.Payload) TrieUpdateOption
- func (f TrieUpdateGenerator) WithRootHash(rootHash ledger.RootHash) TrieUpdateOption
- type TrieUpdateOption
- type VersionBeaconGenerator
- func (g *VersionBeaconGenerator) Fixture(opts ...VersionBeaconOption) *flow.VersionBeacon
- func (g *VersionBeaconGenerator) List(n int, opts ...VersionBeaconOption) []*flow.VersionBeacon
- func (f VersionBeaconGenerator) WithBoundaries(boundaries ...flow.VersionBoundary) VersionBeaconOption
- func (f VersionBeaconGenerator) WithSequence(sequence uint64) VersionBeaconOption
- type VersionBeaconOption
Constants ¶
This section is empty.
Variables ¶
var Address addressFactory
Address is the default options factory for flow.Address generation.
var AggregatedSignature aggregatedSignatureFactory
AggregatedSignature is the default options factory for flow.AggregatedSignature generation.
var Block blockFactory
Block is the default options factory for flow.Block generation.
var BlockExecutionData blockExecutionDataFactory
BlockExecutionData is the default options factory for execution_data.BlockExecutionData generation.
var Chunk chunkFactory
Chunk is the default options factory for flow.Chunk generation.
var ChunkExecutionData chunkExecutionDataFactory
ChunkExecutionData is the default options factory for execution_data.ChunkExecutionData generation.
var Collection collectionFactory
Collection is the default options factory for flow.Collection generation.
var EjectNode ejectNodeFactory
EjectNode is the default options factory for flow.EjectNode generation.
var EpochCommit epochCommitFactory
EpochCommit is the default options factory for flow.EpochCommit generation.
var EpochRecover epochRecoverFactory
EpochRecover is the default options factory for flow.EpochRecover generation.
var EpochSetup epochSetupFactory
EpochSetup is the default options factory for flow.EpochSetup generation.
var Event eventFactory
Event is the default options factory for flow.Event generation.
var EventType eventTypeFactory
EventType is the default options factory for flow.EventType generation.
var ExecutionReceipt executionReceiptFactory
ExecutionReceipt is the default options factory for flow.ExecutionReceipt generation.
var ExecutionReceiptStub executionReceiptStubFactory
ExecutionReceiptStub is the default options factory for flow.ExecutionReceiptStub generation.
var ExecutionResult executionResultFactory
ExecutionResult is the default options factory for flow.ExecutionResult generation.
var Guarantee collectionGuaranteeFactory
CollectionGuarantee is the default options factory for flow.CollectionGuarantee generation.
var Header headerFactory
Header is the default options factory for flow.Header generation.
var Identifier identifierFactory
Identifier is the default options factory for flow.Identifier generation.
var Identity identityFactory
Identity is the default options factory for flow.Identity generation.
var LedgerPath ledgerPathFactory
LedgerPath is the default options factory for ledger.Path generation.
var LedgerPayload ledgerPayloadFactory
LedgerPayload is the default options factory for ledger.Payload generation.
var LedgerValue ledgerValueFactory
LedgerValue is the default options factory for ledger.Value generation.
var LightTransactionResult lightTransactionResultFactory
var Payload payloadFactory
Payload is the default options factory for flow.Payload generation.
var PrivateKey privateKeyFactory
var ProposalKey proposalKeyFactory
ProposalKey is the default options factory for flow.ProposalKey generation.
var ProtocolStateVersionUpgrade protocolStateVersionUpgradeFactory
ProtocolStateVersionUpgrade is the default options factory for flow.ProtocolStateVersionUpgrade generation.
var QuorumCertificate quorumCertificateFactory
QuorumCertificate is the default options factory for flow.QuorumCertificate generation.
var QuorumCertificateWithSignerIDs quorumCertificateWithSignerIDsFactory
QuorumCertificateWithSignerIDs is the default options factory for flow.QuorumCertificateWithSignerIDs generation.
var Seal sealFactory
Seal is the default options factory for flow.Seal generation.
var ServiceEvent serviceEventFactory
ServiceEvent is the default options factory for flow.ServiceEvent generation.
var SetEpochExtensionViewCount setEpochExtensionViewCountFactory
SetEpochExtensionViewCount is the default options factory for flow.SetEpochExtensionViewCount generation.
var Signature signatureFactory
Signature is the default options factory for crypto.Signature generation.
var SignerIndices signerIndicesFactory
SignerIndices is the default options factory for SignerIndices generation.
var StateCommitment stateCommitmentFactory
StateCommitment is the default options factory for flow.StateCommitment generation.
var Time timeFactory
Time is the default options factory for time.Time generation.
var TimeoutCertificate timeoutCertificateFactory
TimeoutCertificate is the default options factory for flow.TimeoutCertificate generation.
var Transaction transactionFactory
Transaction is the default options factory for flow.TransactionBody generation.
var TransactionResult transactionResultFactory
TransactionResult is the default options factory for flow.TransactionResult generation.
var TransactionSignature transactionSignatureFactory
TransactionSignature is the default options factory for flow.TransactionSignature generation.
var TrieUpdate trieUpdateFactory
TrieUpdate is the default options factory for ledger.TrieUpdate generation.
var VersionBeacon versionBeaconFactory
VersionBeacon is the default options factory for flow.VersionBeacon generation.
Functions ¶
func AdjustEventsMetadata ¶
AdjustEventsMetadata adjusts the event and transaction indexes to be sequential. The following changes are made: - Transaction Index is updated to match the actual transactions - Event Index is updated to be sequential and reset for each transaction
func CorruptAddress ¶
CorruptAddress corrupts the first byte of the address and checks that the address is invalid.
func InclusiveRange ¶
func InclusiveRange[T ~uint64 | ~uint32 | ~uint | ~int64 | ~int32 | ~int](g *RandomGenerator, min, max T) T
InclusiveRange generates a random number of type T in the inclusive range [min, max]. Min and max MUST be positive numbers and `max` must be strictly greater than `min` or the method will panic.
func RandomElement ¶
func RandomElement[T any](g *RandomGenerator, slice []T) T
RandomElement selects a random element from the provided slice. Returns the zero value of T if the slice is empty.
func ToCadenceEventType ¶
ToCadenceEventType converts a flow.EventType to a cadence.EventType.
func ToSDKAddress ¶
ToSDKAddress converts a flow.Address to a sdk.Address.
Types ¶
type AddressGenerator ¶
type AddressGenerator struct {
// contains filtered or unexported fields
}
AddressGenerator generates flow.Address with consistent randomness.
func NewAddressGenerator ¶
func NewAddressGenerator( random *RandomGenerator, chainID flow.ChainID, ) *AddressGenerator
func (*AddressGenerator) Fixture ¶
func (g *AddressGenerator) Fixture(opts ...AddressOption) flow.Address
Fixture generates a random flow.Address with the provided options. Defaults to the chain ID specified in the generator suite.
func (*AddressGenerator) List ¶
func (g *AddressGenerator) List(n int, opts ...AddressOption) []flow.Address
List returns a list of flow.Address with the provided options.
func (AddressGenerator) ServiceAddress ¶
func (f AddressGenerator) ServiceAddress() AddressOption
ServiceAddress is an option that generates the service account flow.Address for the given chain.
func (AddressGenerator) WithChainID ¶
func (f AddressGenerator) WithChainID(chainID flow.ChainID) AddressOption
WithChainID is an option that generates an flow.Address for the specified chain.
func (AddressGenerator) WithIndex ¶
func (f AddressGenerator) WithIndex(index uint64) AddressOption
WithIndex is an option that sets the index for the address.
type AddressOption ¶
type AddressOption func(*AddressGenerator, *addressConfig)
type AggregatedSignatureGenerator ¶
type AggregatedSignatureGenerator struct {
// contains filtered or unexported fields
}
AggregatedSignatureGenerator generates aggregated signatures with consistent randomness.
func NewAggregatedSignatureGenerator ¶
func NewAggregatedSignatureGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, signatures *SignatureGenerator, ) *AggregatedSignatureGenerator
NewAggregatedSignatureGenerator creates a new AggregatedSignatureGenerator.
func (*AggregatedSignatureGenerator) Fixture ¶
func (g *AggregatedSignatureGenerator) Fixture(opts ...AggregatedSignatureOption) flow.AggregatedSignature
Fixture generates a flow.AggregatedSignature with random data based on the provided options.
func (*AggregatedSignatureGenerator) List ¶
func (g *AggregatedSignatureGenerator) List(n int, opts ...AggregatedSignatureOption) []flow.AggregatedSignature
List generates a list of flow.AggregatedSignature.
func (AggregatedSignatureGenerator) WithSignerIDs ¶
func (f AggregatedSignatureGenerator) WithSignerIDs(signerIDs flow.IdentifierList) AggregatedSignatureOption
WithSignerIDs is an option that sets the `SignerIDs` of the aggregated signature.
func (AggregatedSignatureGenerator) WithVerifierSignatures ¶
func (f AggregatedSignatureGenerator) WithVerifierSignatures(sigs ...crypto.Signature) AggregatedSignatureOption
WithVerifierSignatures is an option that sets the `VerifierSignatures` of the aggregated signature.
type AggregatedSignatureOption ¶
type AggregatedSignatureOption func(*AggregatedSignatureGenerator, *flow.AggregatedSignature)
type BlockExecutionDataEntityGenerator ¶
type BlockExecutionDataEntityGenerator struct {
*BlockExecutionDataGenerator
}
BlockExecutionDataEntityGenerator generates execution_data.BlockExecutionDataEntity with consistent randomness.
func NewBlockExecutionDataEntityGenerator ¶
func NewBlockExecutionDataEntityGenerator( blockExecutionDatas *BlockExecutionDataGenerator, ) *BlockExecutionDataEntityGenerator
func (*BlockExecutionDataEntityGenerator) Fixture ¶
func (g *BlockExecutionDataEntityGenerator) Fixture(opts ...BlockExecutionDataOption) *execution_data.BlockExecutionDataEntity
Fixture generates a execution_data.BlockExecutionDataEntity with random data based on the provided options.
func (*BlockExecutionDataEntityGenerator) List ¶
func (g *BlockExecutionDataEntityGenerator) List(n int, opts ...BlockExecutionDataOption) []*execution_data.BlockExecutionDataEntity
List generates a list of execution_data.BlockExecutionDataEntity.
func (BlockExecutionDataEntityGenerator) WithBlockID ¶
func (f BlockExecutionDataEntityGenerator) WithBlockID(blockID flow.Identifier) BlockExecutionDataOption
WithBlockID is an option that sets the BlockID for the block execution data.
func (BlockExecutionDataEntityGenerator) WithChunkExecutionDatas ¶
func (f BlockExecutionDataEntityGenerator) WithChunkExecutionDatas(chunks ...*execution_data.ChunkExecutionData) BlockExecutionDataOption
WithChunkExecutionDatas is an option that sets the ChunkExecutionDatas for the block execution data.
type BlockExecutionDataGenerator ¶
type BlockExecutionDataGenerator struct {
// contains filtered or unexported fields
}
BlockExecutionDataGenerator generates block execution data with consistent randomness.
func NewBlockExecutionDataGenerator ¶
func NewBlockExecutionDataGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, chunkExecutionDatas *ChunkExecutionDataGenerator, ) *BlockExecutionDataGenerator
func (*BlockExecutionDataGenerator) Fixture ¶
func (g *BlockExecutionDataGenerator) Fixture(opts ...BlockExecutionDataOption) *execution_data.BlockExecutionData
Fixture generates a execution_data.BlockExecutionData with random data based on the provided options.
func (*BlockExecutionDataGenerator) List ¶
func (g *BlockExecutionDataGenerator) List(n int, opts ...BlockExecutionDataOption) []*execution_data.BlockExecutionData
List generates a list of execution_data.BlockExecutionData.
func (BlockExecutionDataGenerator) WithBlockID ¶
func (f BlockExecutionDataGenerator) WithBlockID(blockID flow.Identifier) BlockExecutionDataOption
WithBlockID is an option that sets the BlockID for the block execution data.
func (BlockExecutionDataGenerator) WithChunkExecutionDatas ¶
func (f BlockExecutionDataGenerator) WithChunkExecutionDatas(chunks ...*execution_data.ChunkExecutionData) BlockExecutionDataOption
WithChunkExecutionDatas is an option that sets the ChunkExecutionDatas for the block execution data.
type BlockExecutionDataOption ¶
type BlockExecutionDataOption func(*BlockExecutionDataGenerator, *execution_data.BlockExecutionData)
type BlockGenerator ¶
type BlockGenerator struct {
// contains filtered or unexported fields
}
BlockGenerator generates blocks with consistent randomness.
func NewBlockGenerator ¶
func NewBlockGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, headers *HeaderGenerator, payloads *PayloadGenerator, chainID flow.ChainID, ) *BlockGenerator
func (*BlockGenerator) Fixture ¶
func (g *BlockGenerator) Fixture(opts ...BlockOption) *flow.Block
Fixture generates a flow.Block with random data based on the provided options.
func (*BlockGenerator) Genesis ¶
func (g *BlockGenerator) Genesis(opts ...BlockOption) *flow.Block
Genesis instantiates a genesis block. This block has view and height equal to zero. However, conceptually spork root blocks are functionally equivalent to genesis blocks. We have decided that in the long term, the protocol must support spork root blocks with height _and_ view larger than zero. The only options that are used are the chainID and the protocol state ID.
func (*BlockGenerator) List ¶
func (g *BlockGenerator) List(n int, opts ...BlockOption) []*flow.Block
List generates a chain of flow.Block objects. The first block is generated with the given options, and the subsequent blocks are generated using only the WithParentHeader option, specifying the previous block as the parent.
func (BlockGenerator) WithChainID ¶
func (f BlockGenerator) WithChainID(chainID flow.ChainID) BlockOption
WithChainID is an option that sets the `ChainID` of the block's header.
func (BlockGenerator) WithHeaderBody ¶
func (f BlockGenerator) WithHeaderBody(headerBody *flow.HeaderBody) BlockOption
WithHeaderBody is an option that sets the `HeaderBody` of the block.
func (BlockGenerator) WithHeight ¶
func (f BlockGenerator) WithHeight(height uint64) BlockOption
WithHeight is an option that sets the `Height` of the block's header.
func (BlockGenerator) WithLastViewTC ¶
func (f BlockGenerator) WithLastViewTC(lastViewTC *flow.TimeoutCertificate) BlockOption
WithLastViewTC is an option that sets the `LastViewTC` of the block's header.
func (BlockGenerator) WithParent ¶
func (f BlockGenerator) WithParent(parentID flow.Identifier, parentView uint64, parentHeight uint64) BlockOption
WithParent is an option that sets the `ParentID`, `ParentView`, and `Height` of the block's header based on the provided fields. `Height` is set to parent's `Height` + 1.
func (BlockGenerator) WithParentHeader ¶
func (f BlockGenerator) WithParentHeader(parent *flow.Header) BlockOption
WithParentHeader is an option that sets the following fields of the block's header based on the provided parent header: - `View` - `Height` - `ChainID` - `Timestamp` - `ParentID` - `ParentView`
If you want a specific value for any of these fields, you should add the appropriate option after this option.
func (BlockGenerator) WithParentView ¶
func (f BlockGenerator) WithParentView(view uint64) BlockOption
WithParentView is an option that sets the `ParentView` of the block's header.
func (BlockGenerator) WithParentVoterIndices ¶
func (f BlockGenerator) WithParentVoterIndices(indices []byte) BlockOption
WithParentVoterIndices is an option that sets the `ParentVoterIndices` of the block's header.
func (BlockGenerator) WithParentVoterSigData ¶
func (f BlockGenerator) WithParentVoterSigData(data []byte) BlockOption
WithParentVoterSigData is an option that sets the `ParentVoterSigData` of the block's header.
func (BlockGenerator) WithPayload ¶
func (f BlockGenerator) WithPayload(payload *flow.Payload) BlockOption
WithPayload is an option that sets the `Payload` of the block.
func (BlockGenerator) WithProposerID ¶
func (f BlockGenerator) WithProposerID(proposerID flow.Identifier) BlockOption
WithProposerID is an option that sets the `ProposerID` of the block's header.
func (BlockGenerator) WithTimestamp ¶
func (f BlockGenerator) WithTimestamp(timestamp uint64) BlockOption
WithTimestamp is an option that sets the `Timestamp` of the block's header.
func (BlockGenerator) WithView ¶
func (f BlockGenerator) WithView(view uint64) BlockOption
WithView is an option that sets the `View` of the block's header.
type BlockOption ¶
type BlockOption func(*BlockGenerator, *blockConfig)
type ChunkExecutionDataGenerator ¶
type ChunkExecutionDataGenerator struct {
// contains filtered or unexported fields
}
ChunkExecutionDataGenerator generates chunk execution data with consistent randomness.
func NewChunkExecutionDataGenerator ¶
func NewChunkExecutionDataGenerator( random *RandomGenerator, collections *CollectionGenerator, lightTxResults *LightTransactionResultGenerator, events *EventGenerator, trieUpdates *TrieUpdateGenerator, ) *ChunkExecutionDataGenerator
func (*ChunkExecutionDataGenerator) Fixture ¶
func (g *ChunkExecutionDataGenerator) Fixture(opts ...ChunkExecutionDataOption) *execution_data.ChunkExecutionData
Fixture generates a execution_data.ChunkExecutionData with random data based on the provided options.
func (*ChunkExecutionDataGenerator) List ¶
func (g *ChunkExecutionDataGenerator) List(n int, opts ...ChunkExecutionDataOption) []*execution_data.ChunkExecutionData
List generates a list of execution_data.ChunkExecutionData.
func (ChunkExecutionDataGenerator) WithCollection ¶
func (f ChunkExecutionDataGenerator) WithCollection(collection *flow.Collection) ChunkExecutionDataOption
WithCollection is an option that sets the collection for the chunk execution data.
func (ChunkExecutionDataGenerator) WithEvents ¶
func (f ChunkExecutionDataGenerator) WithEvents(events flow.EventsList) ChunkExecutionDataOption
WithEvents is an option that sets the events for the chunk execution data.
func (ChunkExecutionDataGenerator) WithMinSize ¶
func (f ChunkExecutionDataGenerator) WithMinSize(minSize int) ChunkExecutionDataOption
WithMinSize is an option that sets the minimum size for the chunk execution data.
func (ChunkExecutionDataGenerator) WithTransactionResults ¶
func (f ChunkExecutionDataGenerator) WithTransactionResults(results ...flow.LightTransactionResult) ChunkExecutionDataOption
WithTransactionResults is an option that sets the transaction results for the chunk execution data.
func (ChunkExecutionDataGenerator) WithTrieUpdate ¶
func (f ChunkExecutionDataGenerator) WithTrieUpdate(trieUpdate *ledger.TrieUpdate) ChunkExecutionDataOption
WithTrieUpdate is an option that sets the trie update for the chunk execution data.
type ChunkExecutionDataOption ¶
type ChunkExecutionDataOption func(*ChunkExecutionDataGenerator, *execution_data.ChunkExecutionData)
type ChunkGenerator ¶
type ChunkGenerator struct {
// contains filtered or unexported fields
}
ChunkGenerator generates chunks with consistent randomness.
func NewChunkGenerator ¶
func NewChunkGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, stateCommitments *StateCommitmentGenerator, ) *ChunkGenerator
NewChunkGenerator creates a new ChunkGenerator.
func (*ChunkGenerator) Fixture ¶
func (g *ChunkGenerator) Fixture(opts ...ChunkOption) *flow.Chunk
Fixture generates a flow.Chunk with random data based on the provided options.
func (*ChunkGenerator) List ¶
func (g *ChunkGenerator) List(n int, opts ...ChunkOption) []*flow.Chunk
List generates a list of flow.Chunk.
func (ChunkGenerator) WithBlockID ¶
func (f ChunkGenerator) WithBlockID(blockID flow.Identifier) ChunkOption
WithBlockID is an option that sets the `BlockID` of the chunk.
func (ChunkGenerator) WithCollectionIndex ¶
func (f ChunkGenerator) WithCollectionIndex(collectionIndex uint) ChunkOption
WithCollectionIndex is an option that sets the `CollectionIndex` of the chunk.
func (ChunkGenerator) WithEndState ¶
func (f ChunkGenerator) WithEndState(endState flow.StateCommitment) ChunkOption
WithEndState is an option that sets the `EndState` of the chunk.
func (ChunkGenerator) WithEventCollection ¶
func (f ChunkGenerator) WithEventCollection(eventCollection flow.Identifier) ChunkOption
WithEventCollection is an option that sets the `EventCollection` of the chunk.
func (ChunkGenerator) WithIndex ¶
func (f ChunkGenerator) WithIndex(index uint64) ChunkOption
WithIndex is an option that sets the `Index` of the chunk.
func (ChunkGenerator) WithNumberOfTransactions ¶
func (f ChunkGenerator) WithNumberOfTransactions(numTxs uint64) ChunkOption
WithNumberOfTransactions is an option that sets the `NumberOfTransactions` of the chunk.
func (ChunkGenerator) WithServiceEventCount ¶
func (f ChunkGenerator) WithServiceEventCount(count uint16) ChunkOption
WithServiceEventCount is an option that sets the `ServiceEventCount` of the chunk.
func (ChunkGenerator) WithStartState ¶
func (f ChunkGenerator) WithStartState(startState flow.StateCommitment) ChunkOption
WithStartState is an option that sets the `StartState` of the chunk.
func (ChunkGenerator) WithTotalComputationUsed ¶
func (f ChunkGenerator) WithTotalComputationUsed(computation uint64) ChunkOption
WithTotalComputationUsed is an option that sets the `TotalComputationUsed` of the chunk.
type ChunkOption ¶
type ChunkOption func(*ChunkGenerator, *flow.Chunk)
type CollectionGenerator ¶
type CollectionGenerator struct {
// contains filtered or unexported fields
}
CollectionGenerator generates collections with consistent randomness.
func NewCollectionGenerator ¶
func NewCollectionGenerator( transactions *TransactionGenerator, ) *CollectionGenerator
func (*CollectionGenerator) Fixture ¶
func (g *CollectionGenerator) Fixture(opts ...CollectionOption) *flow.Collection
Fixture generates a flow.Collection with random data based on the provided options.
func (*CollectionGenerator) List ¶
func (g *CollectionGenerator) List(n int, opts ...CollectionOption) []*flow.Collection
List generates a list of flow.Collection.
func (CollectionGenerator) WithTransactions ¶
func (f CollectionGenerator) WithTransactions(transactions ...*flow.TransactionBody) CollectionOption
WithTransactions is an option that sets the transactions for the collection.
func (CollectionGenerator) WithTxCount ¶
func (f CollectionGenerator) WithTxCount(count int) CollectionOption
WithTxCount is an option that sets the number of transactions in the collection.
type CollectionGuaranteeGenerator ¶
type CollectionGuaranteeGenerator struct {
// contains filtered or unexported fields
}
CollectionGuaranteeGenerator generates collection guarantees with consistent randomness.
func NewCollectionGuaranteeGenerator ¶
func NewCollectionGuaranteeGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, signatures *SignatureGenerator, signerIndices *SignerIndicesGenerator, chainID flow.ChainID, ) *CollectionGuaranteeGenerator
func (*CollectionGuaranteeGenerator) Fixture ¶
func (g *CollectionGuaranteeGenerator) Fixture(opts ...CollectionGuaranteeOption) *flow.CollectionGuarantee
Fixture generates a flow.CollectionGuarantee with random data based on the provided options.
func (*CollectionGuaranteeGenerator) List ¶
func (g *CollectionGuaranteeGenerator) List(n int, opts ...CollectionGuaranteeOption) []*flow.CollectionGuarantee
List generates a list of flow.CollectionGuarantee with random data.
func (CollectionGuaranteeGenerator) WithClusterChainID ¶
func (f CollectionGuaranteeGenerator) WithClusterChainID(clusterChainID flow.ChainID) CollectionGuaranteeOption
WithClusterChainID is an option that sets the `ClusterChainID` of the collection guarantee.
func (CollectionGuaranteeGenerator) WithCollectionID ¶
func (f CollectionGuaranteeGenerator) WithCollectionID(collectionID flow.Identifier) CollectionGuaranteeOption
WithCollectionID is an option that sets the `CollectionID` of the collection guarantee.
func (CollectionGuaranteeGenerator) WithReferenceBlockID ¶
func (f CollectionGuaranteeGenerator) WithReferenceBlockID(blockID flow.Identifier) CollectionGuaranteeOption
WithReferenceBlockID is an option that sets the `ReferenceBlockID` of the collection guarantee.
func (CollectionGuaranteeGenerator) WithSignature ¶
func (f CollectionGuaranteeGenerator) WithSignature(signature crypto.Signature) CollectionGuaranteeOption
WithSignature is an option that sets the `Signature` of the collection guarantee.
func (CollectionGuaranteeGenerator) WithSignerIndices ¶
func (f CollectionGuaranteeGenerator) WithSignerIndices(signerIndices []byte) CollectionGuaranteeOption
WithSignerIndices is an option that sets the `SignerIndices` of the collection guarantee.
type CollectionGuaranteeOption ¶
type CollectionGuaranteeOption func(*CollectionGuaranteeGenerator, *flow.CollectionGuarantee)
type CollectionOption ¶
type CollectionOption func(*CollectionGenerator, *flow.Collection)
type CryptoGenerator ¶
type CryptoGenerator struct {
// contains filtered or unexported fields
}
func NewCryptoGenerator ¶
func NewCryptoGenerator(random *RandomGenerator) *CryptoGenerator
func (*CryptoGenerator) NetworkingPrivateKey ¶
func (g *CryptoGenerator) NetworkingPrivateKey(opts ...PrivateKeyOption) crypto.PrivateKey
NetworkingPrivateKey generates a networking crypto.PrivateKey using the crypto.ECDSAP256 algorithm.
func (*CryptoGenerator) PrivateKey ¶
func (g *CryptoGenerator) PrivateKey(algo crypto.SigningAlgorithm, opts ...PrivateKeyOption) crypto.PrivateKey
PrivateKey generates a crypto.PrivateKey.
func (*CryptoGenerator) PublicKeys ¶
func (g *CryptoGenerator) PublicKeys(n int, algo crypto.SigningAlgorithm, opts ...PrivateKeyOption) []crypto.PublicKey
PublicKeys generates a list of crypto.PublicKey.
func (*CryptoGenerator) StakingPrivateKey ¶
func (g *CryptoGenerator) StakingPrivateKey(opts ...PrivateKeyOption) crypto.PrivateKey
StakingPrivateKey generates a staking crypto.PrivateKey using the crypto.BLSBLS12381 algorithm.
func (CryptoGenerator) WithSeed ¶
func (f CryptoGenerator) WithSeed(seed []byte) PrivateKeyOption
WithSeed is an option that sets the seed of the private key.
type EjectNodeGenerator ¶
type EjectNodeGenerator struct {
// contains filtered or unexported fields
}
EjectNodeGenerator generates node ejection events with consistent randomness.
func NewEjectNodeGenerator ¶
func NewEjectNodeGenerator( identifiers *IdentifierGenerator, ) *EjectNodeGenerator
NewEjectNodeGenerator creates a new EjectNodeGenerator.
func (*EjectNodeGenerator) Fixture ¶
func (g *EjectNodeGenerator) Fixture(opts ...EjectNodeOption) *flow.EjectNode
Fixture generates a flow.EjectNode with random data based on the provided options.
func (*EjectNodeGenerator) List ¶
func (g *EjectNodeGenerator) List(n int, opts ...EjectNodeOption) []*flow.EjectNode
List generates a list of flow.EjectNode.
func (EjectNodeGenerator) WithNodeID ¶
func (f EjectNodeGenerator) WithNodeID(nodeID flow.Identifier) EjectNodeOption
WithNodeID is an option that sets the `NodeID` of the node to be ejected.
type EjectNodeOption ¶
type EjectNodeOption func(*EjectNodeGenerator, *flow.EjectNode)
type EpochCommitGenerator ¶
type EpochCommitGenerator struct {
// contains filtered or unexported fields
}
EpochCommitGenerator generates epoch commit events with consistent randomness.
func NewEpochCommitGenerator ¶
func NewEpochCommitGenerator( random *RandomGenerator, cryptoGen *CryptoGenerator, identifiers *IdentifierGenerator, quorumCerts *QuorumCertificateWithSignerIDsGenerator, ) *EpochCommitGenerator
NewEpochCommitGenerator creates a new EpochCommitGenerator.
func (*EpochCommitGenerator) Fixture ¶
func (g *EpochCommitGenerator) Fixture(opts ...EpochCommitOption) *flow.EpochCommit
Fixture generates a flow.EpochCommit with random data based on the provided options.
func (*EpochCommitGenerator) List ¶
func (g *EpochCommitGenerator) List(n int, opts ...EpochCommitOption) []*flow.EpochCommit
List generates a list of flow.EpochCommit.
func (EpochCommitGenerator) WithClusterQCs ¶
func (f EpochCommitGenerator) WithClusterQCs(qcs ...flow.ClusterQCVoteData) EpochCommitOption
WithClusterQCs is an option that sets the `ClusterQCs` of the epoch commit.
func (EpochCommitGenerator) WithClusterQCsFromAssignments ¶
func (f EpochCommitGenerator) WithClusterQCsFromAssignments(assignments flow.AssignmentList) EpochCommitOption
WithClusterQCsFromAssignments is an option that sets the `ClusterQCs` of the epoch commit from the assignments.
func (EpochCommitGenerator) WithCounter ¶
func (f EpochCommitGenerator) WithCounter(counter uint64) EpochCommitOption
WithCounter is an option that sets the `Counter` of the epoch commit.
func (EpochCommitGenerator) WithDKGFromParticipants ¶
func (f EpochCommitGenerator) WithDKGFromParticipants(participants flow.IdentitySkeletonList) EpochCommitOption
WithDKGFromParticipants is an option that sets the `DKGGroupKey` and `DKGParticipantKeys` of the epoch commit from the participants.
type EpochCommitOption ¶
type EpochCommitOption func(*EpochCommitGenerator, *flow.EpochCommit)
type EpochRecoverGenerator ¶
type EpochRecoverGenerator struct {
// contains filtered or unexported fields
}
EpochRecoverGenerator generates epoch recovery events with consistent randomness.
func NewEpochRecoverGenerator ¶
func NewEpochRecoverGenerator( random *RandomGenerator, epochSetups *EpochSetupGenerator, epochCommits *EpochCommitGenerator, ) *EpochRecoverGenerator
NewEpochRecoverGenerator creates a new EpochRecoverGenerator.
func (*EpochRecoverGenerator) Fixture ¶
func (g *EpochRecoverGenerator) Fixture(opts ...EpochRecoverOption) *flow.EpochRecover
Fixture generates a flow.EpochRecover with random data based on the provided options.
func (*EpochRecoverGenerator) List ¶
func (g *EpochRecoverGenerator) List(n int, opts ...EpochRecoverOption) []*flow.EpochRecover
List generates a list of flow.EpochRecover.
func (EpochRecoverGenerator) WithEpochCommit ¶
func (f EpochRecoverGenerator) WithEpochCommit(commit flow.EpochCommit) EpochRecoverOption
WithEpochCommit is an option that sets the `EpochCommit` of the recover event.
func (EpochRecoverGenerator) WithEpochSetup ¶
func (f EpochRecoverGenerator) WithEpochSetup(setup flow.EpochSetup) EpochRecoverOption
WithEpochSetup is an option that sets the `EpochSetup` of the recover event.
type EpochRecoverOption ¶
type EpochRecoverOption func(*EpochRecoverGenerator, *flow.EpochRecover)
type EpochSetupGenerator ¶
type EpochSetupGenerator struct {
// contains filtered or unexported fields
}
EpochSetupGenerator generates epoch setup events with consistent randomness.
func NewEpochSetupGenerator ¶
func NewEpochSetupGenerator(random *RandomGenerator, timeGen *TimeGenerator, identities *IdentityGenerator) *EpochSetupGenerator
NewEpochSetupGenerator creates a new EpochSetupGenerator.
func (*EpochSetupGenerator) Fixture ¶
func (g *EpochSetupGenerator) Fixture(opts ...EpochSetupOption) *flow.EpochSetup
Fixture generates a flow.EpochSetup with random data based on the provided options.
func (*EpochSetupGenerator) List ¶
func (g *EpochSetupGenerator) List(n int, opts ...EpochSetupOption) []*flow.EpochSetup
List generates a list of flow.EpochSetup.
func (EpochSetupGenerator) WithAssignments ¶
func (f EpochSetupGenerator) WithAssignments(assignments flow.AssignmentList) EpochSetupOption
WithAssignments is an option that sets the `Assignments` of the epoch setup.
func (EpochSetupGenerator) WithCounter ¶
func (f EpochSetupGenerator) WithCounter(counter uint64) EpochSetupOption
WithCounter is an option that sets the `Counter` of the epoch setup.
func (EpochSetupGenerator) WithDKGFinalViews ¶
func (f EpochSetupGenerator) WithDKGFinalViews(phase1, phase2, phase3 uint64) EpochSetupOption
WithDKGFinalViews is an option that sets the `DKGPhase1FinalView`, `DKGPhase2FinalView`, and `DKGPhase3FinalView` of the epoch setup.
func (EpochSetupGenerator) WithFinalView ¶
func (f EpochSetupGenerator) WithFinalView(view uint64) EpochSetupOption
WithFinalView is an option that sets the `FinalView` of the epoch setup.
func (EpochSetupGenerator) WithFirstView ¶
func (f EpochSetupGenerator) WithFirstView(view uint64) EpochSetupOption
WithFirstView is an option that sets the `FirstView` of the epoch setup.
func (EpochSetupGenerator) WithParticipants ¶
func (f EpochSetupGenerator) WithParticipants(participants flow.IdentitySkeletonList) EpochSetupOption
WithParticipants is an option that sets the `Participants` of the epoch setup.
func (EpochSetupGenerator) WithRandomSource ¶
func (f EpochSetupGenerator) WithRandomSource(source []byte) EpochSetupOption
WithRandomSource is an option that sets the `RandomSource` of the epoch setup.
func (EpochSetupGenerator) WithTargetDuration ¶
func (f EpochSetupGenerator) WithTargetDuration(duration uint64) EpochSetupOption
WithTargetDuration is an option that sets the `TargetDuration` of the epoch setup.
func (EpochSetupGenerator) WithTargetEndTime ¶
func (f EpochSetupGenerator) WithTargetEndTime(endTime uint64) EpochSetupOption
WithTargetEndTime is an option that sets the `TargetEndTime` of the epoch setup.
type EpochSetupOption ¶
type EpochSetupOption func(*EpochSetupGenerator, *flow.EpochSetup)
type EventGenerator ¶
type EventGenerator struct {
// contains filtered or unexported fields
}
EventGenerator generates events with consistent randomness.
func NewEventGenerator ¶
func NewEventGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, eventTypes *EventTypeGenerator, addresses *AddressGenerator, ) *EventGenerator
func (*EventGenerator) Fixture ¶
func (g *EventGenerator) Fixture(opts ...EventOption) flow.Event
Fixture generates a flow.Event with random data based on the provided options.
func (*EventGenerator) ForTransaction ¶
func (g *EventGenerator) ForTransaction(transactionID flow.Identifier, transactionIndex uint32, eventCount int, opts ...EventOption) []flow.Event
ForTransaction generates a list of flow.Event for a specific transaction.
func (*EventGenerator) ForTransactions ¶
func (g *EventGenerator) ForTransactions(transactionIDs []flow.Identifier, eventsPerTransaction int, opts ...EventOption) []flow.Event
ForTransactions generates a list of flow.Event for multiple transactions.
func (*EventGenerator) List ¶
func (g *EventGenerator) List(n int, opts ...EventOption) []flow.Event
List generates a list of flow.Event.
func (EventGenerator) WithEncoding ¶
func (f EventGenerator) WithEncoding(encoding entities.EventEncodingVersion) EventOption
WithEncoding is an option that sets the encoding for the event payload.
func (EventGenerator) WithEventIndex ¶
func (f EventGenerator) WithEventIndex(eventIndex uint32) EventOption
WithEventIndex is an option that sets the event index for the event.
func (EventGenerator) WithEventType ¶
func (f EventGenerator) WithEventType(eventType flow.EventType) EventOption
WithEventType is an option that sets the event type for the event.
func (EventGenerator) WithPayload ¶
func (f EventGenerator) WithPayload(payload []byte) EventOption
WithPayload is an option that sets the payload for the event. Note: if payload is provided, it must already be in the desired encoding.
func (EventGenerator) WithTransactionID ¶
func (f EventGenerator) WithTransactionID(transactionID flow.Identifier) EventOption
WithTransactionID is an option that sets the transaction ID for the event.
func (EventGenerator) WithTransactionIndex ¶
func (f EventGenerator) WithTransactionIndex(transactionIndex uint32) EventOption
WithTransactionIndex is an option that sets the transaction index for the event.
type EventOption ¶
type EventOption func(*EventGenerator, *eventConfig)
type EventTypeGenerator ¶
type EventTypeGenerator struct {
// contains filtered or unexported fields
}
EventTypeGenerator generates event types with consistent randomness.
func NewEventTypeGenerator ¶
func NewEventTypeGenerator( random *RandomGenerator, addresses *AddressGenerator, ) *EventTypeGenerator
func (*EventTypeGenerator) Fixture ¶
func (g *EventTypeGenerator) Fixture(opts ...EventTypeOption) flow.EventType
Fixture generates a flow.EventType with random data based on the provided options.
func (*EventTypeGenerator) List ¶
func (g *EventTypeGenerator) List(n int, opts ...EventTypeOption) []flow.EventType
List generates a list of flow.EventType.
func (EventTypeGenerator) WithAddress ¶
func (f EventTypeGenerator) WithAddress(address flow.Address) EventTypeOption
WithAddress is an option that sets the address for the event type.
func (EventTypeGenerator) WithContractName ¶
func (f EventTypeGenerator) WithContractName(contractName string) EventTypeOption
WithContractName is an option that sets the contract name for the event type.
func (EventTypeGenerator) WithEventName ¶
func (f EventTypeGenerator) WithEventName(eventName string) EventTypeOption
WithEventName is an option that sets the event name for the event type.
type EventTypeOption ¶
type EventTypeOption func(*EventTypeGenerator, *eventTypeConfig)
type ExecutionReceiptGenerator ¶
type ExecutionReceiptGenerator struct {
// contains filtered or unexported fields
}
ExecutionReceiptGenerator generates execution receipts with consistent randomness.
func NewExecutionReceiptGenerator ¶
func NewExecutionReceiptGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, executionResults *ExecutionResultGenerator, signatures *SignatureGenerator, ) *ExecutionReceiptGenerator
NewExecutionReceiptGenerator creates a new ExecutionReceiptGenerator.
func (*ExecutionReceiptGenerator) Fixture ¶
func (g *ExecutionReceiptGenerator) Fixture(opts ...ExecutionReceiptOption) *flow.ExecutionReceipt
Fixture generates a flow.ExecutionReceipt with random data based on the provided options.
func (*ExecutionReceiptGenerator) List ¶
func (g *ExecutionReceiptGenerator) List(n int, opts ...ExecutionReceiptOption) []*flow.ExecutionReceipt
List generates a list of flow.ExecutionReceipt.
func (ExecutionReceiptGenerator) WithExecutionResult ¶
func (f ExecutionReceiptGenerator) WithExecutionResult(result flow.ExecutionResult) ExecutionReceiptOption
WithExecutionResult is an option that sets the `ExecutionResult` of the execution receipt.
func (ExecutionReceiptGenerator) WithExecutorID ¶
func (f ExecutionReceiptGenerator) WithExecutorID(executorID flow.Identifier) ExecutionReceiptOption
WithExecutorID is an option that sets the `ExecutorID` of the execution receipt.
func (ExecutionReceiptGenerator) WithExecutorSignature ¶
func (f ExecutionReceiptGenerator) WithExecutorSignature(executorSignature crypto.Signature) ExecutionReceiptOption
WithExecutorSignature is an option that sets the `ExecutorSignature` of the execution receipt.
func (ExecutionReceiptGenerator) WithSpocks ¶
func (f ExecutionReceiptGenerator) WithSpocks(spocks ...crypto.Signature) ExecutionReceiptOption
WithSpocks is an option that sets the `Spocks` of the execution receipt.
type ExecutionReceiptOption ¶
type ExecutionReceiptOption func(*ExecutionReceiptGenerator, *flow.ExecutionReceipt)
type ExecutionReceiptStubGenerator ¶
type ExecutionReceiptStubGenerator struct {
// contains filtered or unexported fields
}
ExecutionReceiptStubGenerator generates execution receipt stubs with consistent randomness.
func NewExecutionReceiptStubGenerator ¶
func NewExecutionReceiptStubGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, signatures *SignatureGenerator, ) *ExecutionReceiptStubGenerator
NewExecutionReceiptStubGenerator creates a new ExecutionReceiptStubGenerator.
func (*ExecutionReceiptStubGenerator) Fixture ¶
func (g *ExecutionReceiptStubGenerator) Fixture(opts ...ExecutionReceiptStubOption) *flow.ExecutionReceiptStub
Fixture generates a flow.ExecutionReceiptStub with random data based on the provided options.
func (*ExecutionReceiptStubGenerator) List ¶
func (g *ExecutionReceiptStubGenerator) List(n int, opts ...ExecutionReceiptStubOption) []*flow.ExecutionReceiptStub
List generates a list of flow.ExecutionReceiptStub.
func (ExecutionReceiptStubGenerator) WithExecutorID ¶
func (f ExecutionReceiptStubGenerator) WithExecutorID(executorID flow.Identifier) ExecutionReceiptStubOption
WithExecutorID is an option that sets the `ExecutorID` of the execution receipt stub.
func (ExecutionReceiptStubGenerator) WithExecutorSignature ¶
func (f ExecutionReceiptStubGenerator) WithExecutorSignature(executorSignature crypto.Signature) ExecutionReceiptStubOption
WithExecutorSignature is an option that sets the `ExecutorSignature` of the execution receipt stub.
func (ExecutionReceiptStubGenerator) WithResultID ¶
func (f ExecutionReceiptStubGenerator) WithResultID(resultID flow.Identifier) ExecutionReceiptStubOption
WithResultID is an option that sets the `ResultID` of the execution receipt stub.
func (ExecutionReceiptStubGenerator) WithSpocks ¶
func (f ExecutionReceiptStubGenerator) WithSpocks(spocks ...crypto.Signature) ExecutionReceiptStubOption
WithSpocks is an option that sets the `Spocks` of the execution receipt stub.
type ExecutionReceiptStubOption ¶
type ExecutionReceiptStubOption func(*ExecutionReceiptStubGenerator, *flow.ExecutionReceiptStub)
type ExecutionResultGenerator ¶
type ExecutionResultGenerator struct {
// contains filtered or unexported fields
}
ExecutionResultGenerator generates execution results with consistent randomness.
func NewExecutionResultGenerator ¶
func NewExecutionResultGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, chunks *ChunkGenerator, serviceEvents *ServiceEventGenerator, stateCommitments *StateCommitmentGenerator, ) *ExecutionResultGenerator
NewExecutionResultGenerator creates a new ExecutionResultGenerator.
func (*ExecutionResultGenerator) Fixture ¶
func (g *ExecutionResultGenerator) Fixture(opts ...ExecutionResultOption) *flow.ExecutionResult
Fixture generates a flow.ExecutionResult with random data based on the provided options.
func (*ExecutionResultGenerator) List ¶
func (g *ExecutionResultGenerator) List(n int, opts ...ExecutionResultOption) []*flow.ExecutionResult
List generates a list of flow.ExecutionResult.
func (ExecutionResultGenerator) WithBlock ¶
func (f ExecutionResultGenerator) WithBlock(block *flow.Block) ExecutionResultOption
WithBlock is an option that sets the `BlockID` of the execution result and all configured `Chunks`
func (ExecutionResultGenerator) WithBlockID ¶
func (f ExecutionResultGenerator) WithBlockID(blockID flow.Identifier) ExecutionResultOption
WithBlockID is an option that sets the `BlockID` of the execution result.
func (ExecutionResultGenerator) WithChunks ¶
func (f ExecutionResultGenerator) WithChunks(chunks flow.ChunkList) ExecutionResultOption
WithChunks is an option that sets the `Chunks` of the execution result.
func (ExecutionResultGenerator) WithExecutionDataID ¶
func (f ExecutionResultGenerator) WithExecutionDataID(executionDataID flow.Identifier) ExecutionResultOption
WithExecutionDataID is an option that sets the `ExecutionDataID` of the execution result.
func (ExecutionResultGenerator) WithFinalState ¶
func (f ExecutionResultGenerator) WithFinalState(finalState flow.StateCommitment) ExecutionResultOption
WithFinalState is an option that sets the `EndState` of the last chunk.
func (ExecutionResultGenerator) WithPreviousResult ¶
func (f ExecutionResultGenerator) WithPreviousResult(previousResult *flow.ExecutionResult) ExecutionResultOption
WithPreviousResult is an option that sets the `PreviousResultID` of the execution result, and adjusts the `StartState` of the first chunk to match the final state of the previous result.
func (ExecutionResultGenerator) WithPreviousResultID ¶
func (f ExecutionResultGenerator) WithPreviousResultID(previousResultID flow.Identifier) ExecutionResultOption
WithPreviousResultID is an option that sets the `PreviousResultID` of the execution result.
func (ExecutionResultGenerator) WithServiceEvents ¶
func (f ExecutionResultGenerator) WithServiceEvents(serviceEvents flow.ServiceEventList) ExecutionResultOption
WithServiceEvents is an option that sets the `ServiceEvents` of the execution result.
type ExecutionResultOption ¶
type ExecutionResultOption func(*ExecutionResultGenerator, *flow.ExecutionResult)
type GeneratorSuite ¶
type GeneratorSuite struct {
// contains filtered or unexported fields
}
GeneratorSuite provides a context-aware generator system for creating test fixtures. It manages a shared random number generator and provides access to specialized generators.
func NewGeneratorSuite ¶
func NewGeneratorSuite(opts ...GeneratorSuiteOption) *GeneratorSuite
NewGeneratorSuite creates a new generator suite with optional configuration. If no seed is specified, a random seed is generated. If no chain ID is specified, the default chain ID is flow.Emulator.
func (*GeneratorSuite) Addresses ¶
func (g *GeneratorSuite) Addresses() *AddressGenerator
Addresses returns a shared generator for flow.Address.
func (*GeneratorSuite) AggregatedSignatures ¶
func (g *GeneratorSuite) AggregatedSignatures() *AggregatedSignatureGenerator
AggregatedSignatures returns a generator for flow.AggregatedSignature.
func (*GeneratorSuite) BlockExecutionDataEntities ¶
func (g *GeneratorSuite) BlockExecutionDataEntities() *BlockExecutionDataEntityGenerator
BlockExecutionDataEntities returns a generator for flow.BlockExecutionDataEntity.
func (*GeneratorSuite) BlockExecutionDatas ¶
func (g *GeneratorSuite) BlockExecutionDatas() *BlockExecutionDataGenerator
BlockExecutionDatas returns a generator for flow.BlockExecutionData.
func (*GeneratorSuite) Blocks ¶
func (g *GeneratorSuite) Blocks() *BlockGenerator
Blocks returns a generator for flow.Block.
func (*GeneratorSuite) ChainID ¶
func (g *GeneratorSuite) ChainID() flow.ChainID
ChainID returns the default chain ID used by all generators.
func (*GeneratorSuite) ChunkExecutionDatas ¶
func (g *GeneratorSuite) ChunkExecutionDatas() *ChunkExecutionDataGenerator
ChunkExecutionDatas returns a generator for flow.ChunkExecutionData.
func (*GeneratorSuite) Chunks ¶
func (g *GeneratorSuite) Chunks() *ChunkGenerator
Chunks returns a generator for flow.Chunk.
func (*GeneratorSuite) Collections ¶
func (g *GeneratorSuite) Collections() *CollectionGenerator
Collections returns a generator for flow.Collection.
func (*GeneratorSuite) Crypto ¶
func (g *GeneratorSuite) Crypto() *CryptoGenerator
func (*GeneratorSuite) EjectNodes ¶
func (g *GeneratorSuite) EjectNodes() *EjectNodeGenerator
EjectNodes returns a generator for flow.EjectNode.
func (*GeneratorSuite) EpochCommits ¶
func (g *GeneratorSuite) EpochCommits() *EpochCommitGenerator
EpochCommits returns a generator for flow.EpochCommit.
func (*GeneratorSuite) EpochRecovers ¶
func (g *GeneratorSuite) EpochRecovers() *EpochRecoverGenerator
EpochRecovers returns a generator for flow.EpochRecover.
func (*GeneratorSuite) EpochSetups ¶
func (g *GeneratorSuite) EpochSetups() *EpochSetupGenerator
EpochSetups returns a generator for flow.EpochSetup.
func (*GeneratorSuite) EventTypes ¶
func (g *GeneratorSuite) EventTypes() *EventTypeGenerator
EventTypes returns a generator for flow.EventType.
func (*GeneratorSuite) Events ¶
func (g *GeneratorSuite) Events() *EventGenerator
Events returns a generator for flow.Event.
func (*GeneratorSuite) ExecutionReceiptStubs ¶
func (g *GeneratorSuite) ExecutionReceiptStubs() *ExecutionReceiptStubGenerator
ExecutionReceiptStubs returns a generator for flow.ExecutionReceiptStub.
func (*GeneratorSuite) ExecutionReceipts ¶
func (g *GeneratorSuite) ExecutionReceipts() *ExecutionReceiptGenerator
ExecutionReceipts returns a generator for flow.ExecutionReceipt.
func (*GeneratorSuite) ExecutionResults ¶
func (g *GeneratorSuite) ExecutionResults() *ExecutionResultGenerator
ExecutionResults returns a generator for flow.ExecutionResult.
func (*GeneratorSuite) Guarantees ¶
func (g *GeneratorSuite) Guarantees() *CollectionGuaranteeGenerator
Guarantees returns a generator for flow.CollectionGuarantee.
func (*GeneratorSuite) Headers ¶
func (g *GeneratorSuite) Headers() *HeaderGenerator
Headers returns a generator for flow.Header.
func (*GeneratorSuite) Identifiers ¶
func (g *GeneratorSuite) Identifiers() *IdentifierGenerator
Identifiers returns a shared generator for flow.Identifier.
func (*GeneratorSuite) Identities ¶
func (g *GeneratorSuite) Identities() *IdentityGenerator
func (*GeneratorSuite) LedgerPaths ¶
func (g *GeneratorSuite) LedgerPaths() *LedgerPathGenerator
LedgerPaths returns a generator for ledger.Path.
func (*GeneratorSuite) LedgerPayloads ¶
func (g *GeneratorSuite) LedgerPayloads() *LedgerPayloadGenerator
LedgerPayloads returns a generator for ledger.Payload.
func (*GeneratorSuite) LedgerValues ¶
func (g *GeneratorSuite) LedgerValues() *LedgerValueGenerator
LedgerValues returns a generator for ledger.Value.
func (*GeneratorSuite) LightTransactionResults ¶
func (g *GeneratorSuite) LightTransactionResults() *LightTransactionResultGenerator
LightTransactionResults returns a generator for flow.LightTransactionResult.
func (*GeneratorSuite) Payloads ¶
func (g *GeneratorSuite) Payloads() *PayloadGenerator
Payloads returns a generator for flow.Payload.
func (*GeneratorSuite) ProposalKeys ¶
func (g *GeneratorSuite) ProposalKeys() *ProposalKeyGenerator
ProposalKeys returns a generator for flow.ProposalKey.
func (*GeneratorSuite) ProtocolStateVersionUpgrades ¶
func (g *GeneratorSuite) ProtocolStateVersionUpgrades() *ProtocolStateVersionUpgradeGenerator
ProtocolStateVersionUpgrades returns a generator for flow.ProtocolStateVersionUpgrade.
func (*GeneratorSuite) QuorumCertificates ¶
func (g *GeneratorSuite) QuorumCertificates() *QuorumCertificateGenerator
QuorumCertificates returns a generator for flow.QuorumCertificate.
func (*GeneratorSuite) QuorumCertificatesWithSignerIDs ¶
func (g *GeneratorSuite) QuorumCertificatesWithSignerIDs() *QuorumCertificateWithSignerIDsGenerator
QuorumCertificatesWithSignerIDs returns a generator for flow.QuorumCertificateWithSignerIDs.
func (*GeneratorSuite) Random ¶
func (g *GeneratorSuite) Random() *RandomGenerator
Random returns the shared random generator.
func (*GeneratorSuite) Seals ¶
func (g *GeneratorSuite) Seals() *SealGenerator
Seals returns a generator for flow.Seal.
func (*GeneratorSuite) ServiceEvents ¶
func (g *GeneratorSuite) ServiceEvents() *ServiceEventGenerator
ServiceEvents returns a generator for flow.ServiceEvent.
func (*GeneratorSuite) SetEpochExtensionViewCounts ¶
func (g *GeneratorSuite) SetEpochExtensionViewCounts() *SetEpochExtensionViewCountGenerator
SetEpochExtensionViewCounts returns a generator for flow.SetEpochExtensionViewCount.
func (*GeneratorSuite) Signatures ¶
func (g *GeneratorSuite) Signatures() *SignatureGenerator
Signatures returns a shared generator for crypto.Signature.
func (*GeneratorSuite) SignerIndices ¶
func (g *GeneratorSuite) SignerIndices() *SignerIndicesGenerator
SignerIndices returns a generator for flow.SignerIndices.
func (*GeneratorSuite) StateCommitments ¶
func (g *GeneratorSuite) StateCommitments() *StateCommitmentGenerator
StateCommitments returns a generator for flow.StateCommitment.
func (*GeneratorSuite) Time ¶
func (g *GeneratorSuite) Time() *TimeGenerator
Time returns a generator for time.Time.
func (*GeneratorSuite) TimeoutCertificates ¶
func (g *GeneratorSuite) TimeoutCertificates() *TimeoutCertificateGenerator
TimeoutCertificates returns a generator for flow.TimeoutCertificate.
func (*GeneratorSuite) TransactionResults ¶
func (g *GeneratorSuite) TransactionResults() *TransactionResultGenerator
TransactionResults returns a generator for flow.TransactionResult.
func (*GeneratorSuite) TransactionSignatures ¶
func (g *GeneratorSuite) TransactionSignatures() *TransactionSignatureGenerator
TransactionSignatures returns a generator for flow.TransactionSignature.
func (*GeneratorSuite) Transactions ¶
func (g *GeneratorSuite) Transactions() *TransactionGenerator
Transactions returns a generator for flow.TransactionBody.
func (*GeneratorSuite) TrieUpdates ¶
func (g *GeneratorSuite) TrieUpdates() *TrieUpdateGenerator
TrieUpdates returns a generator for ledger.TrieUpdate.
func (*GeneratorSuite) VersionBeacons ¶
func (g *GeneratorSuite) VersionBeacons() *VersionBeaconGenerator
VersionBeacons returns a generator for flow.VersionBeacon.
type GeneratorSuiteOption ¶
type GeneratorSuiteOption func(*generatorSuiteConfig)
GeneratorSuiteOption defines an option for configuring a GeneratorSuite.
func WithChainID ¶
func WithChainID(chainID flow.ChainID) GeneratorSuiteOption
WithChainID sets the chain ID that's used as the default for all generators.
func WithSeed ¶
func WithSeed(seed int64) GeneratorSuiteOption
WithSeed sets the random seed used for the random number generator used by all generators. Specifying a seed makes the fixture data deterministic.
type HeaderGenerator ¶
type HeaderGenerator struct {
// contains filtered or unexported fields
}
HeaderGenerator generates block headers with consistent randomness.
func NewBlockHeaderGenerator ¶
func NewBlockHeaderGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, signatures *SignatureGenerator, signerIndices *SignerIndicesGenerator, quorumCerts *QuorumCertificateGenerator, timeGen *TimeGenerator, chainID flow.ChainID, ) *HeaderGenerator
func (*HeaderGenerator) Fixture ¶
func (g *HeaderGenerator) Fixture(opts ...HeaderOption) *flow.Header
Fixture generates a flow.Header with random data based on the provided options.
func (*HeaderGenerator) Genesis ¶
func (g *HeaderGenerator) Genesis(opts ...HeaderOption) *flow.Header
Genesis instantiates a genesis block header. This block has view and height equal to zero. However, conceptually spork root blocks are functionally equivalent to genesis blocks. We have decided that in the long term, the protocol must support spork root blocks with height _and_ view larger than zero. The only option that's used is the chainID.
func (*HeaderGenerator) List ¶
func (g *HeaderGenerator) List(n int, opts ...HeaderOption) []*flow.Header
List generates a chain of flow.Header. The first header is generated with the given options, and the subsequent headers are generated using the previous header as the parent.
func (HeaderGenerator) WithChainID ¶
func (f HeaderGenerator) WithChainID(chainID flow.ChainID) HeaderOption
WithChainID is an option that sets the `ChainID` of the block header.
func (HeaderGenerator) WithHeight ¶
func (f HeaderGenerator) WithHeight(height uint64) HeaderOption
WithHeight is an option that sets the `Height` of the block header.
func (HeaderGenerator) WithLastViewTC ¶
func (f HeaderGenerator) WithLastViewTC(lastViewTC *flow.TimeoutCertificate) HeaderOption
WithLastViewTC is an option that sets the `LastViewTC` of the block header.
func (HeaderGenerator) WithParent ¶
func (f HeaderGenerator) WithParent(parentID flow.Identifier, parentView uint64, parentHeight uint64) HeaderOption
WithParent is an option that sets the `ParentID`, `ParentView`, and `Height` of the block header based on the provided fields. `Height` is set to parent's `Height` + 1.
func (HeaderGenerator) WithParentHeader ¶
func (f HeaderGenerator) WithParentHeader(parent *flow.Header) HeaderOption
WithParentHeader is an option that sets the following fields of the block header based on the provided parent header: - `View` - `Height` - `ChainID` - `Timestamp` - `ParentID` - `ParentView`
If you want a specific value for any of these fields, you should add the appropriate option after this option.
func (HeaderGenerator) WithParentView ¶
func (f HeaderGenerator) WithParentView(view uint64) HeaderOption
WithParentView is an option that sets the `ParentView` of the block header.
func (HeaderGenerator) WithParentVoterIndices ¶
func (f HeaderGenerator) WithParentVoterIndices(indices []byte) HeaderOption
WithParentVoterIndices is an option that sets the `ParentVoterIndices` of the block header.
func (HeaderGenerator) WithParentVoterSigData ¶
func (f HeaderGenerator) WithParentVoterSigData(data []byte) HeaderOption
WithParentVoterSigData is an option that sets the `ParentVoterSigData` of the block header.
func (HeaderGenerator) WithPayloadHash ¶
func (f HeaderGenerator) WithPayloadHash(hash flow.Identifier) HeaderOption
WithPayloadHash is an option that sets the `PayloadHash` of the block header.
func (HeaderGenerator) WithProposerID ¶
func (f HeaderGenerator) WithProposerID(proposerID flow.Identifier) HeaderOption
WithProposerID is an option that sets the `ProposerID` of the block header.
func (HeaderGenerator) WithSourceOfRandomness ¶
func (f HeaderGenerator) WithSourceOfRandomness(source []byte) HeaderOption
WithSourceOfRandomness is an option that sets the `ParentVoterSigData` of the block header based on the provided source of randomness.
func (HeaderGenerator) WithTimestamp ¶
func (f HeaderGenerator) WithTimestamp(timestamp uint64) HeaderOption
WithTimestamp is an option that sets the `Timestamp` of the block header.
func (HeaderGenerator) WithView ¶
func (f HeaderGenerator) WithView(view uint64) HeaderOption
WithView is an option that sets the `View` of the block header.
type HeaderOption ¶
type HeaderOption func(*HeaderGenerator, *flow.Header)
type IdentifierGenerator ¶
type IdentifierGenerator struct {
// contains filtered or unexported fields
}
IdentifierGenerator generates identifiers with consistent randomness.
func NewIdentifierGenerator ¶
func NewIdentifierGenerator( random *RandomGenerator, ) *IdentifierGenerator
func (*IdentifierGenerator) Fixture ¶
func (g *IdentifierGenerator) Fixture(opts ...IdentifierOption) flow.Identifier
Fixture generates a random flow.Identifier.
func (*IdentifierGenerator) List ¶
func (g *IdentifierGenerator) List(n int, opts ...IdentifierOption) flow.IdentifierList
List generates a list of random flow.Identifier.
type IdentifierOption ¶
type IdentifierOption func(*IdentifierGenerator, *identifierConfig)
type IdentityGenerator ¶
type IdentityGenerator struct {
// contains filtered or unexported fields
}
IdentityGenerator generates identities with consistent randomness.
func NewIdentityGenerator ¶
func NewIdentityGenerator( random *RandomGenerator, cryptoGen *CryptoGenerator, identifiers *IdentifierGenerator, addresses *AddressGenerator, ) *IdentityGenerator
NewIdentityGenerator creates a new IdentityGenerator.
func (*IdentityGenerator) Fixture ¶
func (g *IdentityGenerator) Fixture(opts ...IdentityOption) *flow.Identity
Fixture generates a flow.Identity with random data based on the provided options.
func (*IdentityGenerator) List ¶
func (g *IdentityGenerator) List(n int, opts ...IdentityOption) flow.IdentityList
List generates a list of flow.Identity.
func (IdentityGenerator) WithAddress ¶
func (f IdentityGenerator) WithAddress(address string) IdentityOption
WithAddress is an option that sets the `Address` of the identity.
func (IdentityGenerator) WithAllRoles ¶
func (f IdentityGenerator) WithAllRoles() IdentityOption
WithAllRoles is an option that sets the `Role` of the identity. When used with `List()`, it will set successive identities to different roles, cycling through all roles.
func (IdentityGenerator) WithAllRolesExcept ¶
func (f IdentityGenerator) WithAllRolesExcept(except ...flow.Role) IdentityOption
WithAllRolesExcept is an option that sets the `Role` of the identity. When used with `List()`, it will set successive identities to different roles, cycling through all roles except the ones specified.
func (IdentityGenerator) WithEpochParticipationStatus ¶
func (f IdentityGenerator) WithEpochParticipationStatus(status flow.EpochParticipationStatus) IdentityOption
WithEpochParticipationStatus is an option that sets the `EpochParticipationStatus` of the identity.
func (IdentityGenerator) WithInitialWeight ¶
func (f IdentityGenerator) WithInitialWeight(weight uint64) IdentityOption
WithInitialWeight is an option that sets the `InitialWeight` of the identity.
func (IdentityGenerator) WithNetworkPubKey ¶
func (f IdentityGenerator) WithNetworkPubKey(key crypto.PublicKey) IdentityOption
WithNetworkPubKey is an option that sets the `NetworkPubKey` of the identity.
func (IdentityGenerator) WithNodeID ¶
func (f IdentityGenerator) WithNodeID(nodeID flow.Identifier) IdentityOption
WithNodeID is an option that sets the `NodeID` of the identity.
func (IdentityGenerator) WithRole ¶
func (f IdentityGenerator) WithRole(role flow.Role) IdentityOption
WithRole is an option that sets the `Role` of the identity.
func (IdentityGenerator) WithStakingPubKey ¶
func (f IdentityGenerator) WithStakingPubKey(key crypto.PublicKey) IdentityOption
WithStakingPubKey is an option that sets the `StakingPubKey` of the identity.
type IdentityOption ¶
type IdentityOption func(*IdentityGenerator, *flow.Identity)
type LedgerPathGenerator ¶
type LedgerPathGenerator struct {
// contains filtered or unexported fields
}
LedgerPathGenerator generates ledger paths with consistent randomness.
func NewLedgerPathGenerator ¶
func NewLedgerPathGenerator( random *RandomGenerator, ) *LedgerPathGenerator
func (*LedgerPathGenerator) Fixture ¶
func (g *LedgerPathGenerator) Fixture(opts ...LedgerPathOption) ledger.Path
Fixture generates a single random ledger.Path.
func (*LedgerPathGenerator) List ¶
func (g *LedgerPathGenerator) List(n int, opts ...LedgerPathOption) []ledger.Path
List generates a list of random ledger.Path.
type LedgerPathOption ¶
type LedgerPathOption func(*LedgerPathGenerator, *ledgerPathConfig)
type LedgerPayloadGenerator ¶
type LedgerPayloadGenerator struct {
// contains filtered or unexported fields
}
LedgerPayloadGenerator generates ledger payloads with consistent randomness.
func NewLedgerPayloadGenerator ¶
func NewLedgerPayloadGenerator( random *RandomGenerator, ledgerValues *LedgerValueGenerator, ) *LedgerPayloadGenerator
func (*LedgerPayloadGenerator) Fixture ¶
func (g *LedgerPayloadGenerator) Fixture(opts ...LedgerPayloadOption) *ledger.Payload
Fixture generates a single random ledger.Payload.
func (*LedgerPayloadGenerator) List ¶
func (g *LedgerPayloadGenerator) List(n int, opts ...LedgerPayloadOption) []*ledger.Payload
List generates a list of random ledger.Payload.
func (LedgerPayloadGenerator) WithSize ¶
func (f LedgerPayloadGenerator) WithSize(minSize, maxSize int) LedgerPayloadOption
WithSize is an option that sets the payload size range.
func (LedgerPayloadGenerator) WithValue ¶
func (f LedgerPayloadGenerator) WithValue(value ledger.Value) LedgerPayloadOption
WithValue is an option that sets the value for the payload.
type LedgerPayloadOption ¶
type LedgerPayloadOption func(*LedgerPayloadGenerator, *payloadConfig)
type LedgerValueGenerator ¶
type LedgerValueGenerator struct {
// contains filtered or unexported fields
}
LedgerValueGenerator generates ledger values with consistent randomness.
func NewLedgerValueGenerator ¶
func NewLedgerValueGenerator( random *RandomGenerator, ) *LedgerValueGenerator
func (*LedgerValueGenerator) Fixture ¶
func (g *LedgerValueGenerator) Fixture(opts ...LedgerValueOption) ledger.Value
Fixture generates a single random ledger.Value.
func (*LedgerValueGenerator) List ¶
func (g *LedgerValueGenerator) List(n int, opts ...LedgerValueOption) []ledger.Value
List generates a list of random ledger.Value.
func (LedgerValueGenerator) WithSize ¶
func (f LedgerValueGenerator) WithSize(minSize, maxSize int) LedgerValueOption
WithSize is an option that sets the value size range [minSize, maxSize).
type LedgerValueOption ¶
type LedgerValueOption func(*LedgerValueGenerator, *valueConfig)
type LightTransactionResultGenerator ¶
type LightTransactionResultGenerator struct {
*TransactionResultGenerator
}
LightTransactionResultGenerator generates light transaction results with consistent randomness.
func NewLightTransactionResultGenerator ¶
func NewLightTransactionResultGenerator( txResults *TransactionResultGenerator, ) *LightTransactionResultGenerator
func (*LightTransactionResultGenerator) Fixture ¶
func (g *LightTransactionResultGenerator) Fixture(opts ...LightTransactionResultOption) flow.LightTransactionResult
Fixture generates a flow.LightTransactionResult with random data based on the provided options.
func (*LightTransactionResultGenerator) List ¶
func (g *LightTransactionResultGenerator) List(n int, opts ...LightTransactionResultOption) []flow.LightTransactionResult
List generates a list of flow.LightTransactionResult.
func (LightTransactionResultGenerator) WithComputationUsed ¶
func (f LightTransactionResultGenerator) WithComputationUsed(computationUsed uint64) TransactionResultOption
WithComputationUsed is an option that sets the computation used for the transaction result.
func (LightTransactionResultGenerator) WithErrorMessage ¶
func (f LightTransactionResultGenerator) WithErrorMessage(errorMessage string) TransactionResultOption
WithErrorMessage is an option that sets the error message for the transaction result.
func (LightTransactionResultGenerator) WithTransactionID ¶
func (f LightTransactionResultGenerator) WithTransactionID(transactionID flow.Identifier) TransactionResultOption
WithTransactionID is an option that sets the transaction ID for the transaction result.
type LightTransactionResultOption ¶
type LightTransactionResultOption func(*LightTransactionResultGenerator, *flow.LightTransactionResult)
type PayloadGenerator ¶
type PayloadGenerator struct {
// contains filtered or unexported fields
}
PayloadGenerator generates block payloads with consistent randomness.
func NewPayloadGenerator ¶
func NewPayloadGenerator( random *RandomGenerator, identifies *IdentifierGenerator, guarantees *CollectionGuaranteeGenerator, seals *SealGenerator, executionReceiptStubs *ExecutionReceiptStubGenerator, executionResults *ExecutionResultGenerator, ) *PayloadGenerator
func (*PayloadGenerator) Fixture ¶
func (g *PayloadGenerator) Fixture(opts ...PayloadOption) *flow.Payload
Fixture generates a flow.Payload with random data based on the provided options.
func (*PayloadGenerator) List ¶
func (g *PayloadGenerator) List(n int, opts ...PayloadOption) []*flow.Payload
List generates a list of flow.Payload.
func (PayloadGenerator) WithGuarantees ¶
func (f PayloadGenerator) WithGuarantees(guarantees ...*flow.CollectionGuarantee) PayloadOption
WithGuarantees is an option that sets the `Guarantees` of the payload.
func (PayloadGenerator) WithProtocolStateID ¶
func (f PayloadGenerator) WithProtocolStateID(protocolStateID flow.Identifier) PayloadOption
WithProtocolStateID is an option that sets the `ProtocolStateID` of the payload.
func (PayloadGenerator) WithReceiptStubs ¶
func (f PayloadGenerator) WithReceiptStubs(receipts ...*flow.ExecutionReceiptStub) PayloadOption
WithReceiptStubs is an option that sets the `Receipts` of the payload.
func (PayloadGenerator) WithReceipts ¶
func (f PayloadGenerator) WithReceipts(receipts ...*flow.ExecutionReceipt) PayloadOption
WithReceipts is an option that sets the `Receipts` and `Results` of the payload by adding all receipts and their `ExecutionResults` to the payload.
To add only receipts, use `WithReceiptStubs` instead. e.g.
Payload.WithReceiptsStubs( flow.ExecutionReceiptList(receipts).Stubs()..., )
func (PayloadGenerator) WithResults ¶
func (f PayloadGenerator) WithResults(results flow.ExecutionResultList) PayloadOption
WithResults is an option that sets the `Results` of the payload.
func (PayloadGenerator) WithSeals ¶
func (f PayloadGenerator) WithSeals(seals ...*flow.Seal) PayloadOption
WithSeals is an option that sets the `Seals` of the payload.
type PayloadOption ¶
type PayloadOption func(*PayloadGenerator, *flow.Payload)
type PrivateKeyOption ¶
type PrivateKeyOption func(*CryptoGenerator, *privateKeyConfig)
type ProposalKeyGenerator ¶
type ProposalKeyGenerator struct {
// contains filtered or unexported fields
}
ProposalKeyGenerator generates proposal keys with consistent randomness.
func NewProposalKeyGenerator ¶
func NewProposalKeyGenerator( addresses *AddressGenerator, ) *ProposalKeyGenerator
func (*ProposalKeyGenerator) Fixture ¶
func (g *ProposalKeyGenerator) Fixture(opts ...ProposalKeyOption) flow.ProposalKey
Fixture generates a flow.ProposalKey with random data based on the provided options.
func (*ProposalKeyGenerator) List ¶
func (g *ProposalKeyGenerator) List(n int, opts ...ProposalKeyOption) []flow.ProposalKey
List generates a list of flow.ProposalKey.
func (ProposalKeyGenerator) WithAddress ¶
func (f ProposalKeyGenerator) WithAddress(address flow.Address) ProposalKeyOption
WithAddress is an option that sets the address for the proposal key.
func (ProposalKeyGenerator) WithKeyIndex ¶
func (f ProposalKeyGenerator) WithKeyIndex(keyIndex uint32) ProposalKeyOption
WithKeyIndex is an option that sets the key index for the proposal key.
func (ProposalKeyGenerator) WithSequenceNumber ¶
func (f ProposalKeyGenerator) WithSequenceNumber(sequenceNumber uint64) ProposalKeyOption
WithSequenceNumber is an option that sets the sequence number for the proposal key.
type ProposalKeyOption ¶
type ProposalKeyOption func(*ProposalKeyGenerator, *flow.ProposalKey)
type ProtocolStateVersionUpgradeGenerator ¶
type ProtocolStateVersionUpgradeGenerator struct {
// contains filtered or unexported fields
}
ProtocolStateVersionUpgradeGenerator generates protocol state version upgrades with consistent randomness.
func NewProtocolStateVersionUpgradeGenerator ¶
func NewProtocolStateVersionUpgradeGenerator(random *RandomGenerator) *ProtocolStateVersionUpgradeGenerator
NewProtocolStateVersionUpgradeGenerator creates a new ProtocolStateVersionUpgradeGenerator.
func (*ProtocolStateVersionUpgradeGenerator) Fixture ¶
func (g *ProtocolStateVersionUpgradeGenerator) Fixture(opts ...ProtocolStateVersionUpgradeOption) *flow.ProtocolStateVersionUpgrade
Fixture generates a flow.ProtocolStateVersionUpgrade with random data based on the provided options.
func (*ProtocolStateVersionUpgradeGenerator) List ¶
func (g *ProtocolStateVersionUpgradeGenerator) List(n int, opts ...ProtocolStateVersionUpgradeOption) []*flow.ProtocolStateVersionUpgrade
List generates a list of flow.ProtocolStateVersionUpgrade.
func (ProtocolStateVersionUpgradeGenerator) WithActiveView ¶
func (f ProtocolStateVersionUpgradeGenerator) WithActiveView(view uint64) ProtocolStateVersionUpgradeOption
WithActiveView is an option that sets the `ActiveView` of the upgrade.
func (ProtocolStateVersionUpgradeGenerator) WithNewProtocolStateVersion ¶
func (f ProtocolStateVersionUpgradeGenerator) WithNewProtocolStateVersion(version uint64) ProtocolStateVersionUpgradeOption
WithNewProtocolStateVersion is an option that sets the `NewProtocolStateVersion` of the upgrade.
type ProtocolStateVersionUpgradeOption ¶
type ProtocolStateVersionUpgradeOption func(*ProtocolStateVersionUpgradeGenerator, *flow.ProtocolStateVersionUpgrade)
type QuorumCertificateGenerator ¶
type QuorumCertificateGenerator struct {
// contains filtered or unexported fields
}
QuorumCertificateGenerator generates quorum certificates with consistent randomness.
func NewQuorumCertificateGenerator ¶
func NewQuorumCertificateGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, signerIndices *SignerIndicesGenerator, signatures *SignatureGenerator, ) *QuorumCertificateGenerator
func (QuorumCertificateGenerator) CertifiesBlock ¶
func (f QuorumCertificateGenerator) CertifiesBlock(header *flow.Header) QuorumCertificateOption
CertifiesBlock is an option that sets the block ID and view of the quorum certificate to match the provided header.
func (*QuorumCertificateGenerator) Fixture ¶
func (g *QuorumCertificateGenerator) Fixture(opts ...QuorumCertificateOption) *flow.QuorumCertificate
Fixture generates a flow.QuorumCertificate with random data based on the provided options.
func (*QuorumCertificateGenerator) List ¶
func (g *QuorumCertificateGenerator) List(n int, opts ...QuorumCertificateOption) []*flow.QuorumCertificate
List generates a list of flow.QuorumCertificate.
func (*QuorumCertificateGenerator) QCSigDataWithSoR ¶
func (g *QuorumCertificateGenerator) QCSigDataWithSoR(source []byte) []byte
QCSigDataWithSoR generates a flow.QuorumCertificate signature data with a source of randomness. If source is empty, a random source of randomness is generated.
func (QuorumCertificateGenerator) WithBlockID ¶
func (f QuorumCertificateGenerator) WithBlockID(blockID flow.Identifier) QuorumCertificateOption
WithBlockID is an option that sets the block ID of the quorum certificate.
func (QuorumCertificateGenerator) WithRandomnessSource ¶
func (f QuorumCertificateGenerator) WithRandomnessSource(source []byte) QuorumCertificateOption
WithRandomnessSource is an option that sets the source of randomness for the quorum certificate.
func (QuorumCertificateGenerator) WithRootBlockID ¶
func (f QuorumCertificateGenerator) WithRootBlockID(blockID flow.Identifier) QuorumCertificateOption
WithRootBlockID is an option that sets the root block ID of the quorum certificate.
func (QuorumCertificateGenerator) WithSignerIndices ¶
func (f QuorumCertificateGenerator) WithSignerIndices(signerIndices []byte) QuorumCertificateOption
WithSignerIndices is an option that sets the signer indices of the quorum certificate.
func (QuorumCertificateGenerator) WithView ¶
func (f QuorumCertificateGenerator) WithView(view uint64) QuorumCertificateOption
WithView is an option that sets the view of the quorum certificate.
type QuorumCertificateOption ¶
type QuorumCertificateOption func(*QuorumCertificateGenerator, *flow.QuorumCertificate)
type QuorumCertificateWithSignerIDsGenerator ¶
type QuorumCertificateWithSignerIDsGenerator struct {
// contains filtered or unexported fields
}
QuorumCertificateWithSignerIDsGenerator generates flow.QuorumCertificateWithSignerIDs with consistent randomness.
func NewQuorumCertificateWithSignerIDsGenerator ¶
func NewQuorumCertificateWithSignerIDsGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, quorumCerts *QuorumCertificateGenerator, ) *QuorumCertificateWithSignerIDsGenerator
func (*QuorumCertificateWithSignerIDsGenerator) Fixture ¶
func (g *QuorumCertificateWithSignerIDsGenerator) Fixture(opts ...QuorumCertificateWithSignerIDsOption) *flow.QuorumCertificateWithSignerIDs
Fixture generates a flow.QuorumCertificateWithSignerIDs with random data based on the provided options.
func (*QuorumCertificateWithSignerIDsGenerator) List ¶
func (g *QuorumCertificateWithSignerIDsGenerator) List(n int, opts ...QuorumCertificateWithSignerIDsOption) []*flow.QuorumCertificateWithSignerIDs
List generates a list of flow.QuorumCertificateWithSignerIDs.
func (QuorumCertificateWithSignerIDsGenerator) WithBlockID ¶
func (f QuorumCertificateWithSignerIDsGenerator) WithBlockID(blockID flow.Identifier) QuorumCertificateWithSignerIDsOption
WithBlockID is an option that sets the `BlockID` of the quorum certificate with signer IDs.
func (QuorumCertificateWithSignerIDsGenerator) WithSigData ¶
func (f QuorumCertificateWithSignerIDsGenerator) WithSigData(sigData []byte) QuorumCertificateWithSignerIDsOption
WithSigData is an option that sets the `SigData` of the quorum certificate with signer IDs.
func (QuorumCertificateWithSignerIDsGenerator) WithSignerIDs ¶
func (f QuorumCertificateWithSignerIDsGenerator) WithSignerIDs(signerIDs flow.IdentifierList) QuorumCertificateWithSignerIDsOption
WithSignerIDs is an option that sets the `SignerIDs` of the quorum certificate with signer IDs.
func (QuorumCertificateWithSignerIDsGenerator) WithView ¶
func (f QuorumCertificateWithSignerIDsGenerator) WithView(view uint64) QuorumCertificateWithSignerIDsOption
WithView is an option that sets the `View` of the quorum certificate with signer IDs.
type QuorumCertificateWithSignerIDsOption ¶
type QuorumCertificateWithSignerIDsOption func(*QuorumCertificateWithSignerIDsGenerator, *flow.QuorumCertificateWithSignerIDs)
type RandomGenerator ¶
RandomGenerator provides random value generation with consistent randomness. Exposes all methods from *rand.Rand, as well as additional methods to reduce
func NewRandomGenerator ¶
func NewRandomGenerator(rng *rand.Rand) *RandomGenerator
func (*RandomGenerator) Int32InRange ¶
func (g *RandomGenerator) Int32InRange(min, max int32) int32
Int32InRange generates a random int32 in the inclusive range [min, max]. Min and max MUST be positive numbers and `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) Int64InRange ¶
func (g *RandomGenerator) Int64InRange(min, max int64) int64
Int64InRange generates a random int64 in the inclusive range [min, max]. Min and max MUST be positive numbers and `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) IntInRange ¶
func (g *RandomGenerator) IntInRange(min, max int) int
IntInRange generates a random int in the inclusive range [min, max]. Min and max MUST be positive numbers and `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) RandomBytes ¶
func (g *RandomGenerator) RandomBytes(n int) []byte
RandomBytes generates n random bytes.
func (*RandomGenerator) RandomString ¶
func (g *RandomGenerator) RandomString(length uint) string
RandomString generates a random string of the specified length.
func (*RandomGenerator) Uint16n ¶
func (g *RandomGenerator) Uint16n(n uint16) uint16
Uint16n generates a random uint16 strictly less than `n`. Uses rand.Int31n to generate a random int32 and then casts it to uint16. n MUST be > 0.
func (*RandomGenerator) Uint32InRange ¶
func (g *RandomGenerator) Uint32InRange(min, max uint32) uint32
Uint32InRange generates a random uint32 in the inclusive range [min, max]. `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) Uint32n ¶
func (g *RandomGenerator) Uint32n(n uint32) uint32
Uint32n generates a random uint32 strictly less than `n`. Uses rand.Int31n to generate a random int32 and then casts it to uint32. n MUST be > 0.
func (*RandomGenerator) Uint64InRange ¶
func (g *RandomGenerator) Uint64InRange(min, max uint64) uint64
Uint64InRange generates a random uint64 in the inclusive range [min, max]. `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) Uint64n ¶
func (g *RandomGenerator) Uint64n(n uint64) uint64
Uint64n generates a random uint64 strictly less than `n`. Uses rand.Int63n to generate a random int64 and then casts it to uint64. n MUST be > 0.
func (*RandomGenerator) UintInRange ¶
func (g *RandomGenerator) UintInRange(min, max uint) uint
UintInRange generates a random uint in the inclusive range [min, max]. `max` must be strictly greater than `min` or the method will panic.
func (*RandomGenerator) Uintn ¶
func (g *RandomGenerator) Uintn(n uint) uint
Uintn generates a random uint strictly less than `n`. Uses rand.Int63n to generate a random int64 and then casts it to uint. n MUST be > 0.
type SealGenerator ¶
type SealGenerator struct {
// contains filtered or unexported fields
}
SealGenerator generates seals with consistent randomness.
func NewSealGenerator ¶
func NewSealGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, stateCommitments *StateCommitmentGenerator, aggregatedSignatures *AggregatedSignatureGenerator, ) *SealGenerator
func (*SealGenerator) Fixture ¶
func (g *SealGenerator) Fixture(opts ...SealOption) *flow.Seal
Fixture generates a flow.Seal with random data based on the provided options.
func (*SealGenerator) List ¶
func (g *SealGenerator) List(n int, opts ...SealOption) []*flow.Seal
List generates a list of flow.Seal with random data.
func (SealGenerator) WithAggregatedApprovalSigs ¶
func (f SealGenerator) WithAggregatedApprovalSigs(sigs ...flow.AggregatedSignature) SealOption
WithAggregatedApprovalSigs is an option that sets the `AggregatedApprovalSigs` of the seal.
func (SealGenerator) WithBlockID ¶
func (f SealGenerator) WithBlockID(blockID flow.Identifier) SealOption
WithBlockID is an option that sets the `BlockID` of the seal.
func (SealGenerator) WithFinalState ¶
func (f SealGenerator) WithFinalState(finalState flow.StateCommitment) SealOption
WithFinalState is an option that sets the `FinalState` of the seal.
func (SealGenerator) WithResultID ¶
func (f SealGenerator) WithResultID(resultID flow.Identifier) SealOption
WithResultID is an option that sets the `ResultID` of the seal.
type SealOption ¶
type SealOption func(*SealGenerator, *flow.Seal)
type ServiceEventGenerator ¶
type ServiceEventGenerator struct {
// contains filtered or unexported fields
}
ServiceEventGenerator generates service events with consistent randomness.
func NewServiceEventGenerator ¶
func NewServiceEventGenerator( random *RandomGenerator, epochSetups *EpochSetupGenerator, epochCommits *EpochCommitGenerator, epochRecovers *EpochRecoverGenerator, versionBeacons *VersionBeaconGenerator, protocolStateVersionUpgrades *ProtocolStateVersionUpgradeGenerator, setEpochExtensionViewCounts *SetEpochExtensionViewCountGenerator, ejectNodes *EjectNodeGenerator, ) *ServiceEventGenerator
NewServiceEventGenerator creates a new ServiceEventGenerator.
func (*ServiceEventGenerator) Fixture ¶
func (g *ServiceEventGenerator) Fixture(opts ...ServiceEventOption) flow.ServiceEvent
Fixture generates a flow.ServiceEvent with random data based on the provided options.
func (*ServiceEventGenerator) List ¶
func (g *ServiceEventGenerator) List(n int, opts ...ServiceEventOption) []flow.ServiceEvent
List generates a list of flow.ServiceEvent.
func (ServiceEventGenerator) WithEvent ¶
func (f ServiceEventGenerator) WithEvent(eventData interface{}) ServiceEventOption
WithEvent is an option that sets the `Event` data of the service event.
func (ServiceEventGenerator) WithType ¶
func (f ServiceEventGenerator) WithType(eventType flow.ServiceEventType) ServiceEventOption
WithType is an option that sets the `Type` of the service event.
type ServiceEventOption ¶
type ServiceEventOption func(*ServiceEventGenerator, *flow.ServiceEvent)
type SetEpochExtensionViewCountGenerator ¶
type SetEpochExtensionViewCountGenerator struct {
// contains filtered or unexported fields
}
SetEpochExtensionViewCountGenerator generates epoch extension view count events with consistent randomness.
func NewSetEpochExtensionViewCountGenerator ¶
func NewSetEpochExtensionViewCountGenerator(random *RandomGenerator) *SetEpochExtensionViewCountGenerator
NewSetEpochExtensionViewCountGenerator creates a new SetEpochExtensionViewCountGenerator.
func (*SetEpochExtensionViewCountGenerator) Fixture ¶
func (g *SetEpochExtensionViewCountGenerator) Fixture(opts ...SetEpochExtensionViewCountOption) *flow.SetEpochExtensionViewCount
Fixture generates a flow.SetEpochExtensionViewCount with random data based on the provided options.
func (*SetEpochExtensionViewCountGenerator) List ¶
func (g *SetEpochExtensionViewCountGenerator) List(n int, opts ...SetEpochExtensionViewCountOption) []*flow.SetEpochExtensionViewCount
List generates a list of flow.SetEpochExtensionViewCount.
func (SetEpochExtensionViewCountGenerator) WithValue ¶
func (f SetEpochExtensionViewCountGenerator) WithValue(value uint64) SetEpochExtensionViewCountOption
WithValue is an option that sets the `Value` of the extension view count.
type SetEpochExtensionViewCountOption ¶
type SetEpochExtensionViewCountOption func(*SetEpochExtensionViewCountGenerator, *flow.SetEpochExtensionViewCount)
type SignatureGenerator ¶
type SignatureGenerator struct {
// contains filtered or unexported fields
}
SignatureGenerator generates signatures with consistent randomness.
func NewSignatureGenerator ¶
func NewSignatureGenerator( random *RandomGenerator, ) *SignatureGenerator
func (*SignatureGenerator) Fixture ¶
func (g *SignatureGenerator) Fixture(opts ...SignatureOption) crypto.Signature
Fixture generates a random crypto.Signature.
func (*SignatureGenerator) List ¶
func (g *SignatureGenerator) List(n int, opts ...SignatureOption) []crypto.Signature
List generates a list of random crypto.Signature.
type SignatureOption ¶
type SignatureOption func(*SignatureGenerator, *signatureConfig)
type SignerIndicesGenerator ¶
type SignerIndicesGenerator struct {
// contains filtered or unexported fields
}
SignerIndicesGenerator generates signer indices with consistent randomness.
func NewSignerIndicesGenerator ¶
func NewSignerIndicesGenerator(random *RandomGenerator) *SignerIndicesGenerator
func (*SignerIndicesGenerator) Fixture ¶
func (g *SignerIndicesGenerator) Fixture(opts ...SignerIndicesOption) []byte
Fixture generates signer indices with random data based on the provided options. Uses default 10-bit vector size and count of 3 signers.
func (*SignerIndicesGenerator) List ¶
func (g *SignerIndicesGenerator) List(n int, opts ...SignerIndicesOption) [][]byte
List generates a list of signer indices. Uses default 10-bit vector size and count of 3 signers.
func (SignerIndicesGenerator) WithIndices ¶
func (f SignerIndicesGenerator) WithIndices(authorizedSigners int, indices []int) SignerIndicesOption
WithIndices is an option that sets the total number of indices and specific indices for signers. Note: passing an empty slice is valid and will be treated as all indices are not set.
func (SignerIndicesGenerator) WithSignerCount ¶
func (f SignerIndicesGenerator) WithSignerCount(authorizedSigners, contributingSigners int) SignerIndicesOption
WithSignerCount is an option that sets the total number of indices and the number of signers.
type SignerIndicesOption ¶
type SignerIndicesOption func(*SignerIndicesGenerator, *signerIndicesConfig)
type StateCommitmentGenerator ¶
type StateCommitmentGenerator struct {
// contains filtered or unexported fields
}
StateCommitmentGenerator generates state commitments with consistent randomness.
func NewStateCommitmentGenerator ¶
func NewStateCommitmentGenerator(random *RandomGenerator) *StateCommitmentGenerator
NewStateCommitmentGenerator creates a new StateCommitmentGenerator.
func (*StateCommitmentGenerator) Fixture ¶
func (g *StateCommitmentGenerator) Fixture(opts ...StateCommitmentOption) flow.StateCommitment
Fixture generates a flow.StateCommitment with random data based on the provided options.
func (*StateCommitmentGenerator) List ¶
func (g *StateCommitmentGenerator) List(n int, opts ...StateCommitmentOption) []flow.StateCommitment
List generates a list of flow.StateCommitment.
func (StateCommitmentGenerator) WithEmptyState ¶
func (f StateCommitmentGenerator) WithEmptyState() StateCommitmentOption
WithEmptyState is an option that sets the state commitment to empty.
func (StateCommitmentGenerator) WithHash ¶
func (f StateCommitmentGenerator) WithHash(h hash.Hash) StateCommitmentOption
WithHash is an option that sets the hash of the state commitment.
type StateCommitmentOption ¶
type StateCommitmentOption func(*StateCommitmentGenerator, *flow.StateCommitment)
type TimeGenerator ¶
type TimeGenerator struct {
// contains filtered or unexported fields
}
TimeGenerator generates time.Time values with consistent randomness.
func NewTimeGenerator ¶
func NewTimeGenerator( random *RandomGenerator, ) *TimeGenerator
func (*TimeGenerator) Fixture ¶
func (g *TimeGenerator) Fixture(opts ...TimeOption) time.Time
Fixture generates a time.Time value. Uses default base time of 2020-07-14T16:00:00Z and timezone of UTC. The default offset is within 10 years of 2020-07-14T16:00:00Z.
func (*TimeGenerator) List ¶
func (g *TimeGenerator) List(n int, opts ...TimeOption) []time.Time
List generates a list of time.Time values. Uses default base time of 2020-07-14T16:00:00Z and timezone of UTC. The default offset is within 10 years of 2020-07-14T16:00:00Z.
func (TimeGenerator) WithBaseTime ¶
func (f TimeGenerator) WithBaseTime(baseTime time.Time) TimeOption
WithBaseTime is an option that sets the time produced by the generator. This will be the exact time. If you want to include a random jitter, use the WithOffsetRandom option in combination with this option.
func (TimeGenerator) WithOffset ¶
func (f TimeGenerator) WithOffset(offset time.Duration) TimeOption
WithOffset is an option that sets the offset from the base time. This sets the exact offset of the base time.
func (TimeGenerator) WithOffsetRandom ¶
func (f TimeGenerator) WithOffsetRandom(max time.Duration) TimeOption
WithOffsetRandom is an option that sets a random offset from the base time in the range [0, max).
func (TimeGenerator) WithTimezone ¶
func (f TimeGenerator) WithTimezone(tz *time.Location) TimeOption
WithTimezone is an option that sets the timezone for time generation.
type TimeOption ¶
type TimeOption func(*TimeGenerator, *timeConfig)
type TimeoutCertificateGenerator ¶
type TimeoutCertificateGenerator struct {
// contains filtered or unexported fields
}
TimeoutCertificateGenerator generates timeout certificates with consistent randomness.
func NewTimeoutCertificateGenerator ¶
func NewTimeoutCertificateGenerator( random *RandomGenerator, quorumCerts *QuorumCertificateGenerator, signatures *SignatureGenerator, signerIndices *SignerIndicesGenerator, ) *TimeoutCertificateGenerator
NewTimeoutCertificateGenerator creates a new TimeoutCertificateGenerator.
func (*TimeoutCertificateGenerator) Fixture ¶
func (g *TimeoutCertificateGenerator) Fixture(opts ...TimeoutCertificateOption) *flow.TimeoutCertificate
Fixture generates a flow.TimeoutCertificate with random data based on the provided options.
func (*TimeoutCertificateGenerator) List ¶
func (g *TimeoutCertificateGenerator) List(n int, opts ...TimeoutCertificateOption) []*flow.TimeoutCertificate
List generates a list of flow.TimeoutCertificate.
func (TimeoutCertificateGenerator) WithNewestQC ¶
func (f TimeoutCertificateGenerator) WithNewestQC(qc *flow.QuorumCertificate) TimeoutCertificateOption
WithNewestQC is an option that sets the `NewestQC` of the timeout certificate.
func (TimeoutCertificateGenerator) WithNewestQCViews ¶
func (f TimeoutCertificateGenerator) WithNewestQCViews(views []uint64) TimeoutCertificateOption
WithNewestQCViews is an option that sets the `NewestQCViews` of the timeout certificate.
func (TimeoutCertificateGenerator) WithSigData ¶
func (f TimeoutCertificateGenerator) WithSigData(sigData []byte) TimeoutCertificateOption
WithSigData is an option that sets the `SigData` of the timeout certificate.
func (TimeoutCertificateGenerator) WithSignerIndices ¶
func (f TimeoutCertificateGenerator) WithSignerIndices(indices []byte) TimeoutCertificateOption
WithSignerIndices is an option that sets the `SignerIndices` of the timeout certificate.
func (TimeoutCertificateGenerator) WithView ¶
func (f TimeoutCertificateGenerator) WithView(view uint64) TimeoutCertificateOption
WithView is an option that sets the `View` of the timeout certificate.
type TimeoutCertificateOption ¶
type TimeoutCertificateOption func(*TimeoutCertificateGenerator, *flow.TimeoutCertificate)
type TransactionGenerator ¶
type TransactionGenerator struct {
// contains filtered or unexported fields
}
TransactionGenerator generates transactions with consistent randomness.
func NewTransactionGenerator ¶
func NewTransactionGenerator( identifiers *IdentifierGenerator, proposalKeys *ProposalKeyGenerator, addresses *AddressGenerator, transactionSigs *TransactionSignatureGenerator, ) *TransactionGenerator
func (*TransactionGenerator) Fixture ¶
func (g *TransactionGenerator) Fixture(opts ...TransactionOption) *flow.TransactionBody
Fixture generates a flow.TransactionBody with random data based on the provided options.
func (*TransactionGenerator) List ¶
func (g *TransactionGenerator) List(n int, opts ...TransactionOption) []*flow.TransactionBody
List generates a list of flow.TransactionBody.
func (TransactionGenerator) WithAuthorizers ¶
func (f TransactionGenerator) WithAuthorizers(authorizers ...flow.Address) TransactionOption
WithAuthorizers is an option that sets the authorizers for the transaction.
func (TransactionGenerator) WithEnvelopeSignatures ¶
func (f TransactionGenerator) WithEnvelopeSignatures(signatures ...flow.TransactionSignature) TransactionOption
WithEnvelopeSignatures is an option that sets the envelope signatures for the transaction.
func (TransactionGenerator) WithGasLimit ¶
func (f TransactionGenerator) WithGasLimit(gasLimit uint64) TransactionOption
WithGasLimit is an option that sets the gas limit for the transaction.
func (TransactionGenerator) WithPayer ¶
func (f TransactionGenerator) WithPayer(payer flow.Address) TransactionOption
WithPayer is an option that sets the payer for the transaction.
func (TransactionGenerator) WithProposalKey ¶
func (f TransactionGenerator) WithProposalKey(proposalKey flow.ProposalKey) TransactionOption
WithProposalKey is an option that sets the proposal key for the transaction.
func (TransactionGenerator) WithReferenceBlockID ¶
func (f TransactionGenerator) WithReferenceBlockID(blockID flow.Identifier) TransactionOption
WithReferenceBlockID is an option that sets the reference block ID for the transaction.
func (TransactionGenerator) WithScript ¶
func (f TransactionGenerator) WithScript(script []byte) TransactionOption
WithScript is an option that sets the script for the transaction.
type TransactionOption ¶
type TransactionOption func(*TransactionGenerator, *flow.TransactionBody)
type TransactionResultGenerator ¶
type TransactionResultGenerator struct {
// contains filtered or unexported fields
}
TransactionResultGenerator generates transaction results with consistent randomness.
func NewTransactionResultGenerator ¶
func NewTransactionResultGenerator( random *RandomGenerator, identifiers *IdentifierGenerator, ) *TransactionResultGenerator
func (*TransactionResultGenerator) Fixture ¶
func (g *TransactionResultGenerator) Fixture(opts ...TransactionResultOption) flow.TransactionResult
Fixture generates a flow.TransactionResult with random data based on the provided options.
func (*TransactionResultGenerator) List ¶
func (g *TransactionResultGenerator) List(n int, opts ...TransactionResultOption) []flow.TransactionResult
List generates a list of flow.TransactionResult.
func (TransactionResultGenerator) WithComputationUsed ¶
func (f TransactionResultGenerator) WithComputationUsed(computationUsed uint64) TransactionResultOption
WithComputationUsed is an option that sets the computation used for the transaction result.
func (TransactionResultGenerator) WithErrorMessage ¶
func (f TransactionResultGenerator) WithErrorMessage(errorMessage string) TransactionResultOption
WithErrorMessage is an option that sets the error message for the transaction result.
func (TransactionResultGenerator) WithTransactionID ¶
func (f TransactionResultGenerator) WithTransactionID(transactionID flow.Identifier) TransactionResultOption
WithTransactionID is an option that sets the transaction ID for the transaction result.
type TransactionResultOption ¶
type TransactionResultOption func(*TransactionResultGenerator, *flow.TransactionResult)
type TransactionSignatureGenerator ¶
type TransactionSignatureGenerator struct {
// contains filtered or unexported fields
}
TransactionSignatureGenerator generates transaction signatures with consistent randomness.
func NewTransactionSignatureGenerator ¶
func NewTransactionSignatureGenerator( random *RandomGenerator, addresses *AddressGenerator, ) *TransactionSignatureGenerator
func (*TransactionSignatureGenerator) Fixture ¶
func (g *TransactionSignatureGenerator) Fixture(opts ...TransactionSignatureOption) flow.TransactionSignature
Fixture generates a flow.TransactionSignature with random data based on the provided options.
func (*TransactionSignatureGenerator) List ¶
func (g *TransactionSignatureGenerator) List(n int, opts ...TransactionSignatureOption) []flow.TransactionSignature
List generates a list of flow.TransactionSignature.
func (TransactionSignatureGenerator) WithAddress ¶
func (f TransactionSignatureGenerator) WithAddress(address flow.Address) TransactionSignatureOption
WithAddress is an option that sets the address for the transaction signature.
func (TransactionSignatureGenerator) WithKeyIndex ¶
func (f TransactionSignatureGenerator) WithKeyIndex(keyIndex uint32) TransactionSignatureOption
WithKeyIndex is an option that sets the key index for the transaction signature.
func (TransactionSignatureGenerator) WithSignature ¶
func (f TransactionSignatureGenerator) WithSignature(sig crypto.Signature) TransactionSignatureOption
WithSignature is an option that sets the signature for the transaction signature.
func (TransactionSignatureGenerator) WithSignerIndex ¶
func (f TransactionSignatureGenerator) WithSignerIndex(signerIndex int) TransactionSignatureOption
WithSignerIndex is an option that sets the signer index for the transaction signature.
type TransactionSignatureOption ¶
type TransactionSignatureOption func(*TransactionSignatureGenerator, *flow.TransactionSignature)
type TrieUpdateGenerator ¶
type TrieUpdateGenerator struct {
// contains filtered or unexported fields
}
TrieUpdateGenerator generates trie updates with consistent randomness.
func NewTrieUpdateGenerator ¶
func NewTrieUpdateGenerator( random *RandomGenerator, ledgerPaths *LedgerPathGenerator, ledgerPayloads *LedgerPayloadGenerator, ) *TrieUpdateGenerator
func (*TrieUpdateGenerator) Fixture ¶
func (g *TrieUpdateGenerator) Fixture(opts ...TrieUpdateOption) *ledger.TrieUpdate
Fixture generates a ledger.TrieUpdate with random data based on the provided options.
func (*TrieUpdateGenerator) List ¶
func (g *TrieUpdateGenerator) List(n int, opts ...TrieUpdateOption) []*ledger.TrieUpdate
List generates a list of ledger.TrieUpdate.
func (TrieUpdateGenerator) WithNumPaths ¶
func (f TrieUpdateGenerator) WithNumPaths(numPaths int) TrieUpdateOption
WithNumPaths is an option that sets the number of paths for the trie update.
func (TrieUpdateGenerator) WithPaths ¶
func (f TrieUpdateGenerator) WithPaths(paths ...ledger.Path) TrieUpdateOption
WithPaths is an option that sets the paths for the trie update.
func (TrieUpdateGenerator) WithPayloadSize ¶
func (f TrieUpdateGenerator) WithPayloadSize(minSize, maxSize int) TrieUpdateOption
WithPayloadSize is an option that sets the payload size range for the trie update.
func (TrieUpdateGenerator) WithPayloads ¶
func (f TrieUpdateGenerator) WithPayloads(payloads ...*ledger.Payload) TrieUpdateOption
WithPayloads is an option that sets the payloads for the trie update.
func (TrieUpdateGenerator) WithRootHash ¶
func (f TrieUpdateGenerator) WithRootHash(rootHash ledger.RootHash) TrieUpdateOption
WithRootHash is an option that sets the root hash for the trie update.
type TrieUpdateOption ¶
type TrieUpdateOption func(*TrieUpdateGenerator, *trieUpdateConfig)
type VersionBeaconGenerator ¶
type VersionBeaconGenerator struct {
// contains filtered or unexported fields
}
VersionBeaconGenerator generates version beacons with consistent randomness.
func NewVersionBeaconGenerator ¶
func NewVersionBeaconGenerator(random *RandomGenerator) *VersionBeaconGenerator
NewVersionBeaconGenerator creates a new VersionBeaconGenerator.
func (*VersionBeaconGenerator) Fixture ¶
func (g *VersionBeaconGenerator) Fixture(opts ...VersionBeaconOption) *flow.VersionBeacon
Fixture generates a flow.VersionBeacon with random data based on the provided options.
func (*VersionBeaconGenerator) List ¶
func (g *VersionBeaconGenerator) List(n int, opts ...VersionBeaconOption) []*flow.VersionBeacon
List generates a list of flow.VersionBeacon.
func (VersionBeaconGenerator) WithBoundaries ¶
func (f VersionBeaconGenerator) WithBoundaries(boundaries ...flow.VersionBoundary) VersionBeaconOption
WithBoundaries is an option that sets the `VersionBoundaries` of the version beacon.
func (VersionBeaconGenerator) WithSequence ¶
func (f VersionBeaconGenerator) WithSequence(sequence uint64) VersionBeaconOption
WithSequence is an option that sets the `Sequence` of the version beacon.
type VersionBeaconOption ¶
type VersionBeaconOption func(*VersionBeaconGenerator, *flow.VersionBeacon)
Source Files
¶
- address.go
- aggregated_signature.go
- block.go
- block_execution_data.go
- chunk.go
- chunk_execution_data.go
- collection.go
- collection_guarantee.go
- crypto.go
- event.go
- event_type.go
- execution_receipt.go
- execution_result.go
- generator.go
- header.go
- identifier.go
- identity.go
- ledger_path.go
- ledger_payload.go
- ledger_value.go
- payload.go
- proposal_key.go
- quorum_certificate.go
- random.go
- seal.go
- service_event.go
- service_event_eject_node.go
- service_event_epoch_commit.go
- service_event_epoch_recover.go
- service_event_epoch_setup.go
- service_event_protocol_state_version_upgrade.go
- service_event_set_epoch_extension_view_count.go
- service_event_version_beacon.go
- signature.go
- signer_indices.go
- state_commitment.go
- time.go
- timeout_certificate.go
- transaction.go
- transaction_result.go
- transaction_signature.go
- trie_update.go
- util.go