Skip to content

Commit

Permalink
Update min. valid FFI version to 1.0.0-rc.5 (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanilcenko authored Feb 29, 2024
1 parent b8efdca commit 10cdb6a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ android {
buildConfigField("String", "YAT_ORGANIZATION_RETURN_URL", "\"${yatProperties.getProperty("yat.returnUrl")}\"")
def dropboxProperties = loadDropboxProps()
buildConfigField("String", "DROPBOX_ACCESS_TOKEN", "\"${dropboxProperties.getProperty("dropbox_key")}\"")
buildConfigField("String", "LIB_WALLET_MIN_VALID_VERSION", "\"$libwalletMinValidVersion\"")
}

flavorDimensions.add("privacy-mode")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tari.android.wallet.application

import androidx.lifecycle.viewModelScope
import com.tari.android.wallet.BuildConfig
import com.tari.android.wallet.ui.common.SimpleViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand All @@ -11,13 +12,12 @@ import javax.inject.Singleton
@Singleton
class MigrationManager @Inject constructor(private val manager: WalletManager) {

private val minValidVersion = DefaultArtifactVersion("v0.52.0")
private val simpleViewModel = SimpleViewModel()

fun validateVersion(onValid: () -> Unit, onError: () -> Unit) {
val walletVersion = getCurrentWalletVersion()

if (walletVersion.isEmpty() || DefaultArtifactVersion(walletVersion) < minValidVersion) {
if (walletVersion.isEmpty() || DefaultArtifactVersion(walletVersion) < DefaultArtifactVersion(BuildConfig.LIB_WALLET_MIN_VALID_VERSION)) {
simpleViewModel.viewModelScope.launch(Dispatchers.Main) { onError() }
} else {
simpleViewModel.viewModelScope.launch(Dispatchers.Main) { onValid() }
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {
// JNI libs
ext.libwalletHostURL = "https://github.com/tari-project/tari/releases/download/"
ext.libwalletVersion = "v1.0.0-rc.5"
ext.libwalletMinValidVersion = "v1.0.0-rc.5"
ext.libwalletx64A = "libminotari_wallet_ffi.android_x86_64.a"
ext.libwalletArmA = "libminotari_wallet_ffi.android_aarch64.a"
ext.libwalletHeader = "libminotari_wallet_ffi.h"
Expand Down

0 comments on commit 10cdb6a

Please sign in to comment.