profile
viewpoint

celo-org/celo-monorepo 482

Official repository for core projects comprising the Celo platform

celo-org/analytics-react-native 3

The hassle-free way to add analytics to your React-Native app.

celo-org/analytics-ios-integration-firebase 2

Segment's bundled integration for Firebase on iOS

celo-org/gosigar 2

Gathers system and per process statistics

celo-org/react-native-firebase 2

🔥 A well tested feature rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for over 20 Firebase services.

celo-org/react-native-fs 2

Native filesystem access for react-native

celo-org/react-native-reanimated 2

React Native's Animated library reimplemented

celo-org/react-native-udp 2

node's dgram for react-native

push eventvalora-inc/wallet

Tom McGuire

commit sha ff546437eb2586b951baa999e012310535c1c295

Fix Requests for new accounts (#1809) ### Description As identified in #1757 both send and request buttons were disabled for new accounts, but new accounts should be able to request from addresses and phone numbers. Phone number requests also require the user connect their phone number to pay ODIS fees. ### Other changes - Updated Snapshots - Updated error seen when attempting to request from a phone number from an unverified account, it is now more generic. - Requests are now allowed in all stableTokens, cUSD & cEUR, instead of CoreTokens, CELO, cUSD & cEUR. ### Tested - Tested locally on iOS. ### How others should test 1. Create a new account and check that a user is able to request from an address. 2. With this new account attempt to request from a phone number. Ensure that the user receives the appropriate error message to connect their phone number. 3. After a user connects their phone number ensure that they are able to request from a phone number. 4. With this new account attempt to use the QR scanner to perform a wallet connect action - user should be able to connect to a Dapp on a newly created account. ### Related issues - Fixes #1757 ### Backwards compatibility Yes

view details

mpgaarciaa

commit sha 75c63b71cded54cb7984b1ae6043e7dbad88e822

Supercharge edu screen copy update (#1803) * Supercharge edu screen copy update * Update translation.json Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jean Regisser <jean.regisser@gmail.com>

view details

Jean Regisser

commit sha 813b91dc827da4120d01130ece03f6111b4fc8d8

Merge branch 'main' into l10n/main

view details

push time in a day

startedk-tomoyasu/react-native-oss-license

started time in 2 days

issue commentvalora-inc/wallet

WalletConnect opens Valora website homepage in the browser instead of the app

Here's the data: in the last 30 days about 350 unique users landed on https://valoraapp.com/?uri=wc:XXX urls trying to connect to Valora via WalletConnect. It's impossible to know if they actually had Valora installed and bumped into this random iOS issue with universal links.

Source: GA, see https://valora-app.slack.com/archives/C02DY3RK79T/p1642604619032400?thread_ts=1642603482.030300&cid=C02DY3RK79T

aleksey-nov

comment created time in 2 days

PR closed valora-inc/wallet

Fix WalletConnect v2 freeze/crash

Description

A few sentences describing the overall effects and goals of the pull request's commits. What is the current behavior, and what is the updated/expected behavior with this PR?

Other changes

Describe any minor or "drive-by" changes here.

Tested

An explanation of how the changes were tested or an explanation as to why they don't need to be.

How others should test

Does this need to be tested by QA in the next release cycle? If so please give a brief explanation of how to test these changes.

Related issues

  • Fixes #1215

Backwards compatibility

Brief explanation of why these changes are/are not backwards compatible.

+25 -19

2 comments

3 changed files

jeanregisser

pr closed time in 2 days

pull request commentvalora-inc/wallet

Fix WalletConnect v2 freeze/crash

Closing for now since we don't intend to work on this until v2 is considered stable.

jeanregisser

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentvalora-inc/wallet

Update settings screen items layout and add item for biometrics

 function storePinWithBiometrics(pin: string) {   }) } +export function removeStoredPin() {+  return removeStoredItem(STORAGE_KEYS.PIN)

Can we add a test please?

kathaypacific

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentvalora-inc/wallet

Update settings screen items layout and add item for biometrics

       "useIris": "Turn on Iris recognition"     }   },+  "useBiometryOption": "Use {{option}}",

nit: this gives a bit more context for translators

  "useBiometrySetting": "Use {{biometryType}}",
kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 function storePasswordHash(hash: string, account: string) {   return storeItem({ key: passwordHashStorageKey(account), value: hash }) } +function storePinWithBiometrics(pin: string) {+  return storeItem({+    key: STORAGE_KEYS.PIN,+    value: pin,

Great question! I'd say no given we rely on the OS protecting this item correctly. @nategraf @gnardini I'd love your opinion on this too.

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 describe(getPincode, () => {     expect(navigateBack).toHaveBeenCalled()     expect(getCachedPin(DEFAULT_CACHE_ACCOUNT)).toEqual(pin)   })+  it('returns pin with biometrics if enabled', async () => {+    mockStore.getState.mockImplementationOnce(() =>+      getMockStoreData({ account: { pincodeType: PincodeType.PhoneAuth } })+    )+    const getPasswordSpy = jest.fn().mockResolvedValue({+      password: mockPin,+      username: 'username',+      service: 'service',+      storage: 'storage',+    })+    mockedKeychain.getGenericPassword.mockImplementationOnce(getPasswordSpy)+    await getPincode()++    expect(getPasswordSpy).toHaveBeenCalledTimes(1)+    expect(getPasswordSpy).toHaveBeenCalledWith({ service: 'PIN' })

Why not expecting this on mockedKeychain.getGenericPassword directly?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 describe(getPincode, () => {     expect(navigateBack).toHaveBeenCalled()     expect(getCachedPin(DEFAULT_CACHE_ACCOUNT)).toEqual(pin)   })+  it('returns pin with biometrics if enabled', async () => {+    mockStore.getState.mockImplementationOnce(() =>+      getMockStoreData({ account: { pincodeType: PincodeType.PhoneAuth } })+    )+    const getPasswordSpy = jest.fn().mockResolvedValue({+      password: mockPin,+      username: 'username',+      service: 'service',+      storage: 'storage',+    })+    mockedKeychain.getGenericPassword.mockImplementationOnce(getPasswordSpy)+    await getPincode()

We should check that it returns what we expect.

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 export default function EnableBiometry({ navigation, route }: Props) {   }, [navigation, step, totalSteps])    const onPressUseBiometry = async () => {-    dispatch(setUseBiometry(true))-    // do some stuff to use biometry--    navigate(choseToRestoreAccount ? Screens.ImportWallet : Screens.VerificationEducationScreen)+    try {+      await setPincodeWithBiometrics()+      dispatch(setPincodeSuccess(PincodeType.PhoneAuth))+      navigate(choseToRestoreAccount ? Screens.ImportWallet : Screens.VerificationEducationScreen)+    } catch (error) {+      Logger.warn(TAG, 'Error enabling biometrics', error)

I see, but since this is in a critical path, I'd prefer to use Logger.error by default and use warn if the error is in a list of expected errors (cancelled, etc). This way we'll know about things we didn't handle correctly.

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 	<string>Connecting your camera allows you to scans codes for payments.</string> 	<key>NSContactsUsageDescription</key> 	<string>Adding your contacts makes it easy to send and request payments with your friends.</string>+	<key>NSFaceIDUsageDescription</key>+	<string>This is required for you to use Face ID to secure your account.</string>

We need to add this new key to sync_ios_info_plist_strings.sh and run that script too. Though, since the English strings were modified in Base.lproj/InfoPlist.strings, we need to manually put the new values in this plist. Ping me if it's unclear :D

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 export function* getPasswordSaga(account: string, withVerification?: boolean, st  type PinCallback = (pin: string) => void +export async function setPincodeWithBiometrics() {+  let pin = getCachedPin(DEFAULT_CACHE_ACCOUNT)+  if (!pin) {+    pin = await requestPincodeInput(true, true)+  }

Can we make this function more explicit and pass the pin as a parameter instead?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 export async function ensurePincode(): Promise<boolean> {     return false   } -  if (pincodeType !== PincodeType.CustomPin) {+  if (pincodeType !== PincodeType.CustomPin && pincodeType !== PincodeType.PhoneAuth) {     Logger.error(TAG + '@ensurePincode', `Unsupported Pincode Type ${pincodeType}`)     return false   } +  if (pincodeType === PincodeType.PhoneAuth) {+    try {+      await getPincodeWithBiometrics()+      return true+    } catch (error) {+      Logger.warn(`${TAG}@ensurePincode`, `Retrieve PIN by biometrics error`, error)

I'd prefer to use Logger.error. We should warn only on expected errors, like user cancelled.

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 export function* getPasswordSaga(account: string, withVerification?: boolean, st  type PinCallback = (pin: string) => void +export async function setPincodeWithBiometrics() {+  let pin = getCachedPin(DEFAULT_CACHE_ACCOUNT)+  if (!pin) {+    pin = await requestPincodeInput(true, true)+  }++  try {+    // storeItem can be called multiple times with the same key, so stale keys+    // from previous app installs/failed save attempts will be overwritten+    // safely here+    await storePinWithBiometrics(pin)++    const retrievedPin = await retrieveStoredItem(STORAGE_KEYS.PIN)++    if (retrievedPin !== pin) {+      throw new Error('Retrieved incorrect pin with biometrics after saving')+    }+  } catch (error) {+    Logger.error(TAG, 'Failed to save pin with biometrics', error)

Looks like we should use warn here since we're throwing after this line. Otherwise we'll capture the exception twice, right @gnardini?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 function mapStateToProps(state: RootState): StateProps { const mapDispatchToProps = {   setPincode,

Is this one still used?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 describe(getPincode, () => {   }) }) +describe(getPincodeWithBiometrics, () => {+  it('returns the correct pin and populates the cache', async () => {+    clearPasswordCaches()+    mockedKeychain.getGenericPassword.mockResolvedValue({+      password: mockPin,+      username: 'username',+      service: 'service',+      storage: 'storage',+    })+    const retrievedPin = await getPincodeWithBiometrics()++    expect(retrievedPin).toEqual(mockPin)+    expect(getCachedPin(DEFAULT_CACHE_ACCOUNT)).toEqual(mockPin)+  })++  it('throws an error if a null pin was retrieved', async () => {+    mockedKeychain.getGenericPassword.mockResolvedValue(false)++    try {+      await getPincodeWithBiometrics()+    } catch (error) {+      expect(error).toEqual(expect.any(Error))+    }+  })+})++describe(setPincodeWithBiometrics, () => {+  beforeEach(() => {+    jest.clearAllMocks()+    setCachedPin(DEFAULT_CACHE_ACCOUNT, mockPin)+  })++  it('should set the keychain item with correct options and retrieve the correct pin', async () => {+    const setPasswordSpy = jest.fn().mockResolvedValue({+      service: 'PIN',+      storage: 'storage',+    })+    mockedKeychain.setGenericPassword.mockImplementationOnce(setPasswordSpy)+    mockedKeychain.getGenericPassword.mockResolvedValue({+      password: mockPin,+      username: 'username',+      service: 'PIN',+      storage: 'storage',+    })++    await setPincodeWithBiometrics()++    expect(setPasswordSpy).toHaveBeenCalledTimes(1)+    expect(setPasswordSpy).toHaveBeenCalledWith(

ditto, can't we expect this on mockedKeychain.setGenericPassword?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Use biometrics instead of pincode enter screen when enabled

 export async function getPincode(withVerification = true) {     return cachedPin   } +  const pincodeType = pincodeTypeSelector(store.getState())+  if (pincodeType === PincodeType.PhoneAuth) {+    try {+      const retrievedPin = await getPincodeWithBiometrics()+      return retrievedPin+    } catch (error) {+      Logger.warn(TAG, 'Failed to retrieve pin with biometrics', error)

ditto about Logger.error

kathaypacific

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentvalora-inc/wallet

Add enable biometry screen to onboarding flow

 export const v26Schema = {   },   app: {     ...v25Schema.app,+    biometryEnabled: false,+    supportedBiometryType: null,+    useBiometry: false,

These should be added to a new schema.

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Add enable biometry screen to onboarding flow

+import Button, { BtnSizes, BtnTypes } from '@celo/react-components/components/Button'+import colors from '@celo/react-components/styles/colors'+import fontStyles from '@celo/react-components/styles/fonts'+import { Spacing } from '@celo/react-components/styles/styles'+import { StackScreenProps } from '@react-navigation/stack'+import React, { useLayoutEffect } from 'react'+import { useTranslation } from 'react-i18next'+import { ScrollView, StyleSheet, Text, View } from 'react-native'+import * as Keychain from 'react-native-keychain'+import { SafeAreaView } from 'react-native-safe-area-context'+import { useDispatch } from 'react-redux'+import { choseToRestoreAccountSelector } from 'src/account/selectors'+import { setUseBiometry } from 'src/app/actions'+import { registrationStepsSelector, supportedBiometryTypeSelector } from 'src/app/selectors'+import {+  default as Face,+  default as FaceID,+  default as Fingerprint,+  default as TouchID,+} from 'src/icons/biometrics/FaceID'+import { HeaderTitleWithSubtitle, nuxNavigationOptions } from 'src/navigator/Headers'+import { navigate, navigateHome } from 'src/navigator/NavigationService'+import { Screens } from 'src/navigator/Screens'+import { TopBarTextButton } from 'src/navigator/TopBarButton'+import { StackParamList } from 'src/navigator/types'+import { default as useSelector } from 'src/redux/useSelector'++type Props = StackScreenProps<StackParamList, Screens.EnableBiometry>++const biometryImageMap: { [key in Keychain.BIOMETRY_TYPE]: JSX.Element } = {+  [Keychain.BIOMETRY_TYPE.FACE_ID]: <FaceID />,+  [Keychain.BIOMETRY_TYPE.TOUCH_ID]: <TouchID />,+  [Keychain.BIOMETRY_TYPE.FINGERPRINT]: <Fingerprint />,+  [Keychain.BIOMETRY_TYPE.FACE]: <Face />,+  [Keychain.BIOMETRY_TYPE.IRIS]: <Face />,

Doesn't matter now, but should we have an iris icon?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Add enable biometry screen to onboarding flow

     "step2": "With {{appName}}, it’s easy to access and easy to grow your crypto.",     "step3": "All you need is a mobile phone to send, spend and explore."   },+  "enableBiometry": {+    "title": "Secure your wallet",+    "description": "Face ID secures your wallet and makes it easier to use Valora",
    "description": "Face ID secures your wallet and makes it easier to use {{appName}}",
kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Add enable biometry screen to onboarding flow

     "step2": "With {{appName}}, it’s easy to access and easy to grow your crypto.",     "step3": "All you need is a mobile phone to send, spend and explore."   },+  "enableBiometry": {+    "title": "Secure your wallet",+    "description": "Face ID secures your wallet and makes it easier to use Valora",

Shouldn't the description be based on the type of biometry sensor available?

kathaypacific

comment created time in 2 days

Pull request review commentvalora-inc/wallet

Add enable biometry screen to onboarding flow

+import Button, { BtnSizes, BtnTypes } from '@celo/react-components/components/Button'+import colors from '@celo/react-components/styles/colors'+import fontStyles from '@celo/react-components/styles/fonts'+import { Spacing } from '@celo/react-components/styles/styles'+import { StackScreenProps } from '@react-navigation/stack'+import React, { useLayoutEffect } from 'react'+import { useTranslation } from 'react-i18next'+import { ScrollView, StyleSheet, Text, View } from 'react-native'+import * as Keychain from 'react-native-keychain'+import { SafeAreaView } from 'react-native-safe-area-context'+import { useDispatch } from 'react-redux'+import { choseToRestoreAccountSelector } from 'src/account/selectors'+import { setUseBiometry } from 'src/app/actions'+import { registrationStepsSelector, supportedBiometryTypeSelector } from 'src/app/selectors'+import {+  default as Face,+  default as FaceID,+  default as Fingerprint,+  default as TouchID,+} from 'src/icons/biometrics/FaceID'+import { HeaderTitleWithSubtitle, nuxNavigationOptions } from 'src/navigator/Headers'+import { navigate, navigateHome } from 'src/navigator/NavigationService'+import { Screens } from 'src/navigator/Screens'+import { TopBarTextButton } from 'src/navigator/TopBarButton'+import { StackParamList } from 'src/navigator/types'+import { default as useSelector } from 'src/redux/useSelector'++type Props = StackScreenProps<StackParamList, Screens.EnableBiometry>++const biometryImageMap: { [key in Keychain.BIOMETRY_TYPE]: JSX.Element } = {+  [Keychain.BIOMETRY_TYPE.FACE_ID]: <FaceID />,+  [Keychain.BIOMETRY_TYPE.TOUCH_ID]: <TouchID />,+  [Keychain.BIOMETRY_TYPE.FINGERPRINT]: <Fingerprint />,+  [Keychain.BIOMETRY_TYPE.FACE]: <Face />,+  [Keychain.BIOMETRY_TYPE.IRIS]: <Face />,+}++const biometryButtonLabelMap: { [key in Keychain.BIOMETRY_TYPE]: string } = {+  [Keychain.BIOMETRY_TYPE.FACE_ID]: 'enableBiometry.cta.useFaceId',+  [Keychain.BIOMETRY_TYPE.TOUCH_ID]: 'enableBiometry.cta.useTouchId',+  [Keychain.BIOMETRY_TYPE.FINGERPRINT]: 'enableBiometry.cta.useFingerprint',+  [Keychain.BIOMETRY_TYPE.FACE]: 'enableBiometry.cta.useFace',+  [Keychain.BIOMETRY_TYPE.IRIS]: 'enableBiometry.cta.useIris',+}++export default function EnableBiometry({ navigation, route }: Props) {+  const { t } = useTranslation()+  const dispatch = useDispatch()++  // This screen would not be displayed if supportedBiometryType were null+  const supportedBiometryType = useSelector(supportedBiometryTypeSelector)+  const choseToRestoreAccount = useSelector(choseToRestoreAccountSelector)+  const { step, totalSteps } = useSelector(registrationStepsSelector)++  useLayoutEffect(() => {+    navigation.setOptions({+      headerTitle: () => (+        <HeaderTitleWithSubtitle+          title={t('enableBiometry.title')}+          subTitle={t('registrationSteps', { step, totalSteps })}+        />+      ),+      headerRight: () => (+        <TopBarTextButton+          title={t('skip')}+          testID="EnableBiometrySkipHeader"+          onPress={navigateHome}+          titleStyle={{ color: colors.goldDark }}+        />+      ),+    })+  }, [navigation, step, totalSteps])++  const onPressUseBiometry = async () => {+    dispatch(setUseBiometry(true))+    // do some stuff to use biometry++    navigate(choseToRestoreAccount ? Screens.ImportWallet : Screens.VerificationEducationScreen)+  }++  return (+    <SafeAreaView style={styles.container}>+      <ScrollView contentContainerStyle={styles.contentContainer}>

When the ScrollView takes the full content it's preferable to put the SafeAreaView within it so the content is not clipped at the bottom.

kathaypacific

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventvalora-inc/wallet

dievazqu

commit sha c221909ee1a9a70fd5a0d316dbc4b299d38a8168

Dapp Marketplace internationalization (#1814) ### Description Dapp Marketplace supports non-english languages ### Tested Manually in a iOS emulator ### How others should test In other to be able to use this code, you should set `dappsExplorerEnabled` as `true` and `dappListApiUrl` to `https://us-central1-celo-mobile-alfajores.cloudfunctions.net/dappList` ### After merge After merging we should set the `dappListApiUrl` remote config param to `https://us-central1-celo-mobile-alfajores.cloudfunctions.net/dappList` in alfajores. ### Screenshot ![Simulator Screen Shot - iPhone 12 - 2022-01-19 at 16 36 37](https://user-images.githubusercontent.com/12504748/150202969-8076fed7-dff1-4721-906d-3557fd6b7b9d.png)

view details

Jean Regisser

commit sha 7245c6e4f31b38c35eed086f6d8e7a1e21183382

Remove unused e2e use case (#1810) ### Description Stumbled upon this unused e2e use case which is already covered in `NewAccountOnboarding.js`. @MuckT let me know if you had another intention with it. ### How others should test N/A

view details

Tom McGuire

commit sha ff546437eb2586b951baa999e012310535c1c295

Fix Requests for new accounts (#1809) ### Description As identified in #1757 both send and request buttons were disabled for new accounts, but new accounts should be able to request from addresses and phone numbers. Phone number requests also require the user connect their phone number to pay ODIS fees. ### Other changes - Updated Snapshots - Updated error seen when attempting to request from a phone number from an unverified account, it is now more generic. - Requests are now allowed in all stableTokens, cUSD & cEUR, instead of CoreTokens, CELO, cUSD & cEUR. ### Tested - Tested locally on iOS. ### How others should test 1. Create a new account and check that a user is able to request from an address. 2. With this new account attempt to request from a phone number. Ensure that the user receives the appropriate error message to connect their phone number. 3. After a user connects their phone number ensure that they are able to request from a phone number. 4. With this new account attempt to use the QR scanner to perform a wallet connect action - user should be able to connect to a Dapp on a newly created account. ### Related issues - Fixes #1757 ### Backwards compatibility Yes

view details

Jean Regisser

commit sha e21cb4888510dc19b0626bb8b0c188a2c0d4a6bf

Merge branch 'main' into mpgaarciaa-patch-1

view details

push time in 2 days

more