diff --git a/build.gradle b/build.gradle index dbc2b4ab91..eccb9eea26 100644 --- a/build.gradle +++ b/build.gradle @@ -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" diff --git a/common/src/main/java/io/novafoundation/nova/common/utils/FearlessLibExt.kt b/common/src/main/java/io/novafoundation/nova/common/utils/FearlessLibExt.kt index 375ac5df11..667303896e 100644 --- a/common/src/main/java/io/novafoundation/nova/common/utils/FearlessLibExt.kt +++ b/common/src/main/java/io/novafoundation/nova/common/utils/FearlessLibExt.kt @@ -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) diff --git a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/repository/consensus/AuraSession.kt b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/repository/consensus/AuraSession.kt index 95f3fd8ea2..b3c0ca141f 100644 --- a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/repository/consensus/AuraSession.kt +++ b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/repository/consensus/AuraSession.kt @@ -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 @@ -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() }