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/2144.fixed.md b/changelog.d/next/2144.fixed.md new file mode 100644 index 0000000000..18665bb7ac --- /dev/null +++ b/changelog.d/next/2144.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/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/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. 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