Skip to content
Snippets Groups Projects
Commit bb91e994 authored by Luca Moser's avatar Luca Moser
Browse files

fixes FPC tests

parent 1dc6dbbb
Branches
Tags
No related merge requests found
...@@ -87,6 +87,8 @@ func TestFPCFinalizedEvent(t *testing.T) { ...@@ -87,6 +87,8 @@ func TestFPCFinalizedEvent(t *testing.T) {
id := "a" id := "a"
paras := fpc.DefaultParameters() paras := fpc.DefaultParameters()
paras.FinalizationThreshold = 2
paras.CoolingOffPeriod = 2
paras.QuerySampleSize = 1 paras.QuerySampleSize = 1
voter := fpc.New(opinionGiverFunc, paras) voter := fpc.New(opinionGiverFunc, paras)
var finalizedOpinion *vote.Opinion var finalizedOpinion *vote.Opinion
...@@ -159,7 +161,10 @@ func TestFPCVotingMultipleOpinionGivers(t *testing.T) { ...@@ -159,7 +161,10 @@ func TestFPCVotingMultipleOpinionGivers(t *testing.T) {
return opinionGivers, nil return opinionGivers, nil
} }
voter := fpc.New(opinionGiverFunc) paras := fpc.DefaultParameters()
paras.FinalizationThreshold = 2
paras.CoolingOffPeriod = 2
voter := fpc.New(opinionGiverFunc, paras)
var finalOpinion *vote.Opinion var finalOpinion *vote.Opinion
voter.Events().Finalized.Attach(events.NewClosure(func(id string, finalizedOpinion vote.Opinion) { voter.Events().Finalized.Attach(events.NewClosure(func(id string, finalizedOpinion vote.Opinion) {
finalOpinion = &finalizedOpinion finalOpinion = &finalizedOpinion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment