utils

package
v0.13.1-patch.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: AGPL-3.0 Imports: 23 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResultApprovalHasher

func NewResultApprovalHasher() hash.Hasher

NewResultApprovalHasher generates and returns a hasher for signing and verification of result approvals

func SystemChunkCollectionFixture

func SystemChunkCollectionFixture(serviceAddress flow.Address) (*flow.Collection, *flow.CollectionGuarantee)

Types

type CompleteExecutionResult

type CompleteExecutionResult struct {
	Receipt        *flow.ExecutionReceipt
	Block          *flow.Block
	Collections    []*flow.Collection
	ChunkDataPacks []*flow.ChunkDataPack
	SpockSecrets   [][]byte
}

CompleteExecutionResult represents an execution result that is ready to be verified. It contains all execution result and all resources required to verify it. TODO update this as needed based on execution requirements

func CompleteExecutionResultFixture

func CompleteExecutionResultFixture(t *testing.T, chunkCount int, chain flow.Chain) CompleteExecutionResult

CompleteExecutionResultFixture returns complete execution result with an execution receipt referencing the block/collections. chunkCount determines the number of chunks inside each receipt. The output is an execution result with `chunkCount`+1 chunks, where the last chunk accounts for the system chunk.

func LightExecutionResultFixture

func LightExecutionResultFixture(chunkCount int) CompleteExecutionResult

LightExecutionResultFixture returns a light mocked version of execution result with an execution receipt referencing the block/collections. In the light version of execution result, everything is wired properly, but with the minimum viable content provided. This version is basically used for profiling.

type MockAssigner

type MockAssigner struct {
	// contains filtered or unexported fields
}

MockAssigner ...

func NewMockAssigner

func NewMockAssigner(id flow.Identifier, f func(index uint64) bool) *MockAssigner

NewMockAssigner ...

func (*MockAssigner) Assign

func (m *MockAssigner) Assign(result *flow.ExecutionResult, blockID flow.Identifier) (*chmodel.Assignment, error)

Assign assigns all input chunks to the verifier node

Jump to

Keyboard shortcuts

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