Skip to content

Commit

Permalink
Merge pull request #1619 from novasamatech/hotfix/8.3.1
Browse files Browse the repository at this point in the history
Hotfix/8.3.1
  • Loading branch information
antonijzelinskij authored Aug 2, 2024
2 parents 9a9cb8e + 40ab262 commit 92740d2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
// App version
versionName = '8.3.0'
versionCode = 148
versionName = '8.3.1'
versionCode = 150

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,28 @@ class Gov2DelegationsRepository(
recentVotesBlockThreshold: BlockNumber,
chain: Chain
): List<DelegateStats> {
val externalApiLink = chain.externalApi<GovernanceDelegations>()?.url ?: return emptyList()
val request = DelegateStatsRequest(recentVotesBlockThreshold)
val response = delegationsSubqueryApi.getDelegateStats(externalApiLink, request)
val delegateStats = response.data.delegates.nodes
return runCatching {
val externalApiLink = chain.externalApi<GovernanceDelegations>()?.url ?: return emptyList()
val request = DelegateStatsRequest(recentVotesBlockThreshold)
val response = delegationsSubqueryApi.getDelegateStats(externalApiLink, request)
val delegateStats = response.data.delegates.nodes

return mapDelegateStats(delegateStats, chain)
mapDelegateStats(delegateStats, chain)
}.getOrNull()
.orEmpty()
}

override suspend fun getDelegatesStatsByAccountIds(recentVotesBlockThreshold: BlockNumber, accountIds: List<AccountId>, chain: Chain): List<DelegateStats> {
val externalApiLink = chain.externalApi<GovernanceDelegations>()?.url ?: return emptyList()
val addresses = accountIds.map { chain.addressOf(it) }
val request = DelegateStatsByAddressesRequest(recentVotesBlockThreshold, addresses = addresses)
val response = delegationsSubqueryApi.getDelegateStats(externalApiLink, request)
val delegateStats = response.data.delegates.nodes

return mapDelegateStats(delegateStats, chain)
return runCatching {
val externalApiLink = chain.externalApi<GovernanceDelegations>()?.url ?: return emptyList()
val addresses = accountIds.map { chain.addressOf(it) }
val request = DelegateStatsByAddressesRequest(recentVotesBlockThreshold, addresses = addresses)
val response = delegationsSubqueryApi.getDelegateStats(externalApiLink, request)
val delegateStats = response.data.delegates.nodes

mapDelegateStats(delegateStats, chain)
}.getOrNull()
.orEmpty()
}

override suspend fun getDetailedDelegateStats(
Expand Down

0 comments on commit 92740d2

Please sign in to comment.