Skip to content

Commit 89559ac

Browse files
authored
Merge pull request #1149 from soramitsu/staging
staging
2 parents f20e08e + 831f446 commit 89559ac

File tree

61 files changed

+639
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+639
-274
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ apply plugin: "org.sonarqube"
55
buildscript {
66
ext {
77
// App version
8-
versionName = '3.4.3'
9-
versionCode = 168
8+
versionName = '3.4.4'
9+
versionCode = 172
1010

1111
// SDK and tools
1212
compileSdkVersion = 34
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package jp.co.soramitsu.core.model
22

3-
class StorageEntry(
3+
data class StorageEntry(
44
val storageKey: String,
55
val content: String?
66
)

core-api/src/main/java/jp/co/soramitsu/core/updater/Updater.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ interface UpdateScope {
1818
fun invalidationFlow(): Flow<Any>
1919
}
2020

21-
object GlobalScope : UpdateScope {
21+
object GlobalUpdaterScope : UpdateScope {
2222

2323
override fun invalidationFlow() = flowOf(Unit)
2424
}
2525

2626
interface GlobalScopeUpdater : Updater {
2727

2828
override val scope
29-
get() = GlobalScope
29+
get() = GlobalUpdaterScope
3030
}
3131

3232
interface Updater : SideEffectScope {

core-db/src/main/java/jp/co/soramitsu/coredb/AppDatabase.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import jp.co.soramitsu.coredb.migrations.Migration_59_60
6666
import jp.co.soramitsu.coredb.migrations.Migration_60_61
6767
import jp.co.soramitsu.coredb.migrations.Migration_61_62
6868
import jp.co.soramitsu.coredb.migrations.Migration_62_63
69+
import jp.co.soramitsu.coredb.migrations.Migration_63_64
6970
import jp.co.soramitsu.coredb.migrations.RemoveAccountForeignKeyFromAsset_17_18
7071
import jp.co.soramitsu.coredb.migrations.RemoveLegacyData_35_36
7172
import jp.co.soramitsu.coredb.migrations.RemoveStakingRewardsTable_22_23
@@ -91,7 +92,7 @@ import jp.co.soramitsu.coredb.model.chain.FavoriteChainLocal
9192
import jp.co.soramitsu.coredb.model.chain.MetaAccountLocal
9293

9394
@Database(
94-
version = 63,
95+
version = 64,
9596
entities = [
9697
AccountLocal::class,
9798
AddressBookContact::class,
@@ -175,6 +176,7 @@ abstract class AppDatabase : RoomDatabase() {
175176
.addMigrations(Migration_60_61)
176177
.addMigrations(Migration_61_62)
177178
.addMigrations(Migration_62_63)
179+
.addMigrations(Migration_63_64)
178180
.build()
179181
}
180182
return instance!!

core-db/src/main/java/jp/co/soramitsu/coredb/migrations/Migrations.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ package jp.co.soramitsu.coredb.migrations
33
import androidx.room.migration.Migration
44
import androidx.sqlite.db.SupportSQLiteDatabase
55

6+
val Migration_63_64 = object : Migration(63, 64) {
7+
override fun migrate(db: SupportSQLiteDatabase) {
8+
db.execSQL("ALTER TABLE chains ADD COLUMN `isUsesAppId` INTEGER NOT NULL DEFAULT 0")
9+
}
10+
}
11+
612
val Migration_62_63 = object : Migration(62, 63) {
713
override fun migrate(db: SupportSQLiteDatabase) {
814
db.execSQL("ALTER TABLE assets ADD COLUMN `status` TEXT NULL")

core-db/src/main/java/jp/co/soramitsu/coredb/model/chain/ChainLocal.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class ChainLocal(
2222
val supportStakingPool: Boolean,
2323
val isEthereumChain: Boolean,
2424
val isChainlinkProvider: Boolean,
25-
val supportNft: Boolean
25+
val supportNft: Boolean,
26+
val isUsesAppId: Boolean
2627
) {
2728

2829
class ExternalApi(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class CrowdloanContributeInteractor(
139139
}
140140

141141
return runCatching {
142-
walletRepository.performTransfer(accountId, chain, transfer, fee, null, additional, batchAll)
142+
walletRepository.performTransfer(accountId, chain, transfer, fee, null, null, additional, batchAll)
143143
}
144144
}
145145

feature-staking-api/src/main/java/jp/co/soramitsu/staking/api/data/StakingSharedState.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ class StakingSharedState(
8585
val assetWithChain: Flow<SingleAssetSharedState.AssetWithChain> = selectionItem.map {
8686
val (chain, asset) = chainRegistry.chainWithAsset(it.chainId, it.chainAssetId)
8787
SingleAssetSharedState.AssetWithChain(chain, asset)
88-
}.shareIn(scope, SharingStarted.Eagerly, replay = 1)
88+
}
89+
.distinctUntilChanged()
90+
.shareIn(scope, SharingStarted.Eagerly, replay = 1)
8991

9092
suspend fun assetWithChain(selectionItem: StakingAssetSelection) {
9193
val (chain, asset) = chainRegistry.chainWithAsset(
@@ -112,7 +114,7 @@ class StakingSharedState(
112114
chainAsset = chainAsset,
113115
minSupportedVersion = chain.minSupportedVersion
114116
)
115-
}.shareIn(scope, SharingStarted.Eagerly, replay = 1)
117+
}.distinctUntilChanged().shareIn(scope, SharingStarted.Eagerly, replay = 1)
116118

117119
suspend fun availableAssetsToSelect(): List<Asset> {
118120
val metaAccount = accountRepository.getSelectedMetaAccount()

feature-staking-api/src/main/java/jp/co/soramitsu/staking/api/domain/model/Exposure.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ package jp.co.soramitsu.staking.api.domain.model
22

33
import java.math.BigInteger
44

5-
class IndividualExposure(val who: ByteArray, val value: BigInteger)
5+
interface ValidatorExposure {
6+
val nominatorCount: Int
7+
val total: BigInteger
8+
val own: BigInteger
9+
}
610

7-
class Exposure(val total: BigInteger, val own: BigInteger, val others: List<IndividualExposure>)
11+
class LegacyExposure(
12+
override val total: BigInteger, override val own: BigInteger, val others: List<IndividualExposure>
13+
): ValidatorExposure{
14+
override val nominatorCount: Int = others.size
15+
}
16+
17+
class Exposure(override val total: BigInteger, override val own: BigInteger, override val nominatorCount: Int, val pageCount: BigInteger): ValidatorExposure
18+
data class ExposurePage(val pageTotal: BigInteger, val others: List<IndividualExposure>)
19+
20+
class IndividualExposure(val who: ByteArray, val value: BigInteger)

feature-staking-api/src/main/java/jp/co/soramitsu/staking/api/domain/model/Validator.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,20 @@ class RootIdentity(
2727
override val pgpFingerprint: String?,
2828
override val image: String?,
2929
override val twitter: String?
30-
) : Identity
30+
) : Identity {
31+
companion object {
32+
fun empty() = RootIdentity(
33+
display = null,
34+
legal = null,
35+
web = null,
36+
riot = null,
37+
email = null,
38+
pgpFingerprint = null,
39+
image = null,
40+
twitter = null
41+
)
42+
}
43+
}
3144

3245
class ChildIdentity(
3346
childName: String?,
@@ -37,7 +50,7 @@ class ChildIdentity(
3750
override val display: String = "${parentIdentity.display} / ${childName.orEmpty()}"
3851
}
3952

40-
class SuperOf(
53+
data class SuperOf(
4154
val parentIdHex: String,
4255
val childName: String?
4356
)

0 commit comments

Comments
 (0)