Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove decentralised verification paths #4274

Merged
merged 25 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d4fbf4c
chore: remove requireCPV
kathaypacific Sep 29, 2023
e716609
fix: weird import
kathaypacific Oct 6, 2023
6e890a5
chore: migrations
kathaypacific Oct 6, 2023
30cef25
fix: tests
kathaypacific Oct 6, 2023
4ec7065
fix: tests
kathaypacific Oct 6, 2023
307792e
Update src/navigator/DrawerNavigator.test.tsx
kathaypacific Oct 6, 2023
0b0cd27
chore: remove redux state, actions, revoke modal, phone number lookup
kathaypacific Oct 6, 2023
d39c5ba
chore: remove fetchLostAccounts, phone number migrated actions
kathaypacific Oct 6, 2023
0652ecd
chore: remove odis quota screen
kathaypacific Oct 6, 2023
d5c21f7
chore: remove unused tests
kathaypacific Oct 6, 2023
3fd8f3d
chore: remove stuff related to odis
kathaypacific Oct 6, 2023
3bcc402
fix: tests
kathaypacific Oct 6, 2023
24797f9
Merge branch 'kathy/remove-require-cpv' into kathy/remove-decentraliz…
kathaypacific Oct 6, 2023
96e958e
fix: lint
kathaypacific Oct 6, 2023
f76abfb
fix: remove copy
kathaypacific Oct 6, 2023
3369889
Merge branch 'main' into kathy/remove-decentralized-verification
kathaypacific Oct 9, 2023
8e23def
fix: migrations
kathaypacific Oct 9, 2023
0fd64fc
chore: remove dep
kathaypacific Oct 9, 2023
d6bb77b
Merge branch 'main' into kathy/remove-decentralized-verification
kathaypacific Oct 17, 2023
83af74d
chore: put back cpv migration
kathaypacific Oct 17, 2023
0653e35
chore: put the tests back
kathaypacific Oct 17, 2023
3be0712
fix: test names
kathaypacific Oct 17, 2023
a50731d
fix: bad merge
kathaypacific Oct 17, 2023
03131ec
fix: bad merge
kathaypacific Oct 17, 2023
db85c58
Merge branch 'main' into kathy/remove-decentralized-verification
kathaypacific Oct 18, 2023
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
33 changes: 0 additions & 33 deletions __mocks__/@celo/identity/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ PODS:
- react-native-adjust (4.33.0):
- Adjust (= 4.33.3)
- React-Core
- react-native-blind-threshold-bls (1.0.0):
- React-Core
- react-native-camera (4.2.1):
- React-Core
- react-native-camera/RCT (= 4.2.1)
Expand Down Expand Up @@ -826,7 +824,6 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-adjust (from `../node_modules/react-native-adjust`)
- react-native-blind-threshold-bls (from `../node_modules/react-native-blind-threshold-bls`)
- react-native-camera (from `../node_modules/react-native-camera`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-contacts (from `../node_modules/react-native-contacts`)
Expand Down Expand Up @@ -997,8 +994,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-adjust:
:path: "../node_modules/react-native-adjust"
react-native-blind-threshold-bls:
:path: "../node_modules/react-native-blind-threshold-bls"
react-native-camera:
:path: "../node_modules/react-native-camera"
react-native-config:
Expand Down Expand Up @@ -1193,7 +1188,6 @@ SPEC CHECKSUMS:
React-jsinspector: ec4dcbfb1f4e72f04f826a0301eceee5fa7ca540
React-logger: 35538accacf2583693fbc3ee8b53e69a1776fcee
react-native-adjust: 5f5966b51459bf8cb074bf8ebc1307a2bfb7b1da
react-native-blind-threshold-bls: 96b94b001aca9386ab033b26741614046044e80d
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-contacts: fd1614c74777089ebb6b0a0e3847dd78130ef9f4
Expand Down
8 changes: 0 additions & 8 deletions locales/base/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
"body": "You will no longer be able to access your funds or your Recovery Phrase from this device. There is no way to recover your Recovery Phrase if you haven't written it down.",
"resetNow": "Reset Now"
},
"promptConfirmRevokeModal": {
"header": "Are you sure you want to disconnect your phone number?",
"body": "Once disconnected, you will not be able to reconnect your phone number to this wallet again.",
"revoke": "Disconnect"
},
"protectWallet": {
"title": "Protect Your Wallet",
"subtitle": "Protect your wallet",
Expand Down Expand Up @@ -529,9 +524,6 @@
},
"message": "Message",
"addressLookupFailure": "Failed to look up phone number address",
"saltFetchFailure": "Failed to retrieve phone number secret",
"saltQuotaExceededError": "Your phone number lookup quota is used up",
"odisInsufficientBalance": "Please connect your number",
"ordinals": [
"zeroth",
"first",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"react-native-android-open-settings": "^1.3.0",
"react-native-auth0": "^2.17.4",
"react-native-bip39": "https://github.com/celo-org/react-native-bip39#65facae",
"react-native-blind-threshold-bls": "https://github.com/valora-inc/react-native-blind-threshold-bls#e7305cc",
"react-native-camera": "^4.2.1",
"react-native-config": "^1.5.1",
"react-native-contacts": "https://github.com/celo-org/react-native-contacts#9940121",
Expand Down
43 changes: 0 additions & 43 deletions src/account/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isE164NumberStrict } from '@celo/phone-utils'
import { sleep } from '@celo/utils/lib/async'
import { NativeStackScreenProps } from '@react-navigation/native-stack'
import * as Sentry from '@sentry/react-native'
Expand Down Expand Up @@ -26,7 +25,6 @@ import { PincodeType } from 'src/account/reducer'
import {
cloudBackupCompletedSelector,
devModeSelector,
e164NumberSelector,
pincodeTypeSelector,
} from 'src/account/selectors'
import { SettingsEvents } from 'src/analytics/Events'
Expand All @@ -41,7 +39,6 @@ import {
} from 'src/app/actions'
import {
analyticsEnabledSelector,
decentralizedVerificationEnabledSelector,
getRequirePinOnAppOpen,
hapticFeedbackEnabledSelector,
phoneNumberVerifiedSelector,
Expand All @@ -61,7 +58,6 @@ import {
} from 'src/components/SettingsItem'
import { PRIVACY_LINK, TOS_LINK } from 'src/config'
import { currentLanguageSelector } from 'src/i18n/selectors'
import { revokeVerification } from 'src/identity/actions'
import { getLocalCurrencyCode } from 'src/localCurrency/selectors'
import DrawerTopBar from 'src/navigator/DrawerTopBar'
import { ensurePincode, navigate } from 'src/navigator/NavigationService'
Expand All @@ -88,12 +84,10 @@ export const Account = ({ navigation, route }: Props) => {
const revokeBottomSheetRef = useRef<BottomSheetRefType>(null)

const [showAccountKeyModal, setShowAccountKeyModal] = useState(false)
const [showRevokeModal, setShowRevokeModal] = useState(false)

const sessionId = useSelector(sessionIdSelector)
const account = useSelector(walletAddressSelector)
const devModeActive = useSelector(devModeSelector)
const e164PhoneNumber = useSelector(e164NumberSelector)
const analyticsEnabled = useSelector(analyticsEnabledSelector)
const numberVerified = useSelector(phoneNumberVerifiedSelector)
const pincodeType = useSelector(pincodeTypeSelector)
Expand All @@ -103,7 +97,6 @@ export const Account = ({ navigation, route }: Props) => {
const { v2 } = useSelector(walletConnectEnabledSelector)
const supportedBiometryType = useSelector(supportedBiometryTypeSelector)
const hapticFeedbackEnabled = useSelector(hapticFeedbackEnabledSelector)
const decentralizedVerificationEnabled = useSelector(decentralizedVerificationEnabledSelector)
const currentLanguage = useSelector(currentLanguageSelector)
const cloudBackupCompleted = useSelector(cloudBackupCompletedSelector)

Expand Down Expand Up @@ -154,16 +147,6 @@ export const Account = ({ navigation, route }: Props) => {
dispatch(setNumberVerified(numberVerified))
}

const revokeNumberVerification = () => {
hideConfirmRevokeModal()
if (e164PhoneNumber && !isE164NumberStrict(e164PhoneNumber)) {
Logger.showError('Cannot revoke verificaton: number invalid')
return
}
Logger.showMessage('Revoking verification')
dispatch(revokeVerification())
}

const handleToggleBackupState = () => {
dispatch(toggleBackupState())
}
Expand Down Expand Up @@ -191,13 +174,6 @@ export const Account = ({ navigation, route }: Props) => {
<Text>Toggle verification done</Text>
</TouchableOpacity>
</View>
{decentralizedVerificationEnabled && (
<View style={styles.devSettingsItem}>
<TouchableOpacity onPress={showConfirmRevokeModal}>
<Text>Revoke Number Verification (on-chain)</Text>
</TouchableOpacity>
</View>
)}
<View style={styles.devSettingsItem}>
<TouchableOpacity onPress={handleResetAppOpenedState}>
<Text>Reset app opened state</Text>
Expand Down Expand Up @@ -339,14 +315,6 @@ export const Account = ({ navigation, route }: Props) => {
dispatch(clearStoredAccount(account ?? ''))
}

const showConfirmRevokeModal = () => {
setShowRevokeModal(true)
}

const hideConfirmRevokeModal = () => {
setShowRevokeModal(false)
}

const handleShowConfirmRevoke = () => {
ValoraAnalytics.track(SettingsEvents.settings_revoke_phone_number)
revokeBottomSheetRef.current?.snapToIndex(0)
Expand Down Expand Up @@ -518,17 +486,6 @@ export const Account = ({ navigation, route }: Props) => {
>
{t('promptConfirmRemovalModal.body')}
</Dialog>
<Dialog
isVisible={showRevokeModal}
title={t('promptConfirmRevokeModal.header')}
actionText={t('promptConfirmRevokeModal.revoke')}
actionPress={revokeNumberVerification}
secondaryActionText={t('cancel')}
secondaryActionPress={hideConfirmRevokeModal}
testID="ConfirmAccountRevokeModal"
>
{t('promptConfirmRevokeModal.body')}
</Dialog>
</ScrollView>

<RevokePhoneNumber forwardedRef={revokeBottomSheetRef} />
Expand Down
14 changes: 0 additions & 14 deletions src/analytics/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,6 @@ export enum OnboardingEvents {
cya_later = 'cya_later',
}

export enum VerificationEvents {
verification_start = 'verification_start',
verification_complete = 'verification_complete',
verification_error = 'verification_error',
verification_cancel = 'verification_cancel',
verification_timeout = 'verification_timeout',
verification_skip = 'verification_skip',
verification_skip_confirm = 'verification_skip_confirm',

verification_revoke_start = 'verification_revoke_start',
verification_revoke_finish = 'verification_revoke_finish',
verification_revoke_error = 'verification_revoke_error',
}

// Events emitted in the CPV flow
export enum PhoneVerificationEvents {
phone_verification_skip = 'phone_verification_skip',
Expand Down
46 changes: 0 additions & 46 deletions src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
SwapEvents,
TokenBottomSheetEvents,
TransactionEvents,
VerificationEvents,
WalletConnectEvents,
WebViewEvents,
} from 'src/analytics/Events'
Expand Down Expand Up @@ -403,50 +402,6 @@ interface OnboardingEventsProperties {
}
}

interface VerificationEventsProperties {
[VerificationEvents.verification_start]:
| {
feeless?: boolean
}
| undefined
[VerificationEvents.verification_complete]:
| {
feeless?: boolean
phoneNumberHash: string
}
| undefined
[VerificationEvents.verification_error]: {
error: string
feeless?: true
}
[VerificationEvents.verification_cancel]:
| {
feeless?: boolean
}
| undefined
[VerificationEvents.verification_timeout]:
| {
feeless?: boolean
}
| undefined
[VerificationEvents.verification_revoke_start]:
| {
feeless?: boolean
}
| undefined
[VerificationEvents.verification_revoke_finish]:
| {
feeless?: boolean
}
| undefined
[VerificationEvents.verification_revoke_error]: {
error: string
feeless?: boolean
}
[VerificationEvents.verification_skip]: undefined
[VerificationEvents.verification_skip_confirm]: undefined
}

interface PhoneVerificationEventsProperties {
[PhoneVerificationEvents.phone_verification_skip]: undefined
[PhoneVerificationEvents.phone_verification_skip_confirm]: undefined
Expand Down Expand Up @@ -1411,7 +1366,6 @@ export type AnalyticsPropertiesList = AppEventsProperties &
SettingsEventsProperties &
KeylessBackupEventsProperties &
OnboardingEventsProperties &
VerificationEventsProperties &
PhoneVerificationEventsProperties &
IdentityEventsProperties &
AuthenticationEventsProperties &
Expand Down
11 changes: 0 additions & 11 deletions src/analytics/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
SwapEvents,
TokenBottomSheetEvents,
TransactionEvents,
VerificationEvents,
WalletConnectEvents,
WebViewEvents,
} from 'src/analytics/Events'
Expand Down Expand Up @@ -205,16 +204,6 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
[OnboardingEvents.protect_wallet_complete]: ``,
[OnboardingEvents.cya_button_press]: `when one of the choose your adventure card is pressed. Properties include card name, position of the card (1-based index) and card order`,
[OnboardingEvents.cya_later]: `when "I'll explore later" is pressed`,
[VerificationEvents.verification_start]: ``,
[VerificationEvents.verification_complete]: ``,
[VerificationEvents.verification_error]: ``,
[VerificationEvents.verification_cancel]: ``,
[VerificationEvents.verification_timeout]: ``,
[VerificationEvents.verification_skip]: ``,
[VerificationEvents.verification_skip_confirm]: ``,
[VerificationEvents.verification_revoke_start]: ``,
[VerificationEvents.verification_revoke_finish]: ``,
[VerificationEvents.verification_revoke_error]: ``,

// Events emitted in the CPV flow
[PhoneVerificationEvents.phone_verification_skip]: `when skip is pressed in the phone number input screen`,
Expand Down
4 changes: 0 additions & 4 deletions src/app/ErrorMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export enum ErrorMessages {
NOT_READY_FOR_CODE = 'notReadyForCode',
PHONE_NUMBER_VERIFICATION_FAILURE = 'phoneVerificationInput.verificationFailure',
ADDRESS_LOOKUP_FAILURE = 'addressLookupFailure',
ODIS_QUOTA_ERROR = 'odisQuotaError',
SALT_FETCH_FAILURE = 'saltFetchFailure',
SALT_QUOTA_EXCEEDED = 'saltQuotaExceededError',
ODIS_INSUFFICIENT_BALANCE = 'odisInsufficientBalance',
ACCOUNT_UNLOCK_FAILED = 'accountUnlockFailed',
SEND_PAYMENT_FAILED = 'sendPaymentFailed',
PAYMENT_REQUEST_FAILED = 'paymentRequestFailed',
Expand Down
12 changes: 0 additions & 12 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export enum Actions {
APP_UNMOUNTED = 'APP/APP_UNMOUNTED',
ANDROID_MOBILE_SERVICES_AVAILABILITY_CHECKED = 'APP/ANDROID_MOBILE_SERVICES_AVAILABILITY_CHECKED',
PHONE_NUMBER_VERIFICATION_COMPLETED = 'APP/PHONE_NUMBER_VERIFICATION_COMPLETED',
PHONE_NUMBER_VERIFICATION_MIGRATED = 'APP/PHONE_NUMBER_VERIFICATION_MIGRATED',
PHONE_NUMBER_REVOKED = 'APP/PHONE_NUMBER_REVOKED',
INVITE_LINK_CONSUMED = 'APP/INVITE_LINK_CONSUMED',
HAPTIC_FEEDBACK_SET = 'APP/HAPTIC_FEEDBACK_SET',
Expand Down Expand Up @@ -135,10 +134,6 @@ export interface PhoneNumberVerificationCompleted {
countryCode: string | null
}

export interface PhoneNumberVerificationMigrated {
type: Actions.PHONE_NUMBER_VERIFICATION_MIGRATED
}

export interface PhoneNumberRevoked {
type: Actions.PHONE_NUMBER_REVOKED
e164PhoneNumber: string
Expand Down Expand Up @@ -189,7 +184,6 @@ export type ActionTypes =
| AppUnmounted
| AndroidMobileServicesAvailabilityChecked
| PhoneNumberVerificationCompleted
| PhoneNumberVerificationMigrated
| PhoneNumberRevoked
| InviteLinkConsumed
| HapticFeedbackSet
Expand Down Expand Up @@ -310,12 +304,6 @@ export const phoneNumberVerificationCompleted = (
}
}

export const phoneNumberVerificationMigrated = (): PhoneNumberVerificationMigrated => {
return {
type: Actions.PHONE_NUMBER_VERIFICATION_MIGRATED,
}
}

export const phoneNumberRevoked = (e164PhoneNumber: string): PhoneNumberRevoked => {
return {
type: Actions.PHONE_NUMBER_REVOKED,
Expand Down
Loading