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 ¶
- func AssertDkgResultPublished(t *testing.T, testResult *Result)
- func AssertMemberFailuresCount(t *testing.T, testResult *Result, expectedCount int)
- func AssertMisbehavingMembers(t *testing.T, testResult *Result, ...)
- func AssertNoMisbehavingMembers(t *testing.T, testResult *Result)
- func AssertResultSupportingMembers(t *testing.T, testResult *Result, ...)
- func AssertSamePublicKey(t *testing.T, testResult *Result)
- func AssertSuccessfulSigners(t *testing.T, testResult *Result, ...)
- func AssertSuccessfulSignersCount(t *testing.T, testResult *Result, expectedCount int)
- func AssertValidGroupPublicKey(t *testing.T, testResult *Result)
- func RandomSeed(t *testing.T) *big.Int
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDkgResultPublished ¶
AssertDkgResultPublished checks if DKG result has been published to the chain. It does not inspect the result.
func AssertMemberFailuresCount ¶
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 ¶
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 ¶
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 ¶
AssertSuccessfulSignersCount checks the number of successful signers. It does not check which particular signers were successful.
func AssertValidGroupPublicKey ¶
AssertValidGroupPublicKey checks if the generated group public key is valid.
func RandomSeed ¶
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.