@@ -53,7 +53,6 @@ import org.jetbrains.exposed.sql.deleteWhere
53
53
import org.jetbrains.exposed.sql.insertIgnore
54
54
import org.jetbrains.exposed.sql.jodatime.DateColumnType
55
55
import org.jetbrains.exposed.sql.jodatime.datetime
56
- import org.jetbrains.exposed.sql.leftJoin
57
56
import org.jetbrains.exposed.sql.select
58
57
import org.jetbrains.exposed.sql.selectAll
59
58
import org.jetbrains.exposed.sql.sum
@@ -205,24 +204,6 @@ class BlockProposerRecord(id: EntityID<Int>) : IntEntity(id) {
205
204
it.getBigDecimal(" avg_block_creation_time" )
206
205
}.firstOrNull() ? : BigDecimal .ZERO
207
206
}
208
-
209
- fun findMissingRecords (min : Int , max : Int , limit : Int ) = transaction {
210
- BlockCacheTable
211
- .leftJoin(BlockProposerTable , { BlockCacheTable .height }, { BlockProposerTable .blockHeight })
212
- .slice(BlockCacheTable .columns)
213
- .select { (BlockProposerTable .blockHeight.isNull()) and (BlockCacheTable .height.between(min, max)) }
214
- .orderBy(BlockCacheTable .height, SortOrder .ASC )
215
- .limit(limit)
216
- .let { BlockCacheRecord .wrapRows(it).toSet() }
217
- }
218
-
219
- fun getRecordsForProposer (address : String , limit : Int ) = transaction {
220
- BlockProposerRecord .find {
221
- (BlockProposerTable .proposerOperatorAddress eq address)
222
- }.orderBy(Pair (BlockProposerTable .blockHeight, SortOrder .DESC ))
223
- .limit(limit)
224
- .toList()
225
- }
226
207
}
227
208
228
209
var blockHeight by BlockProposerTable .blockHeight
@@ -233,8 +214,6 @@ class BlockProposerRecord(id: EntityID<Int>) : IntEntity(id) {
233
214
object MissedBlocksTable : IntIdTable(name = " missed_blocks" ) {
234
215
val blockHeight = integer(" block_height" )
235
216
val valConsAddr = varchar(" val_cons_address" , 128 )
236
- val runningCount = integer(" running_count" )
237
- val totalCount = integer(" total_count" )
238
217
}
239
218
240
219
class MissedBlocksRecord (id : EntityID <Int >) : IntEntity(id) {
@@ -271,17 +250,12 @@ class MissedBlocksRecord(id: EntityID<Int>) : IntEntity(id) {
271
250
MissedBlocksTable .insertIgnore {
272
251
it[this .blockHeight] = height
273
252
it[this .valConsAddr] = valconsAddr
274
- // TODO: remove these column from database See: https://github.com/provenance-io/explorer-service/issues/549
275
- it[this .runningCount] = - 1
276
- it[this .totalCount] = - 1
277
253
}
278
254
}
279
255
}
280
256
281
257
var blockHeight by MissedBlocksTable .blockHeight
282
258
var valConsAddr by MissedBlocksTable .valConsAddr
283
- var runningCount by MissedBlocksTable .runningCount
284
- var totalCount by MissedBlocksTable .totalCount
285
259
}
286
260
287
261
object BlockCacheHourlyTxCountsTable : IdTable<DateTime>(name = " block_cache_hourly_tx_counts" ) {
0 commit comments