@@ -168,7 +168,19 @@ pub async fn final_processor(
168
168
169
169
let mut receipts = Some ( vec ! [ ] ) ;
170
170
171
- let completed_block = if evm_block_num > config. evm_deploy_block . unwrap_or_default ( ) {
171
+ let mut completed_block = TelosEVMBlock {
172
+ block_num : evm_block_num,
173
+ block_hash,
174
+ ship_hash : block. block_hash . as_string ( ) ,
175
+ lib_num : block. lib_num ,
176
+ lib_hash : block. lib_hash . as_string ( ) ,
177
+ transactions : vec ! [ ] ,
178
+ header,
179
+ execution_payload : exec_payload,
180
+ extra_fields : Default :: default ( ) ,
181
+ } ;
182
+
183
+ if evm_block_num > config. evm_deploy_block . unwrap_or_default ( ) {
172
184
for row in block. decoded_rows {
173
185
match row {
174
186
DecodedRow :: Account ( removed, acc_diff) => {
@@ -222,39 +234,19 @@ pub async fn final_processor(
222
234
. collect ( ) ,
223
235
) ;
224
236
225
- TelosEVMBlock {
226
- block_num : evm_block_num,
227
- block_hash,
228
- ship_hash : block. block_hash . as_string ( ) ,
229
- lib_num : block. lib_num ,
230
- lib_hash : block. lib_hash . as_string ( ) ,
231
- transactions : block. transactions ,
232
- header,
233
- execution_payload : exec_payload,
234
- extra_fields : TelosEngineAPIExtraFields {
235
- statediffs_account : Some ( statediffs_account) ,
236
- statediffs_accountstate : Some ( statediffs_accountstate) ,
237
- revision_changes : block. new_revision ,
238
- gasprice_changes : block. new_gas_price ,
239
- new_addresses_using_create : Some ( new_addresses_using_create) ,
240
- new_addresses_using_openwallet : Some ( new_addresses_using_openwallet) ,
241
- receipts,
242
- } ,
243
- }
244
- } else {
237
+ completed_block. extra_fields = TelosEngineAPIExtraFields {
238
+ statediffs_account : Some ( statediffs_account) ,
239
+ statediffs_accountstate : Some ( statediffs_accountstate) ,
240
+ revision_changes : block. new_revision ,
241
+ gasprice_changes : block. new_gas_price ,
242
+ new_addresses_using_create : Some ( new_addresses_using_create) ,
243
+ new_addresses_using_openwallet : Some ( new_addresses_using_openwallet) ,
244
+ receipts,
245
+ } ;
246
+ } else if evm_block_num == config. evm_deploy_block . unwrap_or_default ( ) {
245
247
let ( state_dump_block, extra_fields) = generate_extra_fields_from_json ( TESTNET_DEPLOY_STATE ) ;
246
248
assert_eq ! ( state_dump_block, evm_block_num, "State dump doesn\' t match configured deploy block" ) ;
247
- TelosEVMBlock {
248
- block_num : evm_block_num,
249
- block_hash,
250
- ship_hash : block. block_hash . as_string ( ) ,
251
- lib_num : block. lib_num ,
252
- lib_hash : block. lib_hash . as_string ( ) ,
253
- transactions : block. transactions ,
254
- header,
255
- execution_payload : exec_payload,
256
- extra_fields,
257
- }
249
+ completed_block. extra_fields = extra_fields;
258
250
} ;
259
251
260
252
block_map. next ( & completed_block, & config. chain_id ) ;
0 commit comments