Skip to content

Commit c19725f

Browse files
authored
Merge pull request #718 from soramitsu/staging
staging
2 parents 1132031 + a866f45 commit c19725f

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ android {
3939
}
4040
staging {
4141
initWith debug
42+
signingConfig signingConfigs.ci
4243
matchingFallbacks = ['debug']
4344
versionNameSuffix '-staging'
4445
applicationIdSuffix '.staging'

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
buildscript {
22
ext {
33
// App version
4-
versionName = '2.0.11'
5-
versionCode = 72
4+
versionName = '2.0.12'
5+
versionCode = 73
66

77
// SDK and tools
88
compileSdkVersion = 31

feature-staking-impl/src/main/java/jp/co/soramitsu/feature_staking_impl/di/StakingUpdatersModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class StakingUpdatersModule {
303303
accountValidatorPrefsUpdater,
304304
accountNominationsUpdater,
305305
rewardDestinationUpdater,
306-
historyDepthUpdater,
306+
// historyDepthUpdater,
307307
historicalUpdateMediator,
308308
accountControllerBalanceUpdater,
309309
minBondUpdater,

feature-staking-impl/src/main/java/jp/co/soramitsu/feature_staking_impl/scenarios/relaychain/StakingRelayChainScenarioRepository.kt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,32 @@ class StakingRelayChainScenarioRepository(
136136
chainId = chainId
137137
)
138138

139-
suspend fun getHistoryDepth(chainId: ChainId): BigInteger = localStorage.queryNonNull(
139+
suspend fun getHistoryDepth(chainId: ChainId): BigInteger {
140+
return try {
141+
// for runtime version < 9290
142+
remoteStorage.queryNonNull(
143+
keyBuilder = { it.metadata.staking().storage("HistoryDepth").storageKey() },
144+
binding = ::bindHistoryDepth,
145+
chainId = chainId
146+
)
147+
} catch (e: NoSuchElementException) {
148+
// for runtime version >= 9290
149+
getHistoryDepthFromConstants(chainId)
150+
}
151+
}
152+
153+
@Deprecated("Will be removed in runtime version 9290")
154+
suspend fun getHistoryDepthFromStorage(chainId: ChainId): BigInteger = localStorage.queryNonNull(
140155
keyBuilder = { it.metadata.staking().storage("HistoryDepth").storageKey() },
141156
binding = ::bindHistoryDepth,
142157
chainId = chainId
143158
)
144159

160+
suspend fun getHistoryDepthFromConstants(chainId: ChainId): BigInteger {
161+
val runtime = runtimeFor(chainId)
162+
return runtime.metadata.staking().numberConstant("HistoryDepth", runtime)
163+
}
164+
145165
fun observeActiveEraIndex(chainId: String): Flow<BigInteger> {
146166
return localStorage.observeNonNull(
147167
chainId = chainId,

0 commit comments

Comments
 (0)