diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index 033f8b5a9..1a13e777e 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -1428,7 +1428,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-safe-area-context (5.4.1): + - react-native-safe-area-context (5.5.1): - React-Core - react-native-sqlite-storage (6.0.1): - React-Core @@ -2185,7 +2185,7 @@ SPEC CHECKSUMS: react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 react-native-nfc-manager: a280ef94cd4871a471b052f0dc70381cf1223049 react-native-quick-crypto: c42da02f2832626ec0b8d8465f2f9b3889a317f6 - react-native-safe-area-context: dde2052b903c11d677c320b599c3244021c34ce8 + react-native-safe-area-context: 827032edf27079702cbd006f11dc79451a2d744b react-native-sqlite-storage: 0c84826214baaa498796c7e46a5ccc9a82e114ed React-nativeconfig: 31072ab0146e643594f6959c7f970a04b6c9ddd0 React-NativeModulesApple: 4ffcab4cdf34002540799bffbedd6466e8023c3a diff --git a/app/jest.config.cjs b/app/jest.config.cjs index 10a94da3b..c1da54246 100644 --- a/app/jest.config.cjs +++ b/app/jest.config.cjs @@ -2,11 +2,12 @@ module.exports = { preset: 'react-native', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], transformIgnorePatterns: [ - 'node_modules/(?!(react-native|@react-native|@react-navigation|@react-native-community|@segment/analytics-react-native|@openpassport|react-native-keychain|react-native-check-version|react-native-nfc-manager|react-native-passport-reader|react-native-gesture-handler|uuid|@stablelib|@react-native-google-signin|react-native-cloud-storage|@react-native-clipboard|@react-native-firebase|@sentry)/)', + 'node_modules/(?!(react-native|@react-native|@react-navigation|@react-native-community|@segment/analytics-react-native|@openpassport|react-native-keychain|react-native-check-version|react-native-nfc-manager|react-native-passport-reader|react-native-gesture-handler|uuid|@stablelib|@react-native-google-signin|react-native-cloud-storage|@react-native-clipboard|@react-native-firebase)/)', ], setupFiles: ['/jest.setup.js'], testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', moduleNameMapper: { '^@env$': '/tests/__setup__/@env.js', + '\\.svg$': '/tests/__setup__/svgMock.js', }, }; diff --git a/app/package.json b/app/package.json index 66343ff9c..d4e8ec292 100644 --- a/app/package.json +++ b/app/package.json @@ -105,7 +105,7 @@ "react-native-nfc-manager": "^3.15.1", "react-native-passport-reader": "^1.0.3", "react-native-quick-crypto": "^0.7.12", - "react-native-safe-area-context": "^5.2.0", + "react-native-safe-area-context": "^5.5.1", "react-native-screens": "4.9.0", "react-native-sqlite-storage": "^6.0.1", "react-native-svg": "^15.11.1", diff --git a/app/src/consts/analytics.ts b/app/src/consts/analytics.ts index a090cdd17..971ac30a5 100644 --- a/app/src/consts/analytics.ts +++ b/app/src/consts/analytics.ts @@ -61,7 +61,6 @@ export const ProofEvents = { PROOF_VERIFICATION_STARTED: 'Proof: Proof Verification Started', PROVING_PROCESS_ERROR: 'Proof: Proving Process Error', PROVING_STATE_CHANGE: 'Proof: Proving State Change', - PROVING_STORE_REINITIALIZED: 'Proof: Proving Store Re-initialized', REGISTER_COMPLETED: 'Proof: Register Completed', ALREADY_REGISTERED: 'Proof: Already Registered', QR_SCAN_CANCELLED: 'Proof: QR Scan Cancelled', diff --git a/app/src/hooks/useRecoveryPrompts.ts b/app/src/hooks/useRecoveryPrompts.ts index ba9a8a616..532813dde 100644 --- a/app/src/hooks/useRecoveryPrompts.ts +++ b/app/src/hooks/useRecoveryPrompts.ts @@ -7,6 +7,7 @@ import { usePassport } from '../providers/passportDataProvider'; import { useSettingStore } from '../stores/settingStore'; import { useModal } from './useModal'; +// TODO: need to debug and test the logic. it pops up too often. export default function useRecoveryPrompts() { const { loginCount, cloudBackupEnabled, hasViewedRecoveryPhrase } = useSettingStore(); @@ -49,9 +50,7 @@ export default function useRecoveryPrompts() { } } } - maybePrompt().catch(() => { - // Silently fail to avoid breaking the hook - }); + maybePrompt().catch(() => {}); }, [ loginCount, cloudBackupEnabled, diff --git a/app/src/screens/home/HomeScreen.tsx b/app/src/screens/home/HomeScreen.tsx index 67416e943..ff73b4f09 100644 --- a/app/src/screens/home/HomeScreen.tsx +++ b/app/src/screens/home/HomeScreen.tsx @@ -15,7 +15,6 @@ import { Caption } from '../../components/typography/Caption'; import { useAppUpdates } from '../../hooks/useAppUpdates'; import useConnectionModal from '../../hooks/useConnectionModal'; import useHapticNavigation from '../../hooks/useHapticNavigation'; -import useRecoveryPrompts from '../../hooks/useRecoveryPrompts'; import SelfCard from '../../images/card-style-1.svg'; import ScanIcon from '../../images/icons/qr_scan.svg'; import WarnIcon from '../../images/icons/warning.svg'; @@ -42,7 +41,6 @@ const ScanButton = styled(Button, { const HomeScreen: React.FC = () => { useConnectionModal(); - useRecoveryPrompts(); const navigation = useNavigation(); const { getAllDocuments } = usePassport(); const [isNewVersionAvailable, showAppUpdateModal, isModalDismissed] = diff --git a/app/src/screens/misc/LoadingScreen.tsx b/app/src/screens/misc/LoadingScreen.tsx index b351110fb..a62a97b7e 100644 --- a/app/src/screens/misc/LoadingScreen.tsx +++ b/app/src/screens/misc/LoadingScreen.tsx @@ -144,19 +144,10 @@ const LoadingScreen: React.FC = ({}) => { // Update UI if passport data is available if (passportData?.passportMetadata) { - // Get the current circuit type from the proving store - const circuitType = useProvingStore.getState().circuitType; - - // Determine the appropriate type for loading screen text - // 'disclose' circuit type should use 'register' timing, but 'dsc' should use 'dsc' timing - const loadingScreenType: 'dsc' | 'register' = - circuitType === 'dsc' ? 'dsc' : 'register'; - - // Update loading text based on current state and circuit type + // Update loading text based on current state const { actionText, estimatedTime } = getLoadingScreenText( currentState as ProvingStateType, passportData?.passportMetadata, - loadingScreenType, ); setLoadingText({ actionText, estimatedTime }); diff --git a/app/src/screens/prove/ConfirmBelongingScreen.tsx b/app/src/screens/prove/ConfirmBelongingScreen.tsx index d4524b9f0..fa84c1fdf 100644 --- a/app/src/screens/prove/ConfirmBelongingScreen.tsx +++ b/app/src/screens/prove/ConfirmBelongingScreen.tsx @@ -12,7 +12,6 @@ import { Title } from '../../components/typography/Title'; import { PassportEvents, ProofEvents } from '../../consts/analytics'; import useHapticNavigation from '../../hooks/useHapticNavigation'; import { ExpandableBottomLayout } from '../../layouts/ExpandableBottomLayout'; -import { captureException } from '../../Sentry'; import analytics from '../../utils/analytics'; import { black, white } from '../../utils/colors'; import { notificationSuccess } from '../../utils/haptic'; @@ -60,33 +59,6 @@ const ConfirmBelongingScreen: React.FC = ({}) => { // Mark as user confirmed - proving will start automatically when ready provingStore.setUserConfirmed(); - // Ensure proving store is initialized before navigation - if (provingStore.circuitType !== 'dsc') { - try { - console.error( - 'Re-initializing proving store with DSC circuit type before navigation', - ); - trackEvent(ProofEvents.PROVING_STORE_REINITIALIZED, { - reason: 'circuit_type_mismatch', - expected_type: 'dsc', - current_type: provingStore.circuitType, - }); - await provingStore.init('dsc', true); - } catch (error: any) { - console.error('Error during proving store re-initialization:', error); - captureException(error, { - context: 'proving_store_reinitialization', - circuit_type: 'dsc', - current_circuit_type: provingStore.circuitType, - }); - trackEvent(ProofEvents.PROVING_PROCESS_ERROR, { - error: error?.message || 'Unknown re-initialization error', - context: 'proving_store_reinitialization', - }); - throw error; // Re-throw to be handled by the outer try-catch - } - } - // Navigate to loading screen navigate(); } catch (error: any) { diff --git a/app/src/screens/recovery/RecoverWithPhraseScreen.tsx b/app/src/screens/recovery/RecoverWithPhraseScreen.tsx index 7cd209965..280982575 100644 --- a/app/src/screens/recovery/RecoverWithPhraseScreen.tsx +++ b/app/src/screens/recovery/RecoverWithPhraseScreen.tsx @@ -16,7 +16,6 @@ import { loadPassportDataAndSecret, reStorePassportDataWithRightCSCA, } from '../../providers/passportDataProvider'; -import { useSettingStore } from '../../stores/settingStore'; import analytics from '../../utils/analytics'; import { black, @@ -82,7 +81,6 @@ const RecoverWithPhraseScreen: React.FC< setRestoring(false); trackEvent(BackupEvents.ACCOUNT_RECOVERY_COMPLETED); - useSettingStore.getState().setHasViewedRecoveryPhrase(true); navigation.navigate('AccountVerifiedSuccess'); }, [mnemonic, restoreAccountFromMnemonic]); diff --git a/app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx b/app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx index 7999ab3be..b9910cad2 100644 --- a/app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx +++ b/app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx @@ -1,6 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11 -import { StaticScreenProps } from '@react-navigation/native'; import React, { useCallback, useState } from 'react'; import { PrimaryButton } from '../../components/buttons/PrimaryButton'; @@ -12,19 +11,15 @@ import { Title } from '../../components/typography/Title'; import useHapticNavigation from '../../hooks/useHapticNavigation'; import useMnemonic from '../../hooks/useMnemonic'; import { ExpandableBottomLayout } from '../../layouts/ExpandableBottomLayout'; -import { RootStackParamList } from '../../navigation'; import { useSettingStore } from '../../stores/settingStore'; import { STORAGE_NAME } from '../../utils/cloudBackup'; import { black, slate400, white } from '../../utils/colors'; -import { useProvingStore } from '../../utils/proving/provingMachine'; -type NextScreen = keyof RootStackParamList; -interface SaveRecoveryPhraseScreenProps - extends StaticScreenProps<{ nextScreen?: NextScreen } | undefined> {} +interface SaveRecoveryPhraseScreenProps {} -const SaveRecoveryPhraseScreen: React.FC = ({ - route, -}) => { +const SaveRecoveryPhraseScreen: React.FC< + SaveRecoveryPhraseScreenProps +> = ({}) => { const [userHasSeenMnemonic, setUserHasSeenMnemonic] = useState(false); const { mnemonic, loadMnemonic } = useMnemonic(); const { cloudBackupEnabled } = useSettingStore(); @@ -34,19 +29,12 @@ const SaveRecoveryPhraseScreen: React.FC = ({ setUserHasSeenMnemonic(true); }, []); - const nextScreen = route.params?.nextScreen ?? 'AccountVerifiedSuccess'; - const onCloudBackupPress = useHapticNavigation('CloudBackupSettings', { params: { nextScreen: 'SaveRecoveryPhrase' }, }); - - const navigateNext = useHapticNavigation(nextScreen, { action: 'confirm' }); - const onSkipPress = useCallback(() => { - if (nextScreen === 'LoadingScreen') { - useProvingStore.getState().init('register', true); - } - navigateNext(); - }, [navigateNext, nextScreen]); + const onSkipPress = useHapticNavigation('AccountVerifiedSuccess', { + action: 'confirm', + }); return ( diff --git a/app/src/utils/proving/provingMachine.ts b/app/src/utils/proving/provingMachine.ts index 2e0873038..7aa298b91 100644 --- a/app/src/utils/proving/provingMachine.ts +++ b/app/src/utils/proving/provingMachine.ts @@ -24,7 +24,6 @@ import { } from '../../providers/passportDataProvider'; import { useProtocolStore } from '../../stores/protocolStore'; import { useSelfAppStore } from '../../stores/selfAppStore'; -import { useSettingStore } from '../../stores/settingStore'; import analytics from '../analytics'; import { getPublicKey, verifyAttestation } from './attest'; import { @@ -51,11 +50,10 @@ import { const { trackEvent } = analytics(); export const getPostVerificationRoute = () => { - const { cloudBackupEnabled, hasViewedRecoveryPhrase } = - useSettingStore.getState(); - return cloudBackupEnabled || hasViewedRecoveryPhrase - ? 'AccountVerifiedSuccess' - : 'SaveRecoveryPhrase'; + return 'AccountVerifiedSuccess'; + // disable for now + // const { cloudBackupEnabled } = useSettingStore.getState(); + // return cloudBackupEnabled ? 'AccountVerifiedSuccess' : 'SaveRecoveryPhrase'; }; const provingMachine = createMachine({ @@ -236,7 +234,7 @@ export const useProvingStore = create((set, get) => { if (state.value === 'completed') { if (get().circuitType !== 'disclose' && navigationRef.isReady()) { setTimeout(() => { - navigationRef.navigate(getPostVerificationRoute()); + navigationRef.navigate('AccountVerifiedSuccess'); }, 3000); } if (get().circuitType === 'disclose') { @@ -765,18 +763,9 @@ export const useProvingStore = create((set, get) => { _checkActorInitialized(actor); const { circuitType } = get(); if (circuitType === 'dsc') { - const { hasViewedRecoveryPhrase } = useSettingStore.getState(); - if (!hasViewedRecoveryPhrase) { - if (navigationRef.isReady()) { - navigationRef.navigate('SaveRecoveryPhrase', { - nextScreen: 'LoadingScreen', - }); - } - } else { - setTimeout(() => { - get().init('register', true); - }, 3000); - } + setTimeout(() => { + get().init('register', true); + }, 1500); } else if (circuitType === 'register') { actor!.send({ type: 'COMPLETED' }); } else if (circuitType === 'disclose') { diff --git a/app/tests/__setup__/svgMock.js b/app/tests/__setup__/svgMock.js new file mode 100644 index 000000000..e7857a6da --- /dev/null +++ b/app/tests/__setup__/svgMock.js @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11 + +import React from 'react'; + +const SvgMock = props => React.createElement('svg', props); + +export default SvgMock; diff --git a/app/tests/src/screens/misc/LoadingScreen.test.tsx b/app/tests/src/screens/misc/LoadingScreen.test.tsx deleted file mode 100644 index 0770b1f9c..000000000 --- a/app/tests/src/screens/misc/LoadingScreen.test.tsx +++ /dev/null @@ -1,264 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11 - -import { render, waitFor } from '@testing-library/react-native'; -import React from 'react'; - -import LoadingScreen from '../../../../src/screens/misc/LoadingScreen'; -import { useProvingStore } from '../../../../src/utils/proving/provingMachine'; - -// Mock the proving store -jest.mock('../../../../src/utils/proving/provingMachine'); - -// Mock other dependencies -jest.mock('@react-navigation/native', () => ({ - useIsFocused: () => true, - createNavigationContainerRef: jest.fn(() => ({ - isReady: jest.fn(() => true), - navigate: jest.fn(), - getCurrentRoute: jest.fn(() => ({ name: 'TestScreen' })), - })), - createStaticNavigation: jest.fn(() => jest.fn()), -})); - -jest.mock('@react-navigation/native-stack', () => ({ - createNativeStackNavigator: jest.fn(() => ({})), -})); - -jest.mock('react-native-gesture-handler', () => ({ - GestureHandlerRootView: ({ children }: any) => children, -})); - -jest.mock('react-native-safe-area-context', () => ({ - useSafeAreaInsets: () => ({ - top: 0, - bottom: 0, - left: 0, - right: 0, - }), -})); - -jest.mock('lottie-react-native', () => ({ - __esModule: true, - default: ({ children }: any) => children, -})); - -jest.mock('tamagui', () => ({ - YStack: ({ children }: any) => children, - Text: ({ children }: any) => children, - styled: jest.fn( - () => - ({ children }: any) => - children, - ), -})); - -jest.mock('../../../../src/hooks/useHapticNavigation', () => ({ - __esModule: true, - default: jest.fn(() => jest.fn()), -})); - -jest.mock('../../../../src/utils/haptic', () => ({ - loadingScreenProgress: jest.fn(), -})); - -// Mock SVG imports -jest.mock( - '../../../../src/images/icons/close-warning.svg', - () => 'CloseWarningIcon', -); - -jest.mock('../../../../src/utils/proving/loadingScreenStateText', () => ({ - getLoadingScreenText: jest.fn().mockReturnValue({ - actionText: 'Test Action', - estimatedTime: 'Test Time', - }), -})); - -jest.mock('../../../../src/providers/passportDataProvider', () => ({ - loadPassportDataAndSecret: jest.fn().mockResolvedValue( - JSON.stringify({ - passportData: { - passportMetadata: { - signatureAlgorithm: 'RSA', - curveOrExponent: '65537', - }, - }, - }), - ), - clearPassportData: jest.fn(), -})); - -jest.mock('../../../../src/utils/notifications/notificationService', () => ({ - setupNotifications: jest.fn().mockReturnValue(() => {}), -})); - -jest.mock('../../../../src/utils/proving/validateDocument', () => ({ - checkPassportSupported: jest - .fn() - .mockResolvedValue({ status: 'passport_supported' }), -})); - -const mockUseProvingStore = useProvingStore as unknown as jest.MockedFunction< - typeof useProvingStore ->; - -describe('LoadingScreen', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('Circuit type handling', () => { - it('should handle DSC circuit type correctly', async () => { - // Mock proving store state for DSC flow - mockUseProvingStore.mockImplementation(selector => { - if (typeof selector === 'function') { - return selector({ - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'dsc', - // Add other required state properties - } as any); - } - return { - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'dsc', - } as any; - }); - - // Mock getState to return DSC circuit type - (mockUseProvingStore as any).getState = jest.fn().mockReturnValue({ - circuitType: 'dsc', - }); - - const { - getLoadingScreenText, - } = require('../../../../src/utils/proving/loadingScreenStateText'); - - render(); - - // Verify that getLoadingScreenText was called with 'dsc' type - await waitFor(() => { - expect(getLoadingScreenText).toHaveBeenCalledWith( - 'proving', - expect.any(Object), - 'dsc', - ); - }); - }); - - it('should handle register circuit type correctly', async () => { - // Mock proving store state for register flow - mockUseProvingStore.mockImplementation(selector => { - if (typeof selector === 'function') { - return selector({ - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'register', - } as any); - } - return { - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'register', - } as any; - }); - - // Mock getState to return register circuit type - (mockUseProvingStore as any).getState = jest.fn().mockReturnValue({ - circuitType: 'register', - }); - - const { - getLoadingScreenText, - } = require('../../../../src/utils/proving/loadingScreenStateText'); - - render(); - - // Verify that getLoadingScreenText was called with 'register' type - await waitFor(() => { - expect(getLoadingScreenText).toHaveBeenCalledWith( - 'proving', - expect.any(Object), - 'register', - ); - }); - }); - - it('should handle disclose circuit type correctly', async () => { - // Mock proving store state for disclose flow - mockUseProvingStore.mockImplementation(selector => { - if (typeof selector === 'function') { - return selector({ - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'disclose', - } as any); - } - return { - currentState: 'proving', - fcmToken: 'test-token', - circuitType: 'disclose', - } as any; - }); - - // Mock getState to return disclose circuit type - (mockUseProvingStore as any).getState = jest.fn().mockReturnValue({ - circuitType: 'disclose', - }); - - const { - getLoadingScreenText, - } = require('../../../../src/utils/proving/loadingScreenStateText'); - - render(); - - // Verify that getLoadingScreenText was called with 'register' type (disclose uses register timing) - await waitFor(() => { - expect(getLoadingScreenText).toHaveBeenCalledWith( - 'proving', - expect.any(Object), - 'register', - ); - }); - }); - - it('should default to register type when circuit type is null', async () => { - // Mock proving store state with null circuit type - mockUseProvingStore.mockImplementation(selector => { - if (typeof selector === 'function') { - return selector({ - currentState: 'proving', - fcmToken: 'test-token', - circuitType: null, - } as any); - } - return { - currentState: 'proving', - fcmToken: 'test-token', - circuitType: null, - } as any; - }); - - // Mock getState to return null circuit type - (mockUseProvingStore as any).getState = jest.fn().mockReturnValue({ - circuitType: null, - }); - - const { - getLoadingScreenText, - } = require('../../../../src/utils/proving/loadingScreenStateText'); - - render(); - - // Verify that getLoadingScreenText was called with 'register' type as default - await waitFor(() => { - expect(getLoadingScreenText).toHaveBeenCalledWith( - 'proving', - expect.any(Object), - 'register', - ); - }); - }); - }); -}); diff --git a/app/tests/utils/proving/getPostVerificationRoute.test.ts b/app/tests/utils/proving/getPostVerificationRoute.test.ts deleted file mode 100644 index bbc36048f..000000000 --- a/app/tests/utils/proving/getPostVerificationRoute.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11 - -import { act } from '@testing-library/react-native'; - -import { useSettingStore } from '../../../src/stores/settingStore'; -import { getPostVerificationRoute } from '../../../src/utils/proving/provingMachine'; - -describe('getPostVerificationRoute', () => { - afterEach(() => { - act(() => { - useSettingStore.setState({ - cloudBackupEnabled: false, - hasViewedRecoveryPhrase: false, - }); - }); - }); - - it('returns SaveRecoveryPhrase when no backup and phrase not viewed', () => { - act(() => { - useSettingStore.setState({ - cloudBackupEnabled: false, - hasViewedRecoveryPhrase: false, - }); - }); - expect(getPostVerificationRoute()).toBe('SaveRecoveryPhrase'); - }); - - it('returns AccountVerifiedSuccess when cloud backup enabled', () => { - act(() => { - useSettingStore.setState({ cloudBackupEnabled: true }); - }); - expect(getPostVerificationRoute()).toBe('AccountVerifiedSuccess'); - }); - - it('returns AccountVerifiedSuccess when phrase already viewed', () => { - act(() => { - useSettingStore.setState({ hasViewedRecoveryPhrase: true }); - }); - expect(getPostVerificationRoute()).toBe('AccountVerifiedSuccess'); - }); -}); diff --git a/app/tests/utils/proving/loadingScreenStateText.test.ts b/app/tests/utils/proving/loadingScreenStateText.test.ts index 619f3f964..5b87b1b0c 100644 --- a/app/tests/utils/proving/loadingScreenStateText.test.ts +++ b/app/tests/utils/proving/loadingScreenStateText.test.ts @@ -95,63 +95,6 @@ describe('stateLoadingScreenText', () => { // Should use RSA (4 SECONDS) expect(result.estimatedTime).toBe('4 SECONDS'); }); - - it('should use DSC timing when type is specified as dsc', () => { - const result = getLoadingScreenText('proving', rsaMetadata, 'dsc'); - - // Should use RSA DSC (2 SECONDS) instead of register (4 SECONDS) - expect(result.estimatedTime).toBe('2 SECONDS'); - }); - - it('should use register timing when type is specified as register', () => { - const result = getLoadingScreenText('proving', rsaMetadata, 'register'); - - // Should use RSA register (4 SECONDS) - expect(result.estimatedTime).toBe('4 SECONDS'); - }); - - it('should default to register timing when no type is specified', () => { - const result = getLoadingScreenText('proving', rsaMetadata); - - // Should default to register timing (4 SECONDS) - expect(result.estimatedTime).toBe('4 SECONDS'); - }); - }); - - describe('Circuit type specific timing estimates', () => { - const ecdsaMetadata: PassportMetadata = { - signatureAlgorithm: 'ECDSA', - curveOrExponent: 'secp256r1', - }; - - it('should provide correct DSC timing for ECDSA', () => { - const result = getLoadingScreenText('proving', ecdsaMetadata, 'dsc'); - expect(result.estimatedTime).toBe('25 SECONDS'); - }); - - it('should provide correct register timing for ECDSA', () => { - const result = getLoadingScreenText('proving', ecdsaMetadata, 'register'); - expect(result.estimatedTime).toBe('50 SECONDS'); - }); - - const rsaPssMetadata: PassportMetadata = { - signatureAlgorithm: 'RSAPSS', - curveOrExponent: '65537', - }; - - it('should provide correct DSC timing for RSA-PSS', () => { - const result = getLoadingScreenText('proving', rsaPssMetadata, 'dsc'); - expect(result.estimatedTime).toBe('3 SECONDS'); - }); - - it('should provide correct register timing for RSA-PSS', () => { - const result = getLoadingScreenText( - 'proving', - rsaPssMetadata, - 'register', - ); - expect(result.estimatedTime).toBe('6 SECONDS'); - }); }); describe('getProvingTimeEstimate', () => { diff --git a/circuits/package.json b/circuits/package.json index e82c10fd4..1f6bf0b25 100644 --- a/circuits/package.json +++ b/circuits/package.json @@ -54,9 +54,9 @@ "asn1.js": "^5.4.1", "asn1js": "^3.0.5", "chai-as-promised": "^7.1.1", - "circom_tester": "github:remicolin/circom_tester#main", "circom-bigint": "https://github.com/0xbok/circom-bigint", "circom-dl": "https://github.com/distributed-lab/circom-dl", + "circom_tester": "github:remicolin/circom_tester#main", "circomlib": "^2.0.5", "circomlibjs": "^0.1.7", "crypto": "^1.0.1", diff --git a/sdk/core/src/SelfBackendVerifier.ts b/sdk/core/src/SelfBackendVerifier.ts index 6bfc43180..bc3b975fd 100644 --- a/sdk/core/src/SelfBackendVerifier.ts +++ b/sdk/core/src/SelfBackendVerifier.ts @@ -72,7 +72,9 @@ export class SelfBackendVerifier { }); } - const publicSignals = pubSignals.map(String).map((x) => (/[a-f]/g.test(x) && x.length > 0 ? '0x' + x : x)); + const publicSignals = pubSignals + .map(String) + .map((x) => (/[a-f]/g.test(x) && x.length > 0 ? '0x' + x : x)); //check if user context hash matches const userContextHashInCircuit = BigInt( publicSignals[discloseIndices[attestationId].userIdentifierIndex] diff --git a/yarn.lock b/yarn.lock index 0bafa6dd3..1c6d5e044 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4541,7 +4541,7 @@ __metadata: react-native-nfc-manager: "npm:^3.15.1" react-native-passport-reader: "npm:^1.0.3" react-native-quick-crypto: "npm:^0.7.12" - react-native-safe-area-context: "npm:^5.2.0" + react-native-safe-area-context: "npm:^5.5.1" react-native-screens: "npm:4.9.0" react-native-sqlite-storage: "npm:^6.0.1" react-native-svg: "npm:^15.11.1" @@ -19709,13 +19709,13 @@ __metadata: languageName: node linkType: hard -"react-native-safe-area-context@npm:^5.2.0": - version: 5.4.1 - resolution: "react-native-safe-area-context@npm:5.4.1" +"react-native-safe-area-context@npm:^5.5.1": + version: 5.5.1 + resolution: "react-native-safe-area-context@npm:5.5.1" peerDependencies: react: "*" react-native: "*" - checksum: 10c0/6da614f4e9318c784700f0586d19d866f565ae08029c9a38cb1b03fd578af3838f2a6d5321c4a220dc7d698d919faf544536b60e45b7cc97f985349328041de2 + checksum: 10c0/603d9f4cdfd34b494ae64dbcbcd57f306271b9843971c0fb820e8d50e6470f63cdd06472536e8ff9668f79a33c3d1ef32741ed6fe71ca81b093ec01ac99054f0 languageName: node linkType: hard