Skip to content

Commit

Permalink
chore(suite): remove debugOnly property for FW checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemonexe committed Mar 4, 2025
1 parent eb12b74 commit bf93d9a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
8 changes: 1 addition & 7 deletions packages/suite/src/constants/suite/firmware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FilterPropertiesByType } from '@trezor/type-utils';
* see suite-native/device/src/config/firmware.ts for Suite Lite
*/

type BehaviorBaseType = { shouldReport: boolean; debugOnly?: boolean };
type BehaviorBaseType = { shouldReport: boolean };

// will be ignored completely
type SkippedBehavior = BehaviorBaseType & { type: 'skipped' };
Expand Down Expand Up @@ -45,9 +45,3 @@ export type SkippedHashCheckError = keyof FilterPropertiesByType<
export const isSkippedHashCheckError = (
error: FirmwareHashCheckError,
): error is SkippedHashCheckError => hashCheckErrorScenarios[error].type === 'skipped';

export const isDebugOnlyRevisionCheckError = (error: FirmwareRevisionCheckError): boolean =>
(revisionCheckErrorScenarios[error] as RevisionErrorBehavior).debugOnly ?? false;

export const isDebugOnlyHashCheckError = (error: FirmwareHashCheckError): boolean =>
(hashCheckErrorScenarios[error] as HashErrorBehavior).debugOnly ?? false;
10 changes: 0 additions & 10 deletions packages/suite/src/reducers/suite/suiteReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import type { Locale } from 'src/config/suite/languages';
import { ExperimentalFeature } from 'src/constants/suite/experimental';
import {
hashCheckErrorScenarios,
isDebugOnlyHashCheckError,
isDebugOnlyRevisionCheckError,
isSkippedHashCheckError,
revisionCheckErrorScenarios,
} from 'src/constants/suite/firmware';
Expand Down Expand Up @@ -531,10 +529,6 @@ export const selectFirmwareRevisionCheckErrorIfEnabled = (state: AppState) => {
const isDisabledByMessageSystem = selectIsFeatureDisabled(state, Feature.firmwareRevisionCheck);
if (isDisabledByMessageSystem) return null;

const isHiddenBehindDebug =
isDebugOnlyRevisionCheckError(revisionCheckError) && !selectIsDebugModeActive(state);
if (isHiddenBehindDebug) return null;

return revisionCheckError;
};

Expand Down Expand Up @@ -564,10 +558,6 @@ export const selectFirmwareHashCheckErrorIfEnabled = (state: AppState) => {
const isDisabledByMessageSystem = selectIsFeatureDisabled(state, Feature.firmwareHashCheck);
if (isDisabledByMessageSystem) return null;

const isHiddenBehindDebug =
isDebugOnlyHashCheckError(hashCheckError) && !selectIsDebugModeActive(state);
if (isHiddenBehindDebug) return null;

if (
hashCheckError === 'other-error' &&
selectIsFeatureDisabled(state, Feature.firmwareHashCheckOtherError)
Expand Down

0 comments on commit bf93d9a

Please sign in to comment.