Merge pull request #222 from zcash/hotfix/repair-restore-and-create

Hotfix/repair restore and create
This commit is contained in:
Kevin Gorham 2020-12-20 11:10:13 -05:00 committed by GitHub
commit 8d315dae66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 4 deletions

View File

@ -1,6 +1,11 @@
Change Log
==========
Version 1.0.0-alpha43 *(2020-12-20)*
------------------------------------
- Fix: Repaired the upgrade flow, which could not reorg because of missing birthday height
- Fix: Repaired create wallet flow which was being covered by the loading screen
Version 1.0.0-alpha42 *(2020-12-19)*
------------------------------------
- Fix: Correct race condition when launching the app

View File

@ -61,9 +61,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
// interact with user to create, backup and verify seed
// leads to a call to startSync(), later (after accounts are created from seed)
twig("Previous wallet not found, therefore, launching seed creation flow")
mainActivity?.setLoading(false)
mainActivity?.safeNavigate(R.id.action_nav_home_to_create_wallet)
} else {
twig("Previous wallet found. Re-opening it.")
mainActivity?.setLoading(true)
mainActivity?.startSync(walletSetup.openStoredWallet())
twig("Done reopening wallet.")
}

View File

@ -33,6 +33,7 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.lang.RuntimeException
class BackupFragment : BaseFragment<FragmentBackupBinding>() {
override val screen = Report.Screen.BACKUP
@ -131,7 +132,7 @@ class BackupFragment : BaseFragment<FragmentBackupBinding>() {
mainActivity!!.feedback.measure(SEED_PHRASE_LOADED) {
val lockBox = LockBox(ZcashWalletApp.instance)
val mnemonics = Mnemonics()
val seedPhrase = lockBox.getCharsUtf8(Const.Backup.SEED_PHRASE)!!
val seedPhrase = lockBox.getCharsUtf8(Const.Backup.SEED_PHRASE) ?: throw RuntimeException("Seed Phrase expected but not found in storage!!")
val result = mnemonics.toWordList(seedPhrase)
result
}

View File

@ -10,6 +10,7 @@ import cash.z.ecc.android.feedback.Report
import cash.z.ecc.android.lockbox.LockBox
import cash.z.ecc.android.sdk.Initializer
import cash.z.ecc.android.sdk.exception.InitializerException
import cash.z.ecc.android.sdk.ext.ZcashSdk
import cash.z.ecc.android.sdk.ext.twig
import cash.z.ecc.android.sdk.tool.DerivationTool
import cash.z.ecc.android.sdk.tool.WalletBirthdayTool
@ -140,7 +141,8 @@ class WalletSetupViewModel @Inject constructor() : ViewModel() {
}
private fun onMissingBirthday(): Int = failWith(InitializerException.MissingBirthdayException) {
loadNearestBirthday().height
twig("Recover Birthday: falling back to sapling birthday")
loadNearestBirthday(ZcashSdk.SAPLING_ACTIVATION_HEIGHT).height
}
private fun loadNearestBirthday(birthdayHeight: Int? = null) =

View File

@ -9,8 +9,8 @@ object Deps {
const val buildToolsVersion = "29.0.2"
const val minSdkVersion = 21
const val targetSdkVersion = 29
const val versionName = "1.0.0-alpha42"
const val versionCode = 1_00_00_142 // last digits are alpha(0XX) beta(2XX) rc(4XX) release(8XX). Ex: 1_08_04_401 is an release candidate build of version 1.8.4 and 1_08_04_800 would be the final release.
const val versionName = "1.0.0-alpha43"
const val versionCode = 1_00_00_143 // last digits are alpha(0XX) beta(2XX) rc(4XX) release(8XX). Ex: 1_08_04_401 is an release candidate build of version 1.8.4 and 1_08_04_800 would be the final release.
const val packageName = "cash.z.ecc.android"