Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions app/src/test/java/to/bitkit/repositories/HwWalletRepoTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -187,6 +188,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 850_000u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -312,6 +314,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
watcherEvents.emit(
Expand All @@ -321,6 +324,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.TAPROOT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand All @@ -345,6 +349,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 2u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand All @@ -366,6 +371,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
watcherEvents.emit(
Expand All @@ -376,6 +382,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.TAPROOT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -407,6 +414,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
watcherEvents.emit(
Expand All @@ -419,6 +427,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand All @@ -444,6 +453,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
watcherEvents.emit(
Expand All @@ -456,6 +466,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.TAPROOT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -667,6 +680,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -684,6 +698,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 2u,
blockHeight = 2u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -710,6 +725,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 2u,
blockHeight = 3u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand Down Expand Up @@ -783,6 +799,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -793,6 +810,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.TAPROOT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -805,6 +823,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 2u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -816,6 +835,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 2u,
accountType = AccountType.TAPROOT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand All @@ -840,6 +860,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
watcherEvents.emit(
Expand All @@ -852,6 +873,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 2u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -888,6 +910,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 1u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -1356,6 +1379,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)
runCurrent()
Expand Down Expand Up @@ -1452,6 +1476,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = 0u,
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)
)

Expand Down Expand Up @@ -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<Activity> = emptyList(),
Expand All @@ -2014,6 +2045,7 @@ class HwWalletRepoTest : BaseUnitTest() {
txCount = activities.size.toUInt(),
blockHeight = 1u,
accountType = AccountType.NATIVE_SEGWIT,
nextUnusedExternalAddress = unusedAddress(),
)

@Suppress("LongParameterList")
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -412,6 +413,7 @@ class TrezorViewModelTest : BaseUnitTest() {
txCount = 3u,
blockHeight = 850_000u,
accountType = TrezorPreviewData.sampleTransactionHistoryResult.accountType,
nextUnusedExternalAddress = unusedAddress(),
),
)
advanceUntilIdle()
Expand Down Expand Up @@ -440,6 +442,7 @@ class TrezorViewModelTest : BaseUnitTest() {
txCount = 3u,
blockHeight = 850_000u,
accountType = TrezorPreviewData.sampleTransactionHistoryResult.accountType,
nextUnusedExternalAddress = unusedAddress(),
),
)
advanceUntilIdle()
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions changelog.d/next/1223.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The app no longer aborts when stopping the Lightning node, and 32-bit devices can open the wallet again.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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" }
Expand Down
Loading