diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/entities/ExplorerCache.kt b/service/src/main/kotlin/io/provenance/explorer/domain/entities/ExplorerCache.kt index fe6efe1d..b267bfd2 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/entities/ExplorerCache.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/entities/ExplorerCache.kt @@ -215,7 +215,7 @@ class ChainAumHourlyRecord(id: EntityID) : IntEntity(id) { fun getAumForPeriod(fromDate: DateTime, toDate: DateTime) = transaction { ChainAumHourlyRecord.find { (ChainAumHourlyTable.datetime greaterEq fromDate) and - (ChainAumHourlyTable.datetime lessEq toDate.plusDays(1)) + (ChainAumHourlyTable.datetime lessEq toDate.plusDays(1)) } .orderBy(Pair(ChainAumHourlyTable.datetime, SortOrder.ASC)) .toList() @@ -301,7 +301,7 @@ class ProcessQueueRecord(id: EntityID) : IntEntity(id) { fun findByType(processType: ProcessQueueType) = transaction { ProcessQueueRecord.find { (ProcessQueueTable.processType eq processType.name) and - (ProcessQueueTable.processing eq false) + (ProcessQueueTable.processing eq false) }.toList() } @@ -314,7 +314,7 @@ class ProcessQueueRecord(id: EntityID) : IntEntity(id) { fun delete(processType: ProcessQueueType, value: String) = transaction { ProcessQueueTable.deleteWhere { (ProcessQueueTable.processType eq processType.name) and - (ProcessQueueTable.processValue eq value) + (processValue eq value) } } diff --git a/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt b/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt index a3ea7d65..6d53627e 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/TokenService.kt @@ -69,7 +69,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { AccountRecord.saveAccount( it.ownerAddress, PROV_ACC_PREFIX, - accountClient.getAccountInfo(it.ownerAddress), + accountClient.getAccountInfo(it.ownerAddress) ) }.collect() TokenDistributionPaginatedResultsRecord.savePaginatedResults(records) @@ -95,7 +95,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { denom: String, page: Int, count: Int, - retryCount: Int = 3, + retryCount: Int = 3 ): PagedResults { var hasSucceeded = false var numberOfTriesRemaining = retryCount @@ -131,7 +131,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { Triple(50, 50, "51-100"), Triple(500, 100, "101-500"), Triple(500, 500, "501-1000"), - Triple("ALL", 1000, "1001-"), + Triple("ALL", 1000, "1001-") ).map { (limit, offset, range) -> val results = TokenDistributionPaginatedResultsRecord.findByLimitOffset(richListAccounts(), limit, offset) val denom = results[0].data.denom @@ -153,7 +153,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { circulatingSupply().toCoinStr(UTILITY_TOKEN), communityPoolSupply().toCoinStr(UTILITY_TOKEN), bonded, - burnedSupply().toCoinStr(UTILITY_TOKEN), + burnedSupply().toCoinStr(UTILITY_TOKEN) ) } @@ -216,7 +216,7 @@ class TokenService(private val accountClient: AccountGrpcClient) { RichAccount( it.ownerAddress, CoinStr(it.data.count, it.data.denom), - it.data.count.toPercentage(BigDecimal(100), totalSupply, 4), + it.data.count.toPercentage(BigDecimal(100), totalSupply, 4) ) } } diff --git a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt index d26c7558..62d20925 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt @@ -86,7 +86,6 @@ import java.time.OffsetDateTime import java.time.ZoneOffset import javax.annotation.PostConstruct - @Service class AsyncService( private val props: ExplorerProperties, @@ -325,17 +324,17 @@ class AsyncService( time_low = if (low != null) DateTime(low.trade_timestamp * 1000) else k, quote = mapOf( USD_UPPER to - CmcQuote( - open = open, - high = high?.price ?: prevPrice, - low = low?.price ?: prevPrice, - close = close, - volume = usdVolume, - market_cap = close.multiply( - tokenService.totalSupply().divide(UTILITY_TOKEN_BASE_MULTIPLIER) - ), - timestamp = closeDate - ) + CmcQuote( + open = open, + high = high?.price ?: prevPrice, + low = low?.price ?: prevPrice, + close = close, + volume = usdVolume, + market_cap = close.multiply( + tokenService.totalSupply().divide(UTILITY_TOKEN_BASE_MULTIPLIER) + ), + timestamp = closeDate + ) ) ).also { prevPrice = close } TokenHistoricalDailyRecord.save(record.time_open.startOfDay(), record)