dkgtest

package
v1.2.4-rc Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package dkgtest provides a full roundtrip DKG test engine including all the phases. It is executed against local chain and broadcast channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDkgResultPublished

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

AssertDkgResultPublished checks if DKG result has been published to the chain. It does not inspect the result.

func AssertMemberFailuresCount

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

AssertMemberFailuresCount checks the number of members who failed the protocol execution. It does not check which particular members failed.

func AssertMisbehavingMembers

func AssertMisbehavingMembers(
	t *testing.T,
	testResult *Result,
	expectedMisbehavingMembers ...group.MemberIndex,
)

AssertMisbehavingMembers checks which members were misbehaving - either inactive or disqualified - during the protocol execution and compares them against expected ones.

func AssertNoMisbehavingMembers

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

AssertNoMisbehavingMembers checks there were no misbehaving - inactive or disqualified members - during protocol execution.

func AssertResultSupportingMembers

func AssertResultSupportingMembers(
	t *testing.T,
	testResult *Result,
	expectedSupportingMembers ...group.MemberIndex,
)

AssertResultSupportingMembers checks which particular members actually support the final result with their signature.

func AssertSamePublicKey

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

AssertSamePublicKey checks if all members of the group generated the same group public key during DKG.

func AssertSuccessfulSigners

func AssertSuccessfulSigners(
	t *testing.T,
	testResult *Result,
	expectedSuccessfulMembers ...group.MemberIndex,
)

AssertSuccessfulSigners checks which particular signers were successful.

func AssertSuccessfulSignersCount

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

AssertSuccessfulSignersCount checks the number of successful signers. It does not check which particular signers were successful.

func AssertValidGroupPublicKey

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

AssertValidGroupPublicKey checks if the generated group public key is valid.

func RandomSeed

func RandomSeed(t *testing.T) *big.Int

RandomSeed generates a random DKG seed value. It is important to do not reuse the same seed value between integration tests run in parallel. Broadcast channel name contains a seed to avoid mixing up channel messages between two or more tests executed in parallel.

Types

type Result

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

Result of a DKG test execution.

func RunTest

func RunTest(
	groupSize int,
	honestThreshold int,
	seed *big.Int,
	rules interception.Rules,
) (*Result, error)

RunTest executes the full DKG roundrip test for the provided group size, seed, and honest threshold. The provided interception rules are applied in the broadcast channel for the time of DKG execution.

func (*Result) GetSigners

func (r *Result) GetSigners() []*dkg.ThresholdSigner

GetSigners returns all signers created from DKG protocol execution. If no signers were created because of protocol failures, empty slice is returned.

Jump to

Keyboard shortcuts

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