File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
testnet/stacks-node/src/tests Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2271,16 +2271,18 @@ fn correct_burn_outs() {
2271
2271
"Blocks should be sorted by cycle number already"
2272
2272
) ;
2273
2273
2274
- let block_times: Vec < u64 > = new_blocks_with_reward_set
2275
- . iter ( )
2276
- . filter_map ( |block| block. get ( "block_time" ) . and_then ( |cn| cn. as_u64 ( ) ) )
2277
- . collect ( ) ;
2278
- // Assert that block_times are all greater than 0
2279
- assert ! ( block_times. iter( ) . all( |& t| t > 0 ) ) ;
2280
-
2274
+ let mut last_block_time = None ;
2281
2275
for block in new_blocks_with_reward_set. iter ( ) {
2282
2276
let cycle_number = block[ "cycle_number" ] . as_u64 ( ) . unwrap ( ) ;
2283
2277
let reward_set = block[ "reward_set" ] . as_object ( ) . unwrap ( ) ;
2278
+ if let Some ( block_time) = block[ "block_time" ] . as_u64 ( ) {
2279
+ if let Some ( last) = last_block_time {
2280
+ assert ! ( block_time > last, "Block times should be increasing" ) ;
2281
+ }
2282
+ last_block_time = Some ( block_time) ;
2283
+ }
2284
+ let cycle_number = block[ "cycle_number" ] . as_u64 ( ) . unwrap ( ) ;
2285
+ let reward_set = block[ "reward_set" ] . as_object ( ) . unwrap ( ) ;
2284
2286
2285
2287
if cycle_number < first_epoch_3_cycle {
2286
2288
assert ! (
You can’t perform that action at this time.
0 commit comments