@@ -208,11 +208,9 @@ impl Blockchain {
208208 // Also, this works only if a single macro block is missing between history items.
209209 let batch_number = Policy :: batch_at ( hist_tx. block_number ) ;
210210 if batch_number > prev_batch
211- && block_state
212- . last ( )
213- . map_or ( false , |block_state : & BlockState | {
214- !Policy :: is_macro_block_at ( block_state. number )
215- } )
211+ && block_state. last ( ) . is_some_and ( |block_state : & BlockState | {
212+ !Policy :: is_macro_block_at ( block_state. number )
213+ } )
216214 {
217215 debug ! (
218216 history_item_block_number = hist_tx. block_number,
@@ -224,21 +222,19 @@ impl Blockchain {
224222 ) ;
225223 assert_eq ! ( batch_number, prev_batch + 1 , "Missing batch" ) ;
226224
227- // We only allow protocol version upgrades on election blocks, so the version cannot be change here.
228225 block_state. push ( BlockState {
229226 number : Policy :: macro_block_of ( prev_batch) . unwrap ( ) ,
230- time : 0 , // FIXME
231- protocol_version : this. state . current_version ( ) ,
227+ time : 0 , // FIXME
228+ protocol_version : this. state . current_version ( ) , // Cannot change, protocol version upgrades only on election blocks.
232229 } ) ;
233230 block_transactions. push ( vec ! [ ] ) ;
234231 block_inherents. push ( vec ! [ ] ) ;
235232 }
236233
237- // We only allow protocol version upgrades on election blocks, so the version cannot be change here.
238234 block_state. push ( BlockState {
239235 number : hist_tx. block_number ,
240236 time : hist_tx. block_time ,
241- protocol_version : this. state . current_version ( ) ,
237+ protocol_version : this. state . current_version ( ) , // Cannot change, protocol version upgrades only on election blocks.
242238 } ) ;
243239 block_transactions. push ( vec ! [ ] ) ;
244240 block_inherents. push ( vec ! [ ] ) ;
0 commit comments