@@ -103,6 +103,23 @@ func TestBlockWatcher(t *testing.T) {
103103 {
104104 ChainID : chainID ,
105105 Height : 44 ,
106+ Transactions : 0 ,
107+ TotalValidators : 2 ,
108+ SignedValidators : 2 ,
109+ ProposerAddress : kilnAddress ,
110+ ValidatorStatus : []ValidatorStatus {
111+ {
112+ Address : kilnAddress ,
113+ Label : kilnName ,
114+ Bonded : true ,
115+ Signed : true ,
116+ Rank : 2 ,
117+ },
118+ },
119+ },
120+ {
121+ ChainID : chainID ,
122+ Height : 45 ,
106123 Transactions : 7 ,
107124 TotalValidators : 2 ,
108125 SignedValidators : 2 ,
@@ -129,24 +146,27 @@ func TestBlockWatcher(t *testing.T) {
129146 `#41 1/2 validators ✅ Kiln` ,
130147 `#42 2/2 validators ✅ Kiln` ,
131148 `#43 2/2 validators 👑 Kiln` ,
149+ `#44 2/2 validators 🟡 Kiln` ,
132150 }, "\n " )+ "\n " ,
133151 blockWatcher .writer .(* bytes.Buffer ).String (),
134152 )
135153
136- assert .Equal (t , float64 (44 ), testutil .ToFloat64 (blockWatcher .metrics .BlockHeight .WithLabelValues (chainID )))
154+ assert .Equal (t , float64 (45 ), testutil .ToFloat64 (blockWatcher .metrics .BlockHeight .WithLabelValues (chainID )))
137155 assert .Equal (t , float64 (29 ), testutil .ToFloat64 (blockWatcher .metrics .Transactions .WithLabelValues (chainID )))
138156 assert .Equal (t , float64 (2 ), testutil .ToFloat64 (blockWatcher .metrics .ActiveSet .WithLabelValues (chainID )))
139- assert .Equal (t , float64 (5 ), testutil .ToFloat64 (blockWatcher .metrics .TrackedBlocks .WithLabelValues (chainID )))
157+ assert .Equal (t , float64 (6 ), testutil .ToFloat64 (blockWatcher .metrics .TrackedBlocks .WithLabelValues (chainID )))
140158 assert .Equal (t , float64 (5 ), testutil .ToFloat64 (blockWatcher .metrics .SkippedBlocks .WithLabelValues (chainID )))
141159
142160 assert .Equal (t , 1 , testutil .CollectAndCount (blockWatcher .metrics .ValidatedBlocks ))
143161 assert .Equal (t , 1 , testutil .CollectAndCount (blockWatcher .metrics .MissedBlocks ))
144162 assert .Equal (t , 1 , testutil .CollectAndCount (blockWatcher .metrics .SoloMissedBlocks ))
145163 assert .Equal (t , 1 , testutil .CollectAndCount (blockWatcher .metrics .ConsecutiveMissedBlocks ))
146- assert .Equal (t , float64 (1 ), testutil .ToFloat64 (blockWatcher .metrics .ProposedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
147- assert .Equal (t , float64 (3 ), testutil .ToFloat64 (blockWatcher .metrics .ValidatedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
164+ assert .Equal (t , 1 , testutil .CollectAndCount (blockWatcher .metrics .EmptyBlocks ))
165+ assert .Equal (t , float64 (2 ), testutil .ToFloat64 (blockWatcher .metrics .ProposedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
166+ assert .Equal (t , float64 (4 ), testutil .ToFloat64 (blockWatcher .metrics .ValidatedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
148167 assert .Equal (t , float64 (1 ), testutil .ToFloat64 (blockWatcher .metrics .MissedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
149168 assert .Equal (t , float64 (0 ), testutil .ToFloat64 (blockWatcher .metrics .SoloMissedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
150169 assert .Equal (t , float64 (0 ), testutil .ToFloat64 (blockWatcher .metrics .ConsecutiveMissedBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
170+ assert .Equal (t , float64 (1 ), testutil .ToFloat64 (blockWatcher .metrics .EmptyBlocks .WithLabelValues (chainID , kilnAddress , kilnName )))
151171 })
152172}
0 commit comments