Skip to content

Commit

Permalink
Merge pull request #1041 from novasamatech/rc/6.7.2
Browse files Browse the repository at this point in the history
Rc/6.7.2
  • Loading branch information
valentunn authored Jul 27, 2023
2 parents dfe4932 + 54c9c9d commit 9da3778
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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 = '6.7.1'
versionCode = 84
versionName = '6.7.2'
versionCode = 85

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ fun RuntimeMetadata.uniques() = module(Modules.UNIQUES)
fun RuntimeMetadata.babe() = module(Modules.BABE)
fun RuntimeMetadata.elections() = module(Modules.ELECTIONS)

fun RuntimeMetadata.electionsOrNull() = moduleOrNull(Modules.ELECTIONS)

fun RuntimeMetadata.committeeManagementOrNull() = moduleOrNull("CommitteeManagement")

fun RuntimeMetadata.babeOrNull() = moduleOrNull(Modules.BABE)

fun RuntimeMetadata.timestampOrNull() = moduleOrNull(Modules.TIMESTAMP)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.novafoundation.nova.feature_staking_impl.data.repository.consensus

import io.novafoundation.nova.common.data.network.runtime.binding.bindNumber
import io.novafoundation.nova.common.utils.elections
import io.novafoundation.nova.common.utils.committeeManagementOrNull
import io.novafoundation.nova.common.utils.electionsOrNull
import io.novafoundation.nova.common.utils.numberConstantOrNull
import io.novafoundation.nova.common.utils.system
import io.novafoundation.nova.runtime.multiNetwork.ChainRegistry
Expand All @@ -22,7 +23,8 @@ class AuraSession(
override suspend fun sessionLength(chainId: ChainId): BigInteger {
val runtime = runtimeFor(chainId)

return runtime.metadata.elections().numberConstantOrNull("SessionPeriod", runtime)
return runtime.metadata.electionsOrNull()?.numberConstantOrNull("SessionPeriod", runtime)
?: runtime.metadata.committeeManagementOrNull()?.numberConstantOrNull("SessionPeriod", runtime)
?: SESSION_PERIOD_DEFAULT.toBigInteger()
}

Expand Down

0 comments on commit 9da3778

Please sign in to comment.