Skip to content

Commit 8360d40

Browse files
authored
Merge pull request #1137 from soramitsu/staging
staging
2 parents dd2afd7 + 97a51f9 commit 8360d40

File tree

19 files changed

+411
-344
lines changed

19 files changed

+411
-344
lines changed

app/src/main/java/jp/co/soramitsu/app/root/presentation/RootViewModel.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ class RootViewModel @Inject constructor(
174174
}
175175

176176
fun onNetworkAvailable() {
177-
viewModelScope.launch {
178-
checkAppVersion()
179-
}
177+
// todo this code triggers redundant requests and balance updates. Needs research
178+
// viewModelScope.launch {
179+
// checkAppVersion()
180+
// }
180181
}
181182

182183
private fun observeWalletConnectEvents() {

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.1'
9-
versionCode = 163
8+
versionName = '3.4.2'
9+
versionCode = 166
1010

1111
// SDK and tools
1212
compileSdkVersion = 34

common/src/main/java/jp/co/soramitsu/common/data/network/runtime/binding/AccountInfo.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class EqAccountInfo(
5353
) : AssetBalanceData
5454

5555
class AssetsAccountInfo(
56-
val balance: BigInteger
56+
val balance: BigInteger,
57+
val status: String?
5758
) : AssetBalanceData
5859

5960
class SimpleBalanceData(val balance: BigInteger) : AssetBalanceData
@@ -120,7 +121,8 @@ fun bindAssetsAccountInfo(scale: String, runtime: RuntimeSnapshot): AssetsAccoun
120121

121122
return dynamicInstance?.let {
122123
AssetsAccountInfo(
123-
balance = bindNumber(dynamicInstance["balance"])
124+
balance = bindNumber(dynamicInstance["balance"]),
125+
status = dynamicInstance.get<DictEnum.Entry<*>>("status")?.name
124126
)
125127
}
126128
}

common/src/main/java/jp/co/soramitsu/common/validation/Exceptions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class TransferToTheSameAddressException(resourceManager: ResourceManager) : Vali
4949
null
5050
)
5151

52-
class DeadRecipientException(resourceManager: ResourceManager) : ValidationException(
52+
class DeadRecipientException(resourceManager: ResourceManager, resultAmount: String, edAmount: String, topUpAmount: String) : ValidationException(
5353
resourceManager.getString(R.string.common_amount_low),
54-
resourceManager.getString(R.string.wallet_send_dead_recipient_message)
54+
resourceManager.getString(R.string.wallet_send_dead_recipient_message_v2, resultAmount, edAmount, topUpAmount)
5555
)
5656

5757
class InsufficientStakeBalanceException(resourceManager: ResourceManager) : ValidationException(

common/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@
11121112
<string name="wallet_send_balance_minimal">Minimal balance</string>
11131113
<string name="wallet_send_confirm_transfer">Confirm transfer</string>
11141114
<string name="wallet_send_dead_recipient_message">Your transfer will fail since the final amount on the destination account will be less than the minimal balance. Please try to increase the amount.</string>
1115+
<string name="wallet_send_dead_recipient_message_v2">Your transfer will fail since the final amount (%s) on the destination account will be less than the minimal balance (%s). Please increase the amount by %s</string>
11151116
<string name="wallet_send_eth_dead_recipient_message">Insufficient Ethereum balance in the recipient\'s account prevents the completion of ERC20 token transfer. Please ensure the receiver has enough Ethereum to proceed with the transfer.</string>
11161117
<string name="wallet_send_existential_warning_message">Your transfer will remove the account from blockstore since it will make the total balance lower than the minimal balance.</string>
11171118
<string name="wallet_send_existential_warning_title">The transfer will remove the account</string>

core-db/src/androidTest/java/jp/co/soramitsu/coredb/dao/MetaAccountDaoTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ class MetaAccountDaoTest : DaoTest<MetaAccountDao>(AppDatabase::metaAccountDao)
7979
isSelected = false,
8080
substrateAccountId = byteArrayOf(),
8181
ethereumAddress = null,
82-
position = 0
82+
position = 0,
83+
googleBackupAddress = null,
84+
isBackedUp = false
8385
)
8486

8587
private fun chainAccount(metaId: Long) = ChainAccountLocal(

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
@@ -65,6 +65,7 @@ import jp.co.soramitsu.coredb.migrations.Migration_58_59
6565
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
68+
import jp.co.soramitsu.coredb.migrations.Migration_62_63
6869
import jp.co.soramitsu.coredb.migrations.RemoveAccountForeignKeyFromAsset_17_18
6970
import jp.co.soramitsu.coredb.migrations.RemoveLegacyData_35_36
7071
import jp.co.soramitsu.coredb.migrations.RemoveStakingRewardsTable_22_23
@@ -90,7 +91,7 @@ import jp.co.soramitsu.coredb.model.chain.FavoriteChainLocal
9091
import jp.co.soramitsu.coredb.model.chain.MetaAccountLocal
9192

9293
@Database(
93-
version = 62,
94+
version = 63,
9495
entities = [
9596
AccountLocal::class,
9697
AddressBookContact::class,
@@ -173,6 +174,7 @@ abstract class AppDatabase : RoomDatabase() {
173174
.addMigrations(Migration_59_60)
174175
.addMigrations(Migration_60_61)
175176
.addMigrations(Migration_61_62)
177+
.addMigrations(Migration_62_63)
176178
.build()
177179
}
178180
return instance!!

0 commit comments

Comments
 (0)