@@ -186,6 +186,7 @@ export const BLOCK_COLUMNS = [
186
186
'execution_cost_write_length' ,
187
187
'tx_count' ,
188
188
'signer_bitvec' ,
189
+ 'tenure_height' ,
189
190
] ;
190
191
191
192
export const MICROBLOCK_COLUMNS = [
@@ -465,7 +466,6 @@ export function parseFaucetRequestQueryResult(result: FaucetRequestQueryResult):
465
466
}
466
467
467
468
export function parseBlockQueryResult ( row : BlockQueryResult ) : DbBlock {
468
- // TODO(mb): is the tx_index preserved between microblocks and committed anchor blocks?
469
469
const block : DbBlock = {
470
470
block_hash : row . block_hash ,
471
471
index_block_hash : row . index_block_hash ,
@@ -487,6 +487,8 @@ export function parseBlockQueryResult(row: BlockQueryResult): DbBlock {
487
487
execution_cost_write_length : Number . parseInt ( row . execution_cost_write_length ) ,
488
488
tx_count : row . tx_count ,
489
489
signer_bitvec : row . signer_bitvec ,
490
+ signer_signatures : null , // this field is not queried from db by default due to size constraints
491
+ tenure_height : row . tenure_height ,
490
492
} ;
491
493
return block ;
492
494
}
@@ -1282,43 +1284,6 @@ export function convertTxQueryResultToDbMempoolTx(txs: TxQueryResult[]): DbMempo
1282
1284
return dbMempoolTxs ;
1283
1285
}
1284
1286
1285
- export function setTotalBlockUpdateDataExecutionCost ( data : DataStoreBlockUpdateData ) {
1286
- const cost = data . txs . reduce (
1287
- ( previousValue , currentValue ) => {
1288
- const {
1289
- execution_cost_read_count,
1290
- execution_cost_read_length,
1291
- execution_cost_runtime,
1292
- execution_cost_write_count,
1293
- execution_cost_write_length,
1294
- } = previousValue ;
1295
- return {
1296
- execution_cost_read_count :
1297
- execution_cost_read_count + currentValue . tx . execution_cost_read_count ,
1298
- execution_cost_read_length :
1299
- execution_cost_read_length + currentValue . tx . execution_cost_read_length ,
1300
- execution_cost_runtime : execution_cost_runtime + currentValue . tx . execution_cost_runtime ,
1301
- execution_cost_write_count :
1302
- execution_cost_write_count + currentValue . tx . execution_cost_write_count ,
1303
- execution_cost_write_length :
1304
- execution_cost_write_length + currentValue . tx . execution_cost_write_length ,
1305
- } ;
1306
- } ,
1307
- {
1308
- execution_cost_read_count : 0 ,
1309
- execution_cost_read_length : 0 ,
1310
- execution_cost_runtime : 0 ,
1311
- execution_cost_write_count : 0 ,
1312
- execution_cost_write_length : 0 ,
1313
- }
1314
- ) ;
1315
- data . block . execution_cost_read_count = cost . execution_cost_read_count ;
1316
- data . block . execution_cost_read_length = cost . execution_cost_read_length ;
1317
- data . block . execution_cost_runtime = cost . execution_cost_runtime ;
1318
- data . block . execution_cost_write_count = cost . execution_cost_write_count ;
1319
- data . block . execution_cost_write_length = cost . execution_cost_write_length ;
1320
- }
1321
-
1322
1287
export function markBlockUpdateDataAsNonCanonical ( data : DataStoreBlockUpdateData ) : void {
1323
1288
data . block = { ...data . block , canonical : false } ;
1324
1289
data . microblocks = data . microblocks . map ( mb => ( { ...mb , canonical : false } ) ) ;
0 commit comments