@@ -108,9 +108,7 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
108108 * @param blockNumber
109109 * @returns
110110 */
111- public async confirmedBlockAt (
112- blockNumber : number ,
113- ) : Promise < ApiDBBlock > {
111+ public async confirmedBlockAt ( blockNumber : number ) : Promise < ApiDBBlock > {
114112 const query = this . manager
115113 . createQueryBuilder ( this . blockTable , 'block' )
116114 . andWhere ( 'block.block_number = :blockNumber' , { blockNumber } ) ;
@@ -124,9 +122,15 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
124122 /**
125123 * Gets a confirmed block from the indexer database in the given block number range and pagination props.
126124 */
127- public async listBlock ( { from, to } : QueryBlock ) : Promise < PaginatedList < ApiDBBlock > > {
125+ public async listBlock ( {
126+ from,
127+ to,
128+ } : QueryBlock ) : Promise < PaginatedList < ApiDBBlock > > {
129+ // TODO: (Luka) add pagination
128130 let theLimit = this . indexerServerPageLimit ;
129- let query = this . manager . createQueryBuilder ( this . blockTable , 'block' ) . orderBy ( 'block.block_number' , 'ASC' ) ;
131+ let query = this . manager
132+ . createQueryBuilder ( this . blockTable , 'block' )
133+ . orderBy ( 'block.block_number' , 'ASC' ) ;
130134 const count = await query . getCount ( ) ;
131135 theLimit = Math . min ( theLimit , count ) ;
132136
@@ -139,9 +143,11 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
139143 }
140144 if ( to !== undefined ) {
141145 if ( from === undefined ) {
142- query = query . andWhere ( 'block.block_number <= :to' , { to } ) . take ( theLimit ) ;
146+ query = query
147+ . andWhere ( 'block.block_number <= :to' , { to } )
148+ . take ( theLimit ) ;
143149 } else {
144- const tempTo = Math . min ( to , from + theLimit - 1 )
150+ const tempTo = Math . min ( to , from + theLimit - 1 ) ;
145151 theLimit = tempTo - from + 1 ;
146152 query = query . andWhere ( 'block.block_number <= :tempTo' , { tempTo } ) ;
147153 }
@@ -154,7 +160,7 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
154160 return res . toApiDBBlock ( ) ;
155161 } ) ;
156162
157- return new PaginatedList ( items , count , theLimit , 0 ) ;
163+ return new PaginatedList ( items , theLimit , 0 ) ;
158164 }
159165
160166 /**
@@ -171,7 +177,6 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
171177 return res . toApiDBBlock ( ) ;
172178 }
173179 throw new Error ( 'Block not found' ) ;
174-
175180 }
176181
177182 /**
@@ -218,23 +223,20 @@ abstract class UtxoExternalIndexerEngineService extends IIndexerEngineService {
218223 if ( returnResponse ) {
219224 query = this . joinTransactionQuery ( query ) ;
220225 }
221- const count = await query . getCount ( ) ;
222226 const results = await query . getMany ( ) ;
223227 const items = results . map ( ( res ) => {
224228 return res . toApiDBTransaction ( this . chainType , returnResponse ) ;
225229 } ) ;
226230
227- return new PaginatedList ( items , count , theLimit , theOffset ) ;
231+ return new PaginatedList ( items , theLimit , theOffset ) ;
228232 }
229233
230234 /**
231235 * Gets the confirmed transaction from the indexer database for a given transaction id (hash).
232236 * @param txHash
233237 * @returns
234238 */
235- public async getTransaction (
236- txHash : string ,
237- ) : Promise < ApiDBTransaction > {
239+ public async getTransaction ( txHash : string ) : Promise < ApiDBTransaction > {
238240 const query = this . joinTransactionQuery (
239241 this . manager
240242 . createQueryBuilder ( this . transactionTable , 'transaction' )
0 commit comments