Skip to content

Commit 35161cf

Browse files
PankraSergDenis LyazginarvifoxDeneathCre-eD
authored
release_2.0.4(58) (#528)
* asset list sort * relay chains only polkadot and kusama by id * override java var to v11 * asset list sort * relay chains only polkadot and kusama by id * asset list sort * fix tests * fix icon for asset * remove unused icons * 1455: Statemine/Statemint parachains support * FLW-1439 Add manually nodes switching for multi-assets, remove some old nodes logic * FLW-1486 opens the main screen after switching to a node * FLW-1485 fix settings UI * FLW-1439 #422 pull request fixes * FLW-1489 fixed settings details wrong flow * FLW-1489 fixed wrong icons in wallets list * 1453 Moonriver/Moonbeam parachains support * 1475 fix asset details chain badge * FLW-1490 fix wrong balance on settings screen * 1145: account export * 1145: account export 1492, 1493 various fixes fix password field obfuscaion true by default fix json export UI: buttons order fix soft keyboard overlap input fields mnemonic export finish * FLW-1498 accounts migration on new ethereum derivation path * FLW-1480 fix quick inputs calculation * 1483 fix partial Incomplete translation of the RU version of the app * 1474: fix When switching between wallets, assets list centered on the first asset from the previous wallet * FLW-1497 fix wrong fee in some cases on staking reward * 1145 export and 1439 change node: merge info popups * Change acala genesis hash in old logic * fix crash in options caused by parachain chainId change * fix metadata update error * Fix empty mnemonic bug * hide ethereum export json and seed options * updates_for_release * update json urls * release version up -> 2.0.1 (52) * gradle build updates (ide update) * sort account in wallet * FLW-1491 Replace account avatar stub on new avatar * 1476: subscan and polkascan rework * 1533: Update asset details screen, some UI/UX refinements * 1545: Network management and node switching * 1558: Setup fiddler for QA * FLW-1148 extract network badge to custom view * FLW-1148 add manage assets screen * 1556: new develop icons * 1556: subquery reward param fix; remove alerts for errors on balance details * 1451: Kintsugi/Interlay parachains support * 1533: Add "Copy address" * 1569 Fix chain wo nodes crash * 1588: Fix transfer on Kintsugi parachain * 1588: Fix transfer on Kintsugi parachain * FLW-1590 fix manage assets sorting * FLW-1512 fix import from seed and json for ethereum * FLW-1512 add export for eth-based accounts * FLW-1600 fix address sharing * 1555_Wallet_Export_various_flows (#465) * 1555 Wallet Export various flows * PR fixes: add isEthereum param to export options generation; add use case comment * fix export options logic * update publish library version; update build gradle version * FLW-1601 fix create/import string resources, add derivation path field for ethereum * 1483 update RU translations * FLW-1601 new create/import flow * FLW-1615 import/export bug fixes * 1602: import chain account * FLW-1609 add eth options for export * fix welcome strings * Fix export issues after merge conflicts * 1608 fix Can't hide some assets from the list * assets migration fix * 1571 validators suggested by algorithm * 1404 hide crowdloan from active when cap is nearer then minContribution * 1638_various_fixes (#478) * 1638 Add an extra account to a wallet. Hide "Name" field * 1614 Wallet/Account Export/Import UI bugs * 1593 fix Switch node. There is no text on button * 1565 fix There is no keyboard when the button "Create a new wallet" is pressed * FLW-1636 add derivation path validations * FLW-1636 add derivation path validation for import * Separate json export by eth/substrate * update chains url; version up -> 2.0.2 (53); gradle build tools up; * fix chain assets show in lists * Add export JSON to file * fix chain assets show in lists update * hotfix kusama update removed MaxNominators const * 1568 Confirm mnemonic screen no error alert * fix chain asset balance * fix backmerge * 1670 fix Continue button doesn't react while Staking * FLW-1657 add different fiat currencies * FLW-1667 fix advanced block for import * Add current selected currency indicator * 1655 skeletons * 1655 connection indicator * FLW-1690 fix currency symbol bug * 1689_1693_fixes (#507) * 1689 increase skeletons blinking duration to 3 seconds * 1693 change update handling logic for rates update * FLW-1694 fix arab symbol bug * Set up Google play publishing (#509) Signed-off-by: Dmitriy Creed <[email protected]> * 1689, 1695 skeleton issues * FLW-1697 add minimum stake alert * 1689, 1695 skeleton issues * fix 1705 staking alert logic * interlay parachain fix * feature/FLW-1688 systematic solution (#516) * 1688 reset background session * 1688 wip: minSupportedVersion chains.json * FLW-1688 complete drop inactive session in foreground, minSupportedVersion for chains, remote config * 1688 add foreground app lock * 1688 remove GetAppVersion dependencies * 1688 fix overlapping pin call on background/foreground * FLW-1688 move session drop to ViewModel Co-authored-by: Sergey Pankratov <[email protected]> Co-authored-by: Denis Lyazgin <[email protected]> * new types format; change json urls * FLW-1710 comment out sorting logic while update * 1704 fix staking crashes * 1706 hide ethereum chain when no account specified * 1688 min version check logic * 1688 fix chain min version check logic * version up -> 2.0.4 (56) * fix crash in staking: your validators * fix crash in kusama crowdloans Co-authored-by: Denis Lyazgin <[email protected]> Co-authored-by: arvifox <[email protected]> Co-authored-by: Deneath <[email protected]> Co-authored-by: Dmitriy Creed <[email protected]>
1 parent 79d86b7 commit 35161cf

File tree

10 files changed

+22
-24
lines changed

10 files changed

+22
-24
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
ext {
33
// App version
44
versionName = '2.0.4'
5-
versionCode = 57
5+
versionCode = 58
66

77
// SDK and tools
88
compileSdkVersion = 31
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding
2+
3+
import java.math.BigInteger
4+
5+
typealias FundIndex = BigInteger

feature-crowdloan-api/src/main/java/jp/co/soramitsu/feature_crowdloan_api/data/network/blockhain/binding/FundInfo.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FundInfo(
2222
val end: BigInteger,
2323
val cap: BigInteger,
2424
val verifier: Any?,
25-
val trieIndex: TrieIndex,
25+
val fundIndex: FundIndex,
2626
val paraId: ParaId,
2727
val bidderAccountId: AccountId
2828
)
@@ -42,7 +42,10 @@ fun bindFundInfo(scale: String, runtime: RuntimeSnapshot, paraId: ParaId): FundI
4242
firstSlot = bindNumber(dynamicInstance["firstPeriod"] ?: dynamicInstance["firstSlot"]),
4343
lastSlot = bindNumber(dynamicInstance["lastPeriod"] ?: dynamicInstance["lastSlot"]),
4444
verifier = dynamicInstance["verifier"],
45-
trieIndex = bindTrieIndex(dynamicInstance["trieIndex"]),
45+
fundIndex = when {
46+
dynamicInstance.get<BigInteger>("fundIndex") != null -> bindNumber(dynamicInstance["fundIndex"])
47+
else -> bindNumber(dynamicInstance["trieIndex"])
48+
},
4649
bidderAccountId = createBidderAccountId(runtime, paraId),
4750
paraId = paraId
4851
)

feature-crowdloan-api/src/main/java/jp/co/soramitsu/feature_crowdloan_api/data/network/blockhain/binding/TrieIndex.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

feature-crowdloan-api/src/main/java/jp/co/soramitsu/feature_crowdloan_api/data/repository/CrowdloanRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package jp.co.soramitsu.feature_crowdloan_api.data.repository
22

33
import jp.co.soramitsu.fearless_utils.runtime.AccountId
44
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.Contribution
5+
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.FundIndex
56
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.FundInfo
67
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.ParaId
7-
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.TrieIndex
88
import jp.co.soramitsu.runtime.multiNetwork.chain.model.Chain
99
import jp.co.soramitsu.runtime.multiNetwork.chain.model.ChainId
1010
import kotlinx.coroutines.flow.Flow
@@ -22,7 +22,7 @@ interface CrowdloanRepository {
2222

2323
suspend fun getParachainMetadata(chain: Chain): Map<ParaId, ParachainMetadata>
2424

25-
suspend fun getContribution(chainId: ChainId, accountId: AccountId, paraId: ParaId, trieIndex: TrieIndex): Contribution?
25+
suspend fun getContribution(chainId: ChainId, accountId: AccountId, paraId: ParaId, fundIndex: FundIndex): Contribution?
2626

2727
suspend fun blocksPerLeasePeriod(chainId: ChainId): BigInteger
2828

feature-crowdloan-api/src/main/java/jp/co/soramitsu/feature_crowdloan_api/data/repository/CrowdloanRepositoryExt.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package jp.co.soramitsu.feature_crowdloan_api.data.repository
22

33
import jp.co.soramitsu.fearless_utils.runtime.AccountId
44
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.Contribution
5+
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.FundIndex
56
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.FundInfo
67
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.ParaId
7-
import jp.co.soramitsu.feature_crowdloan_api.data.network.blockhain.binding.TrieIndex
88
import jp.co.soramitsu.runtime.multiNetwork.chain.model.ChainId
99
import kotlinx.coroutines.Dispatchers
1010
import kotlinx.coroutines.async
@@ -14,10 +14,10 @@ import kotlinx.coroutines.withContext
1414
suspend fun CrowdloanRepository.getContributions(
1515
chainId: ChainId,
1616
accountId: AccountId,
17-
keys: Map<ParaId, TrieIndex>
17+
keys: Map<ParaId, FundIndex>
1818
): Map<ParaId, Contribution?> = withContext(Dispatchers.Default) {
19-
keys.map { (paraId, trieIndex) ->
20-
async { paraId to getContribution(chainId, accountId, paraId, trieIndex) }
19+
keys.map { (paraId, fundIndex) ->
20+
async { paraId to getContribution(chainId, accountId, paraId, fundIndex) }
2121
}
2222
.awaitAll()
2323
.toMap()

feature-crowdloan-impl/src/main/java/jp/co/soramitsu/feature_crowdloan_impl/data/repository/CrowdloanRepositoryImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ class CrowdloanRepositoryImpl(
112112
chainId: ChainId,
113113
accountId: AccountId,
114114
paraId: ParaId,
115-
trieIndex: BigInteger
115+
fundIndex: BigInteger
116116
): Contribution? {
117117
return remoteStorage.queryChildState(
118118
storageKeyBuilder = { it.typeRegistry["0"]!!.bytes(it, accountId).toHexString(withPrefix = true) },
119119
childKeyBuilder = {
120-
val suffix = (CONTRIBUTIONS_CHILD_SUFFIX.encodeToByteArray() + u32.toByteArray(it, trieIndex))
120+
val suffix = (CONTRIBUTIONS_CHILD_SUFFIX.encodeToByteArray() + u32.toByteArray(it, fundIndex))
121121
.blake2b256()
122122

123123
write(suffix)

feature-crowdloan-impl/src/main/java/jp/co/soramitsu/feature_crowdloan_impl/domain/contribute/CrowdloanContributeInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CrowdloanContributeInteractor(
6464
crowdloanRepository.fundInfoFlow(chain.id, parachainId),
6565
chainStateRepository.currentBlockNumberFlow(chain.id)
6666
) { fundInfo, blockNumber ->
67-
val contribution = crowdloanRepository.getContribution(chain.id, accountId, parachainId, fundInfo.trieIndex)
67+
val contribution = crowdloanRepository.getContribution(chain.id, accountId, parachainId, fundInfo.fundIndex)
6868
val hasWonAuction = crowdloanRepository.hasWonAuction(chain.id, fundInfo)
6969
val minContribution = crowdloanRepository.minContribution(chain.id)
7070

feature-crowdloan-impl/src/main/java/jp/co/soramitsu/feature_crowdloan_impl/domain/contribute/custom/moonbeam/MoonbeamContributeInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MoonbeamContributeInteractor(
4444
suspend fun getContributionSignature(apiUrl: String, apiKey: String, contribution: BigInteger, paraId: ParaId, chainId: ChainId): String {
4545
val accountId = accountRepository.getSelectedAccount(chainId).accountId
4646
val fundInfo = crowdloanRepository.fundInfoFlow(chainId, paraId).first()
47-
val prevContribution = crowdloanRepository.getContribution(chainId, accountId, paraId, fundInfo.trieIndex)
47+
val prevContribution = crowdloanRepository.getContribution(chainId, accountId, paraId, fundInfo.fundIndex)
4848
val randomGuid = ByteArray(10) { (0..20).random().toByte() }.toHexString(false)
4949
val response = runCatching {
5050
moonbeamApi.makeSignature(

feature-crowdloan-impl/src/main/java/jp/co/soramitsu/feature_crowdloan_impl/domain/main/CrowdloanInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CrowdloanInteractor(
8181
val withBlockUpdates = chainStateRepository.currentBlockNumberFlow(chainId).map { currentBlockNumber ->
8282
val fundInfos = crowdloanRepository.allFundInfos(chainId)
8383

84-
val contributionKeys = fundInfos.mapValues { (_, fundInfo) -> fundInfo.trieIndex }
84+
val contributionKeys = fundInfos.mapValues { (_, fundInfo) -> fundInfo.fundIndex }
8585

8686
val contributions = crowdloanRepository.getContributions(chainId, accountId, contributionKeys)
8787
val winnerInfo = crowdloanRepository.getWinnerInfo(chainId, fundInfos)

0 commit comments

Comments
 (0)