Integrate event into candidate

This commit is contained in:
Ian Gulliver
2023-06-17 15:05:42 -07:00
parent 6dfcf57109
commit 11ddf35e81
2 changed files with 32 additions and 20 deletions

View File

@@ -33,9 +33,9 @@ type Waiter struct {
chans []<-chan bool
}
func NewTestServer(t *testing.T, numVoters int, signingKey string) *TestServer {
func NewTestServer(ctx context.Context, t *testing.T, ec *event.Client, numVoters int, signingKey string) *TestServer {
ts := &TestServer{
Candidate: elect.NewCandidate(numVoters, signingKey),
Candidate: elect.NewCandidate(ctx, ec, numVoters, signingKey),
listener: lo.Must(net.ListenTCP("tcp", nil)),
}
@@ -72,7 +72,7 @@ func NewTestSystem(t *testing.T, numCandidates, numVoters int) *TestSystem {
}
for i := 0; i < numCandidates; i++ {
ts.servers = append(ts.servers, NewTestServer(t, numVoters, ts.signingKey))
ts.servers = append(ts.servers, NewTestServer(ctx, t, ec, numVoters, ts.signingKey))
}
for i := 0; i < numVoters; i++ {