From d07d6c914acddf00311b80404ffac022be7c92b7 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Thu, 26 Nov 2026 19:00:31 +0100 Subject: [PATCH 1/3] fix: show the jade not set up message Connecting a Jade with no wallet now throws JadeException.DeviceUninitialized, so the Found step shows the Jade text, as iOS does, instead of the generic hardware message. J1 opens Show details before it checks FROM, and the psbt journey mines a block every 20 sends and parses as XML. Verified: just compile, JadeRepoTest and HwErrorPresenterTest, just test, just lint --- app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt | 3 --- app/src/main/java/to/bitkit/repositories/JadeRepo.kt | 2 +- app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt | 2 +- changelog.d/next/2052.fixed.md | 1 + journeys/hardware-wallet/jade-connect-sign.xml | 2 +- journeys/hardware-wallet/jade-psbt-too-large.xml | 4 ++-- 6 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 changelog.d/next/2052.fixed.md diff --git a/app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt b/app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt index 0a6aac25a9..7912aed5e3 100644 --- a/app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt +++ b/app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt @@ -1545,9 +1545,6 @@ class HwReceiveAddressMismatchError(message: String) : AppError(message) /** The connected device holds another wallet than the one being signed from. */ class HwWalletMismatchError : AppError("A different hardware wallet is connected") -/** The device has no wallet yet; it has to be created or restored on the device itself. */ -class HwDeviceUninitializedError : AppError("Hardware device is not set up") - /** * A removal asked to keep the wallet's backup data, but its tags could not be read. Raised before * anything is deleted, so the wallet is untouched and the removal can be retried or repeated without diff --git a/app/src/main/java/to/bitkit/repositories/JadeRepo.kt b/app/src/main/java/to/bitkit/repositories/JadeRepo.kt index df0d147de8..c915028c5d 100644 --- a/app/src/main/java/to/bitkit/repositories/JadeRepo.kt +++ b/app/src/main/java/to/bitkit/repositories/JadeRepo.kt @@ -694,7 +694,7 @@ class JadeRepo @Inject constructor( } private fun rejectUnusableDevice(version: JadeVersionInfo, expected: KnownDevice?) { - if (version.jadeState == JadeState.UNINIT) rejectDevice(HwDeviceUninitializedError()) + if (version.jadeState == JadeState.UNINIT) rejectDevice(JadeException.DeviceUninitialized()) // A device that reports no efuse MAC cannot prove it is the paired one, so it fails closed. val expectedHardwareId = expected?.jadeDeviceId?.takeIf { it.isNotBlank() } if (expectedHardwareId != null && expectedHardwareId != version.efuseMac) { diff --git a/app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt b/app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt index 78a573ba78..b04fe8b0ac 100644 --- a/app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt +++ b/app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt @@ -157,7 +157,7 @@ class JadeRepoTest : BaseUnitTest() { val result = sut.connect(USB_PATH) - assertTrue(result.exceptionOrNull() is HwDeviceUninitializedError) + assertTrue(result.exceptionOrNull() is JadeException.DeviceUninitialized) verify(jadeService).disconnect() verify(jadeService, never()).unlock(any()) assertNull(sut.state.value.connected) diff --git a/changelog.d/next/2052.fixed.md b/changelog.d/next/2052.fixed.md new file mode 100644 index 0000000000..18665bb7ac --- /dev/null +++ b/changelog.d/next/2052.fixed.md @@ -0,0 +1 @@ +Fixed connecting a Jade with no wallet showing a generic message instead of how to set it up. diff --git a/journeys/hardware-wallet/jade-connect-sign.xml b/journeys/hardware-wallet/jade-connect-sign.xml index c04d70384d..951f4a6bea 100644 --- a/journeys/hardware-wallet/jade-connect-sign.xml +++ b/journeys/hardware-wallet/jade-connect-sign.xml @@ -36,7 +36,7 @@ Close the receive sheet. Tap Send (testTag "Send"), enter a regtest address of the bitkit-docker node manually, and on the amount screen select the Jade as the funding source (testTag "AssetButton-switch") - Enter an amount below the Jade's available balance, tap Continue (testTag "ContinueAmount"), verify the FROM field (testTag "SendConfirmAssetButton") shows the Jade, and swipe to confirm + Enter an amount below the Jade's available balance, tap Continue (testTag "ContinueAmount"), tap Show details (testTag "SendConfirmToggleDetails"), verify the FROM field (testTag "SendConfirmAssetButton") shows the Jade, and swipe to confirm Verify the hardware sign screen shows the amount (testTag "HardwareSendAmount"), the destination address (testTag "HardwareSendAddress") and a "Sign With Jade" button (testTag "HardwareSendOpenTrezorConnect"), then tap it diff --git a/journeys/hardware-wallet/jade-psbt-too-large.xml b/journeys/hardware-wallet/jade-psbt-too-large.xml index a2d8f52baa..4eeb70ef61 100644 --- a/journeys/hardware-wallet/jade-psbt-too-large.xml +++ b/journeys/hardware-wallet/jade-psbt-too-large.xml @@ -4,8 +4,8 @@ for a transaction too large to sign. Requires `./scripts/jade-emulator start` in `bitkit-docker`, a regtest debug build with the Jade emulator enabled (see the README) and a paired Jade. Settings, Advanced, Electrum Server must point at the `bitkit-docker` Electrum, - and the Jade's receive address must hold about 200 inputs: run - `for i in $(seq 200); do ./bitcoin-cli sendtoaddress 0.0002; done; ./bitcoin-cli -generate 1` + and the Jade's receive address must hold about 200 inputs: with `JADE_ADDRESS` set to it, run + `for i in $(seq 200); do ./bitcoin-cli sendtoaddress "$JADE_ADDRESS" 0.0002; if [ $((i % 20)) = 0 ]; then ./bitcoin-cli -generate 1; fi; done` in `bitkit-docker`. Over the client's 16 KiB PSBT limit, Bitkit refuses before the device sees the transaction. From 2ea193ff5f9646535d7ce89c99c0d12571348eb8 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Thu, 26 Nov 2026 21:58:51 +0100 Subject: [PATCH 2/3] chore: name the changelog fragment after its pr Verified: none (file rename only) --- changelog.d/next/{2052.fixed.md => 2144.fixed.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/next/{2052.fixed.md => 2144.fixed.md} (100%) diff --git a/changelog.d/next/2052.fixed.md b/changelog.d/next/2144.fixed.md similarity index 100% rename from changelog.d/next/2052.fixed.md rename to changelog.d/next/2144.fixed.md From 9e442d22c28fdbe3efcca83b403e25c0584c918b Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Fri, 27 Nov 2026 12:50:22 +0100 Subject: [PATCH 3/3] test: show send details before checking the trezor source On-chain send details start collapsed, so the FROM field only appears after Show details; the Trezor send journey now taps it, as J1 does, and the suite README lists the tag. Verified: xmllint on the journey --- journeys/hardware-wallet/README.md | 2 +- journeys/hardware-wallet/send-onchain.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/journeys/hardware-wallet/README.md b/journeys/hardware-wallet/README.md index 95cca5216d..4095e9404d 100644 --- a/journeys/hardware-wallet/README.md +++ b/journeys/hardware-wallet/README.md @@ -116,7 +116,7 @@ sign screen `HwTransferPassphraseSheet`, `HwTransferPassphraseInput`, `HwTransferPassphraseCancel`, `HwTransferPassphraseContinue`. Send and receive testTags: `Send`, `RecipientManual`, `RecipientInput`, `AddressContinue`, -`send_amount_screen`, `AssetButton-switch`, `ContinueAmount`, `SendConfirmAssetButton`, +`send_amount_screen`, `AssetButton-switch`, `ContinueAmount`, `SendConfirmToggleDetails`, `SendConfirmAssetButton`, `HardwareSendAmount`, `HardwareSendAddress`, `HardwareSendOpenTrezorConnect`, `SendSuccess`, `Receive`, `ReceiveScreen`, `QRCode`, `ReceiveHardwareAddress`, and `HardwareVerifyAddress`. diff --git a/journeys/hardware-wallet/send-onchain.xml b/journeys/hardware-wallet/send-onchain.xml index c5050afb8b..875e0e6c0b 100644 --- a/journeys/hardware-wallet/send-onchain.xml +++ b/journeys/hardware-wallet/send-onchain.xml @@ -36,8 +36,8 @@ start transaction preparation again while the confirmation is being prepared - Verify the Send review screen opens and the FROM field (testTag "SendConfirmAssetButton") - shows the paired Trezor name + Verify the Send review screen opens, tap Show details (testTag "SendConfirmToggleDetails") and + verify the FROM field (testTag "SendConfirmAssetButton") shows the paired Trezor name Swipe to confirm the payment