entrytest

package
v1.1.1-rc Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package entrytest provides a full roundtrip relay entry signing test engine including all the signing phases. It is executed against local chain and broadcast channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEntryNotPublished

func AssertEntryNotPublished(t *testing.T, testResult *Result)

AssertEntryNotPublished checks if no relay entry has been published to the chain.

func AssertEntryPublished

func AssertEntryPublished(t *testing.T, testResult *Result)

AssertEntryPublished checks if relay entry has been published to the chain. It does not inspect the entry.

func AssertNoSignerFailures

func AssertNoSignerFailures(
	t *testing.T,
	testResult *Result,
)

AssertNoSignerFailures checks there were no signer failures during the protocol execution.

func AssertSignerFailuresCount

func AssertSignerFailuresCount(
	t *testing.T,
	testResult *Result,
	expectedCount int,
)

AssertSignerFailuresCount checks the number of signers who failed the protocol execution. It does not check which particular signers failed.

Types

type Result

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

Result of the relay entry signing protocol execution.

func RunTest

func RunTest(
	signers []*dkg.ThresholdSigner,
	threshold int,
	rules interception.Rules,
	previousEntry []byte,
) (*Result, error)

RunTest executes the full relay entry signing roundtrip test for the provided group of signers and threshold. Note that the group public key and private key shares used by signers had to be created for the same threshold value. The provided interception rules are applied in the broadcast channel for the time of the protocol execution. Previous entry and seed together form a value to be signed, just like in the real random beacon.

func (*Result) EntryValue

func (r *Result) EntryValue() (*bn256.G1, error)

EntryValue returns the value of relay entry from the result as G1 or nil if no entry was produced because of signers failures. Error is returned if the entry produced by signers can not be unmarshalled to G1 because it is corrupted.

Jump to

Keyboard shortcuts

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