diff --git a/app/src/test/java/to/bitkit/repositories/HwWalletRepoTest.kt b/app/src/test/java/to/bitkit/repositories/HwWalletRepoTest.kt index a376c99855..7866ab8acc 100644 --- a/app/src/test/java/to/bitkit/repositories/HwWalletRepoTest.kt +++ b/app/src/test/java/to/bitkit/repositories/HwWalletRepoTest.kt @@ -2,6 +2,7 @@ package to.bitkit.repositories import com.synonym.bitkitcore.AccountType import com.synonym.bitkitcore.Activity +import com.synonym.bitkitcore.AddressInfo import com.synonym.bitkitcore.ComposeOutput import com.synonym.bitkitcore.ComposeResult import com.synonym.bitkitcore.OnchainActivity @@ -187,6 +188,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 850_000u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -312,6 +314,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) watcherEvents.emit( @@ -321,6 +324,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.TAPROOT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -345,6 +349,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 2u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -366,6 +371,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) watcherEvents.emit( @@ -376,6 +382,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.TAPROOT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -407,6 +414,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) watcherEvents.emit( @@ -419,6 +427,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -444,6 +453,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) watcherEvents.emit( @@ -456,6 +466,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.TAPROOT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -484,6 +495,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) val firstTimestamp = (sut.wallets.value.single().activities.single() as Activity.Onchain).v1.timestamp @@ -496,6 +508,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 2u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) val refreshedTimestamp = (sut.wallets.value.single().activities.single() as Activity.Onchain).v1.timestamp @@ -667,6 +680,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -684,6 +698,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 2u, blockHeight = 2u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -710,6 +725,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 2u, blockHeight = 3u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -783,6 +799,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -793,6 +810,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.TAPROOT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -805,6 +823,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 2u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -816,6 +835,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 2u, accountType = AccountType.TAPROOT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -840,6 +860,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) watcherEvents.emit( @@ -852,6 +873,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 2u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -888,6 +910,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 1u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -1356,6 +1379,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) runCurrent() @@ -1452,6 +1476,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = 0u, blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) ) @@ -2004,6 +2029,12 @@ class HwWalletRepoTest : BaseUnitTest() { total = total, ) + private fun unusedAddress() = AddressInfo( + address = "bc1qtestunused", + path = "m/84'/0'/0'/0/0", + transfers = 0u, + ) + private fun transactionsChanged( total: ULong, activities: List = emptyList(), @@ -2014,6 +2045,7 @@ class HwWalletRepoTest : BaseUnitTest() { txCount = activities.size.toUInt(), blockHeight = 1u, accountType = AccountType.NATIVE_SEGWIT, + nextUnusedExternalAddress = unusedAddress(), ) @Suppress("LongParameterList") diff --git a/app/src/test/java/to/bitkit/ui/screens/trezor/TrezorViewModelTest.kt b/app/src/test/java/to/bitkit/ui/screens/trezor/TrezorViewModelTest.kt index fa1bd073a7..b386cd5d81 100644 --- a/app/src/test/java/to/bitkit/ui/screens/trezor/TrezorViewModelTest.kt +++ b/app/src/test/java/to/bitkit/ui/screens/trezor/TrezorViewModelTest.kt @@ -1,5 +1,6 @@ package to.bitkit.ui.screens.trezor +import com.synonym.bitkitcore.AddressInfo import com.synonym.bitkitcore.TrezorSignedTx import com.synonym.bitkitcore.WatcherEvent import kotlinx.coroutines.CompletableDeferred @@ -412,6 +413,7 @@ class TrezorViewModelTest : BaseUnitTest() { txCount = 3u, blockHeight = 850_000u, accountType = TrezorPreviewData.sampleTransactionHistoryResult.accountType, + nextUnusedExternalAddress = unusedAddress(), ), ) advanceUntilIdle() @@ -440,6 +442,7 @@ class TrezorViewModelTest : BaseUnitTest() { txCount = 3u, blockHeight = 850_000u, accountType = TrezorPreviewData.sampleTransactionHistoryResult.accountType, + nextUnusedExternalAddress = unusedAddress(), ), ) advanceUntilIdle() @@ -496,6 +499,12 @@ class TrezorViewModelTest : BaseUnitTest() { // endregion + private fun unusedAddress() = AddressInfo( + address = "bc1qtestunused", + path = "m/84'/0'/0'/0/0", + transfers = 0u, + ) + private fun createViewModel() = TrezorViewModel( bgDispatcher = testDispatcher, trezorRepo = trezorRepo, diff --git a/changelog.d/next/1223.fixed.md b/changelog.d/next/1223.fixed.md new file mode 100644 index 0000000000..4833ea3b32 --- /dev/null +++ b/changelog.d/next/1223.fixed.md @@ -0,0 +1 @@ +The app no longer aborts when stopping the Lightning node, and 32-bit devices can open the wallet again. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f25a4babeb..17cbb15651 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,7 +21,7 @@ activity-compose = { module = "androidx.activity:activity-compose", version = "1 appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.1" } barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version = "17.3.0" } biometric = { module = "androidx.biometric:biometric", version = "1.4.0-alpha05" } -bitkit-core = { module = "com.synonym:bitkit-core-android", version = "0.5.5" } +bitkit-core = { module = "com.synonym:bitkit-core-android", version = "0.5.14" } paykit = { module = "com.synonym:paykit-android", version = "0.1.0-rc46" } bouncycastle-provider-jdk = { module = "org.bouncycastle:bcprov-jdk18on", version = "1.83" } camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "camera" } @@ -64,7 +64,7 @@ ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" } ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } -ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.63" } +ldk-node-android = { module = "com.synonym:ldk-node-android", version = "0.7.0-rc.66" } lifecycle-process = { group = "androidx.lifecycle", name = "lifecycle-process", version.ref = "lifecycle" } lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" } lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }