utils

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: AGPL-3.0 Imports: 23 Imported by: 2

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