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
3 changes: 0 additions & 3 deletions app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/to/bitkit/repositories/JadeRepo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/test/java/to/bitkit/repositories/JadeRepoTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/next/2144.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed connecting a Jade with no wallet showing a generic message instead of how to set it up.
2 changes: 1 addition & 1 deletion journeys/hardware-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion journeys/hardware-wallet/jade-connect-sign.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
</action>
<action>
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
</action>
<action>
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
Expand Down
4 changes: 2 additions & 2 deletions journeys/hardware-wallet/jade-psbt-too-large.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <jade address> 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.
</description>
Expand Down
4 changes: 2 additions & 2 deletions journeys/hardware-wallet/send-onchain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
start transaction preparation again while the confirmation is being prepared
</action>
<action>
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
</action>
<action>
Swipe to confirm the payment
Expand Down