@@ -54,6 +54,7 @@ func TestActor_MarshalJSON(t *testing.T) {
54
54
actor1 , err := p .NewActor ([]byte ("deadbeef" ), & fake.Pool {},
55
55
fake.Manager {}, NewHandlerData ())
56
56
require .NoError (t , err )
57
+ require .Equal (t , float64 (dkg .Initialized ), testutil .ToFloat64 (evoting .PromElectionDkgStatus ))
57
58
58
59
// Serialize its persistent data
59
60
actor1Buf , err := actor1 .MarshalJSON ()
@@ -64,8 +65,11 @@ func TestActor_MarshalJSON(t *testing.T) {
64
65
err = handlerData .UnmarshalJSON (actor1Buf )
65
66
require .NoError (t , err )
66
67
68
+ initMetrics ()
69
+
67
70
actor2 , err := p .NewActor ([]byte ("beefdead" ), & fake.Pool {}, fake.Manager {}, handlerData )
68
71
require .NoError (t , err )
72
+ require .Equal (t , float64 (dkg .Initialized ), testutil .ToFloat64 (evoting .PromElectionDkgStatus ))
69
73
70
74
// Check that the persistent data is the same for both actors
71
75
requireActorsEqual (t , actor1 , actor2 )
@@ -74,6 +78,8 @@ func TestActor_MarshalJSON(t *testing.T) {
74
78
// After initializing a Pedersen when dkgMap is not empty, the actors map should
75
79
// contain the same information as dkgMap
76
80
func TestPedersen_InitNonEmptyMap (t * testing.T ) {
81
+ initMetrics ()
82
+
77
83
// Create a new DKG map and fill it with data
78
84
dkgMap := fake .NewInMemoryDB ()
79
85
@@ -143,9 +149,14 @@ func TestPedersen_InitNonEmptyMap(t *testing.T) {
143
149
144
150
_ , err = p .NewActor (electionIDBuf , & fake.Pool {}, fake.Manager {}, handlerData )
145
151
if err != nil {
152
+ require .Equal (t , float64 (dkg .Failed ), testutil .ToFloat64 (evoting .PromElectionDkgStatus ))
146
153
return err
154
+ } else {
155
+ require .Equal (t , float64 (dkg .Initialized ), testutil .ToFloat64 (evoting .PromElectionDkgStatus ))
147
156
}
148
157
158
+ initMetrics ()
159
+
149
160
return nil
150
161
})
151
162
})
@@ -331,6 +342,8 @@ func TestPedersen_Setup(t *testing.T) {
331
342
require .EqualError (t , err , "failed to get election: election does not exist: <nil>" )
332
343
require .Equal (t , float64 (dkg .Failed ), testutil .ToFloat64 (evoting .PromElectionDkgStatus ))
333
344
345
+ initMetrics ()
346
+
334
347
actor .electionID = electionID
335
348
336
349
// RPC is bogus 1
0 commit comments