Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v0.43.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestFixture

type TestFixture struct {
	Block           *flow.Block
	ExecutionResult *flow.ExecutionResult
	ExecutionData   *execution_data.BlockExecutionData
	TxErrorMessages []flow.TransactionResultErrorMessage

	ExpectedEvents                []flow.Event
	ExpectedResults               []flow.LightTransactionResult
	ExpectedCollections           []*flow.Collection
	ExpectedRegisterEntries       flow.RegisterEntries
	ExpectedScheduledTransactions map[flow.Identifier]uint64
}

TestFixture contains complete random data for testing BlockExecutionData related processing. It also includes expected parsed data for easy assertions.

func CompleteFixture

func CompleteFixture(t *testing.T, g *fixtures.GeneratorSuite, parentHeader *flow.Header) *TestFixture

CompleteFixture generates consistent test fixture data for testing BlockExecutionData related processing. The returned TestFixture includes a flow.Block, flow.ExecutionResult and execution_data.BlockExecutionData, all internally consistent and using consistent randomness.

properties:

  • The block execution data contains collections for each of the block's guarantees, plus the system chunk
  • Each collection has 3 transactions
  • The first path in each trie update is the same, testing that the indexer will use the last value
  • Every 3rd transaction is failed
  • There are tx error messages for all failed transactions
  • There is an execution result for the block, whose ExecutionDataID matches the BlockExecutionData

func (*TestFixture) ExecutionDataEntity

func (tf *TestFixture) ExecutionDataEntity() *execution_data.BlockExecutionDataEntity

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL