File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
feature-staking-impl/src/main/java/jp/co/soramitsu/feature_staking_impl Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change 11buildscript {
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
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ class StakingUpdatersModule {
303303 accountValidatorPrefsUpdater,
304304 accountNominationsUpdater,
305305 rewardDestinationUpdater,
306- historyDepthUpdater,
306+ // historyDepthUpdater,
307307 historicalUpdateMediator,
308308 accountControllerBalanceUpdater,
309309 minBondUpdater,
Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments