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
7 changes: 7 additions & 0 deletions api/firmware/bitboxsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ func TestSimulatorBitBoxSyncIdentity(t *testing.T) {
}

identity, err := device.BitBoxSyncIdentity()
// BitBoxSync is an optional firmware feature; disabled requests return ErrDisabled.
if isErrorCode(err, ErrDisabled) {
t.Skip("BitBoxSync is disabled in this simulator build")
}
require.NoError(t, err)
require.Len(t, identity.AuthPublicKey, ed25519.PublicKeySize)
require.Len(t, identity.WrapPublicKey, bitBoxSyncWrapPublicKeyLen)
Expand All @@ -229,6 +233,9 @@ func TestSimulatorBitBoxSyncSignaturesAndUnwrap(t *testing.T) {
}

identity, err := device.BitBoxSyncIdentity()
if isErrorCode(err, ErrDisabled) {
t.Skip("BitBoxSync is disabled in this simulator build")
}
require.NoError(t, err)
keyID := protocol.KeyIDFromAuthPublicKey(identity.AuthPublicKey)
wrapPublicKey := bitBoxSyncWrapPublicKey(t, identity)
Expand Down
3 changes: 1 addition & 2 deletions api/firmware/btc_transaction_vectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const (
btcTransactionTestVectorsFilename = "testdata/btc-transaction-test-vectors.json"
btcVectorStdoutStableFor = 50 * time.Millisecond
btcVectorStdoutTimeout = 5 * time.Second
btcVectorDeviceErrorDisabled = 106
)

type btcTestVectorOutcome string
Expand Down Expand Up @@ -700,7 +699,7 @@ func assertBTCVectorSetupOutcome(
require.Error(t, err)
clientUnsupported := err.Error() == UnsupportedError(*expectation.UnsupportedVersion).Error()
deviceUnsupported := isErrorCode(err, ErrInvalidInput) ||
isErrorCode(err, btcVectorDeviceErrorDisabled)
isErrorCode(err, ErrDisabled)
require.Truef(
t,
clientUnsupported || deviceUnsupported,
Expand Down
3 changes: 3 additions & 0 deletions api/firmware/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const (

// ErrUserAbort is returned when the user aborts an action on the device.
ErrUserAbort = 104

// ErrDisabled is returned when a function is disabled in the device firmware.
ErrDisabled = 106
)

// Error wraps an error from bitbox02.
Expand Down
Loading