Skip to content

Commit

Permalink
Merge pull request #1139 from soramitsu/staging
Browse files Browse the repository at this point in the history
staging
  • Loading branch information
PankraSerg authored Mar 27, 2024
2 parents c00e08f + 44b1e3a commit 8f307d0
Show file tree
Hide file tree
Showing 29 changed files with 446 additions and 430 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ class RootViewModel @Inject constructor(
}

fun onNetworkAvailable() {
viewModelScope.launch {
checkAppVersion()
}
// todo this code triggers redundant requests and balance updates. Needs research
// viewModelScope.launch {
// checkAppVersion()
// }
}

private fun observeWalletConnectEvents() {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ apply plugin: "org.sonarqube"
buildscript {
ext {
// App version
versionName = '3.4.1'
versionCode = 163
versionName = '3.4.2'
versionCode = 167

// SDK and tools
compileSdkVersion = 34
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class EqAccountInfo(
) : AssetBalanceData

class AssetsAccountInfo(
val balance: BigInteger
val balance: BigInteger,
val status: String?
) : AssetBalanceData

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

return dynamicInstance?.let {
AssetsAccountInfo(
balance = bindNumber(dynamicInstance["balance"])
balance = bindNumber(dynamicInstance["balance"]),
status = dynamicInstance.get<DictEnum.Entry<*>>("status")?.name
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import jp.co.soramitsu.common.utils.formatting.FullPrecisionFormatter
import jp.co.soramitsu.common.utils.formatting.NumberAbbreviation
import java.math.BigDecimal
import java.math.RoundingMode
import java.text.DateFormat
import java.text.DecimalFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.concurrent.TimeUnit
import jp.co.soramitsu.common.utils.formatting.FiatSmallFormatter

Expand Down Expand Up @@ -103,7 +103,7 @@ fun Long.formatDateTime(context: Context) = DateUtils.getRelativeDateTimeString(

fun Long.formatDateTime(): String = SimpleDateFormat.getDateInstance().format(Date(this))

fun Long.formatTime(): String = DateFormat.getTimeInstance(DateFormat.MEDIUM).format(Date(this))
fun Long.formatTime(): String = SimpleDateFormat("HH:mm", Locale.getDefault()).format(Date(this))

fun decimalFormatterFor(pattern: String) = DecimalFormat(pattern).apply {
roundingMode = RoundingMode.FLOOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class TransferToTheSameAddressException(resourceManager: ResourceManager) : Vali
null
)

class DeadRecipientException(resourceManager: ResourceManager) : ValidationException(
class DeadRecipientException(resourceManager: ResourceManager, resultAmount: String, edAmount: String, topUpAmount: String) : ValidationException(
resourceManager.getString(R.string.common_amount_low),
resourceManager.getString(R.string.wallet_send_dead_recipient_message)
resourceManager.getString(R.string.wallet_send_dead_recipient_message_v2, resultAmount, edAmount, topUpAmount)
)

class InsufficientStakeBalanceException(resourceManager: ResourceManager) : ValidationException(
Expand Down
1 change: 1 addition & 0 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@
<string name="wallet_send_balance_minimal">Minimal balance</string>
<string name="wallet_send_confirm_transfer">Confirm transfer</string>
<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>
<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>
<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>
<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>
<string name="wallet_send_existential_warning_title">The transfer will remove the account</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ fun chainOf(
isEthereumChain = false,
paraId = null,
rank = null,
isChainlinkProvider = false
isChainlinkProvider = false,
supportNft = false
)

fun ChainLocal.nodeOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class MetaAccountDaoTest : DaoTest<MetaAccountDao>(AppDatabase::metaAccountDao)
isSelected = false,
substrateAccountId = byteArrayOf(),
ethereumAddress = null,
position = 0
position = 0,
googleBackupAddress = null,
isBackedUp = false
)

private fun chainAccount(metaId: Long) = ChainAccountLocal(
Expand Down
4 changes: 3 additions & 1 deletion core-db/src/main/java/jp/co/soramitsu/coredb/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import jp.co.soramitsu.coredb.migrations.Migration_58_59
import jp.co.soramitsu.coredb.migrations.Migration_59_60
import jp.co.soramitsu.coredb.migrations.Migration_60_61
import jp.co.soramitsu.coredb.migrations.Migration_61_62
import jp.co.soramitsu.coredb.migrations.Migration_62_63
import jp.co.soramitsu.coredb.migrations.RemoveAccountForeignKeyFromAsset_17_18
import jp.co.soramitsu.coredb.migrations.RemoveLegacyData_35_36
import jp.co.soramitsu.coredb.migrations.RemoveStakingRewardsTable_22_23
Expand All @@ -90,7 +91,7 @@ import jp.co.soramitsu.coredb.model.chain.FavoriteChainLocal
import jp.co.soramitsu.coredb.model.chain.MetaAccountLocal

@Database(
version = 62,
version = 63,
entities = [
AccountLocal::class,
AddressBookContact::class,
Expand Down Expand Up @@ -173,6 +174,7 @@ abstract class AppDatabase : RoomDatabase() {
.addMigrations(Migration_59_60)
.addMigrations(Migration_60_61)
.addMigrations(Migration_61_62)
.addMigrations(Migration_62_63)
.build()
}
return instance!!
Expand Down
Loading

0 comments on commit 8f307d0

Please sign in to comment.