Skip to content

Commit

Permalink
Merge pull request #1099 from soramitsu/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
Deneath authored Feb 14, 2024
2 parents c307b36 + b37ce6f commit cad8840
Show file tree
Hide file tree
Showing 94 changed files with 965 additions and 348 deletions.
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Job properties
def jobParams = [
booleanParam(defaultValue: false, description: 'push to the dev profile', name: 'prDeployment'),
booleanParam(defaultValue: false, description: 'Upload builds to nexus(master,develop and staging branches upload always)', name: 'upload_to_nexus'),
]

def pipeline = new org.android.AppPipeline(
Expand All @@ -17,6 +18,7 @@ def pipeline = new org.android.AppPipeline(
publishCmd: 'publishReleaseApk',
jobParams: jobParams,
appPushNoti: true,
dojoProductType: 'android'
dojoProductType: 'android',
uploadToNexusFor: ['master','develop','staging']
)
pipeline.runPipeline('fearless')
pipeline.runPipeline('fearless')
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ dependencies {

implementation lifeCycleKtxDep

// implementation retrofitDep
implementation gsonConvertedDep

implementation gifDep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import it.airgap.beaconsdk.blockchain.substrate.data.SubstrateSignerPayload
import java.math.BigDecimal
import jp.co.soramitsu.account.api.domain.model.ImportMode
import jp.co.soramitsu.account.api.presentation.account.create.ChainAccountCreatePayload
import jp.co.soramitsu.account.api.presentation.actions.AddAccountBottomSheet
import jp.co.soramitsu.account.api.presentation.actions.AddAccountPayload
import jp.co.soramitsu.account.api.presentation.create_backup_password.CreateBackupPasswordPayload
import jp.co.soramitsu.account.impl.domain.account.details.AccountInChain
import jp.co.soramitsu.account.impl.presentation.AccountRouter
Expand Down Expand Up @@ -1279,7 +1279,7 @@ class Navigator :
navController?.navigate(R.id.networkIssuesFragment)
}

override fun openOptionsAddAccount(payload: AddAccountBottomSheet.Payload) {
override fun openOptionsAddAccount(payload: AddAccountPayload) {
val bundle = OptionsAddAccountFragment.getBundle(payload)
navController?.navigate(R.id.optionsAddAccountFragment, bundle)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package jp.co.soramitsu.app.root.presentation.main

import android.os.Bundle
import android.view.View
import androidx.activity.OnBackPressedCallback
import androidx.fragment.app.viewModels
import androidx.navigation.NavController
Expand All @@ -25,7 +27,7 @@ class MainFragment : BaseFragment<MainViewModel>(R.layout.fragment_main) {
}
}

private val binding by viewBinding(FragmentMainBinding::bind)
private lateinit var binding: FragmentMainBinding

override val viewModel: MainViewModel by viewModels()

Expand All @@ -35,6 +37,11 @@ class MainFragment : BaseFragment<MainViewModel>(R.layout.fragment_main) {
backCallback.isEnabled = false
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
binding = FragmentMainBinding.bind(view)
super.onViewCreated(view, savedInstanceState)
}

override fun initViews() {
binding.bottomNavigationView.setOnApplyWindowInsetsListener { _, insets ->
// overwrite BottomNavigation behavior and ignore insets
Expand All @@ -60,7 +67,7 @@ class MainFragment : BaseFragment<MainViewModel>(R.layout.fragment_main) {

binding.bottomNavigationView.setupWithNavController(navController!!)

binding.bottomNavigationView.setOnNavigationItemSelectedListener { item ->
binding.bottomNavigationView.setOnItemSelectedListener { item ->
onNavDestinationSelected(item, navController!!)
}

Expand Down
8 changes: 4 additions & 4 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.2.2'
versionCode = 152
versionName = '3.3.1'
versionCode = 155

// SDK and tools
compileSdkVersion = 34
Expand Down Expand Up @@ -79,11 +79,11 @@ buildscript {
serializationVersion = '1.5.1'

activityKtx = '1.7.0'
fragmentKtx = '1.5.6'
fragmentKtx = '1.6.2'
minifyRelease = true
beaconVersion = "3.2.4"

sharedFeaturesVersion = "1.1.1.20-FLW"
sharedFeaturesVersion = "1.1.1.23-FLW"

coilDep = "io.coil-kt:coil:$coilVersion"
coilSvg = "io.coil-kt:coil-svg:$coilVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ private fun PreviewAssetListItem() {
chainAssetId = "",
isSupported = true,
isHidden = false,
priceId = null,
isTestnet = false
)
FearlessAppTheme {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ data class NetworkIssueItemState(

val chainId: String,
val chainName: String,
val assetId: String,
val priceId: String? = null
val assetId: String
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ private fun AssetItemSwipeBoxPreview() {
chainAssetId = "",
isSupported = true,
isHidden = false,
priceId = null,
isTestnet = false
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ data class AssetListItemViewState(
val chainAssetId: String,
val isSupported: Boolean,
val isHidden: Boolean,
val priceId: String?,
val isTestnet: Boolean
) {
val key = listOf(index ?: 0, chainAssetId, chainId, isHidden).joinToString()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package jp.co.soramitsu.common.data.network.subquery

import java.math.BigInteger

class ReefStakingRewardsResponse (
val stakingsConnection: ReefRewardsConnection
)

class SubsquidPageInfo(
val hasNextPage: Boolean,
val endCursor: String
)

class ReefRewardsConnection(
val edges: List<ReefRewardsEdge>,
val pageInfo: SubsquidPageInfo
)
class ReefRewardsEdge(
val node: ReefRewardsNode
)
class ReefRewardsNode(
val id: String,
val type: String,
val amount: BigInteger,
val timestamp: String,
val signer: ReefAddress
)

class ReefAddress(
val id: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import jp.co.soramitsu.common.resources.ResourceManager
import jp.co.soramitsu.shared_utils.wsrpc.SocketService
import jp.co.soramitsu.shared_utils.wsrpc.logging.Logger
import jp.co.soramitsu.shared_utils.wsrpc.recovery.Reconnector
import jp.co.soramitsu.shared_utils.wsrpc.request.CoroutinesRequestExecutor
import jp.co.soramitsu.shared_utils.wsrpc.request.RequestExecutor
import okhttp3.Cache
import okhttp3.OkHttpClient
Expand Down Expand Up @@ -93,7 +94,7 @@ class NetworkModule {

@Provides
@Singleton
fun provideRequestExecutor() = RequestExecutor()
fun provideRequestExecutor(): RequestExecutor = CoroutinesRequestExecutor()

@Provides
fun provideSocketService(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ private const val DEFAULT_SELECTED_FIAT = "usd"
class SelectedFiat(private val preferences: Preferences) {
fun flow() = preferences.stringFlow(SELECTED_FIAT_KEY) { get() }.filterNotNull()
fun get() = preferences.getString(SELECTED_FIAT_KEY, DEFAULT_SELECTED_FIAT)
fun isUsd() = get() == DEFAULT_SELECTED_FIAT

fun set(value: String) {
preferences.putString(SELECTED_FIAT_KEY, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ fun chainOf(
externalApi = null,
hasCrowdloans = false,
minSupportedVersion = "2.0.3",
supportStakingPool = false
supportStakingPool = false,
isEthereumChain = false,
paraId = null,
rank = null,
isChainlinkProvider = false
)

fun ChainLocal.nodeOf(
Expand All @@ -64,14 +68,16 @@ fun ChainLocal.assetOf(
priceId = null,
staking = "test",
icon = "",
priceProviders = null,
purchaseProviders = null,
symbol = symbol,
isUtility = null,
type = null,
currencyId = null,
existentialDeposit = null,
color = null,
isNative = null
isNative = null,
ethereumType = null,
priceProvider = null
)

suspend fun ChainDao.addChain(joinedChainInfo: JoinedChainInfo) {
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 @@ -63,6 +63,7 @@ import jp.co.soramitsu.coredb.migrations.Migration_56_57
import jp.co.soramitsu.coredb.migrations.Migration_57_58
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.RemoveAccountForeignKeyFromAsset_17_18
import jp.co.soramitsu.coredb.migrations.RemoveLegacyData_35_36
import jp.co.soramitsu.coredb.migrations.RemoveStakingRewardsTable_22_23
Expand All @@ -88,7 +89,7 @@ import jp.co.soramitsu.coredb.model.chain.FavoriteChainLocal
import jp.co.soramitsu.coredb.model.chain.MetaAccountLocal

@Database(
version = 60,
version = 61,
entities = [
AccountLocal::class,
AddressBookContact::class,
Expand Down Expand Up @@ -169,6 +170,7 @@ abstract class AppDatabase : RoomDatabase() {
.addMigrations(Migration_57_58)
.addMigrations(Migration_58_59)
.addMigrations(Migration_59_60)
.addMigrations(Migration_60_61)
.build()
}
return instance!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ abstract class TokenPriceDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract suspend fun insertTokenPrice(token: TokenPriceLocal)

@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract suspend fun insertTokensPrice(tokens: List<TokenPriceLocal>)

@Insert(onConflict = OnConflictStrategy.IGNORE)
abstract suspend fun insertTokenPriceOrIgnore(token: TokenPriceLocal)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@ package jp.co.soramitsu.coredb.migrations
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase

val Migration_60_61 = object : Migration(60, 61) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE chains ADD COLUMN `isChainlinkProvider` INTEGER NOT NULL DEFAULT 0")

database.execSQL("DROP TABLE IF EXISTS chain_assets")

database.execSQL(
"""
CREATE TABLE IF NOT EXISTS `chain_assets` (
`id` TEXT NOT NULL,
`name` TEXT,
`symbol` TEXT NOT NULL,
`chainId` TEXT NOT NULL,
`icon` TEXT NOT NULL,
`priceId` TEXT,
`staking` TEXT NOT NULL,
`precision` INTEGER NOT NULL,
`purchaseProviders` TEXT,
`isUtility` INTEGER,
`type` TEXT,
`currencyId` TEXT,
`existentialDeposit` TEXT,
`color` TEXT,
`isNative` INTEGER,
`ethereumType` TEXT DEFAULT NULL,
`priceProvider` TEXT,
PRIMARY KEY(`chainId`, `id`),
FOREIGN KEY(`chainId`) REFERENCES `chains`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )
""".trimIndent()
)
database.execSQL("CREATE INDEX IF NOT EXISTS `index_chain_assets_chainId` ON `chain_assets` (`chainId`)")
}
}

val Migration_59_60 = object : Migration(59, 60) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE chains ADD COLUMN `paraId` TEXT NULL")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ data class ChainAssetLocal(
val priceId: String?,
val staking: String,
val precision: Int,
val priceProviders: String?,
val purchaseProviders: String?,
val isUtility: Boolean?,
val type: String?,
val currencyId: String?,
val existentialDeposit: String?,
val color: String?,
val isNative: Boolean?,
val ethereumType: String?
val ethereumType: String?,
val priceProvider: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class ChainLocal(
val isTestNet: Boolean,
val hasCrowdloans: Boolean,
val supportStakingPool: Boolean,
val isEthereumChain: Boolean
val isEthereumChain: Boolean,
val isChainlinkProvider: Boolean
) {

class ExternalApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface AssetNotNeedAccountUseCase {
* Mark asset without account - as correct, no need of account
* used in lists sort
*/
suspend fun markNotNeed(chainId: ChainId, metaId: Long, assetId: String, priceId: String?)
suspend fun markChainAssetsNotNeed(chainId: ChainId, metaId: Long)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ fun MetaAccount.address(chain: Chain): String? {
}
}

fun LightMetaAccount.address(chain: Chain): String? {
return when {
chain.isEthereumBased -> ethereumAddress?.ethereumAddressToHex()
else -> substrateAccountId.toAddress(chain.addressPrefix.toShort())
}
}

fun MetaAccount.chainAddress(chain: Chain): String? {
return when {
hasChainAccount(chain.id) -> chain.addressOf(chainAccounts.getValue(chain.id).accountId)
Expand Down
Loading

0 comments on commit cad8840

Please sign in to comment.