Skip to content

Commit

Permalink
Merge branch 'develop' into feat/swap-cancellation-fee-back
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Nov 9, 2023
2 parents 1bbbd45 + ce98489 commit 84a64e6
Show file tree
Hide file tree
Showing 142 changed files with 4,584 additions and 1,108 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nodejs 16.19.0
rust 1.65.0
rust 1.69.0
java adoptopenjdk-11.0.18+10
ruby 2.7.6
python 3.11.3
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMMIT=cc2ffa0d
COMMIT=093dec95a

BUILD_VARIANT=STAGING
SENTRY_DSN=https://[email protected]/4505319746764800
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.env.nightly
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMMIT=cc2ffa0d
COMMIT=093dec95a

BUILD_VARIANT=NIGHTLY
SENTRY_DSN=https://[email protected]/6260389
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMMIT=cc2ffa0d
COMMIT=093dec95a

BUILD_VARIANT=PROD
SENTRY_DSN=https://[email protected]/6783228
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.env.staging
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMMIT=cc2ffa0d
COMMIT=093dec95a

BUILD_VARIANT=STAGING
SENTRY_DSN=https://[email protected]/4505319746764800
Expand Down
4 changes: 3 additions & 1 deletion apps/wallet-mobile/.storybook/storybook.requires.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/wallet-mobile/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nodejs 16.19.0
rust 1.65.0
rust 1.69.0
java adoptopenjdk-11.0.18+10
ruby 2.7.6
python 3.11.3
4 changes: 2 additions & 2 deletions apps/wallet-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ android {
applicationId "com.emurgo"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 531
versionName "4.20.0"
versionCode 537
versionName "4.23.0"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected String getMainComponentName() {
protected void onCreate(Bundle savedInstanceState) {
RNBootSplash.init(this);
super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}

/**
Expand Down
10 changes: 8 additions & 2 deletions apps/wallet-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ PODS:
- react-native-config/App (= 1.5.1)
- react-native-config/App (1.5.1):
- React-Core
- react-native-haskell-shelley (5.1.2):
- react-native-haskell-shelley (5.1.3):
- React
- react-native-pager-view (6.2.0):
- React-Core
Expand Down Expand Up @@ -501,6 +501,8 @@ PODS:
- React-Core
- RNKeychain (7.0.0):
- React-Core
- RNLocalize (3.0.2):
- React-Core
- RNPermissions (3.8.4):
- React-Core
- RNReanimated (3.3.0):
Expand Down Expand Up @@ -651,6 +653,7 @@ DEPENDENCIES:
- "RNFlashList (from `../../../node_modules/@shopify/flash-list`)"
- RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`)
- RNKeychain (from `../../../node_modules/react-native-keychain`)
- RNLocalize (from `../../../node_modules/react-native-localize`)
- RNPermissions (from `../../../node_modules/react-native-permissions`)
- RNReanimated (from `../../../node_modules/react-native-reanimated`)
- RNScreens (from `../../../node_modules/react-native-screens`)
Expand Down Expand Up @@ -825,6 +828,8 @@ EXTERNAL SOURCES:
:path: "../../../node_modules/react-native-gesture-handler"
RNKeychain:
:path: "../../../node_modules/react-native-keychain"
RNLocalize:
:path: "../../../node_modules/react-native-localize"
RNPermissions:
:path: "../../../node_modules/react-native-permissions"
RNReanimated:
Expand Down Expand Up @@ -895,7 +900,7 @@ SPEC CHECKSUMS:
react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe
react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-haskell-shelley: 8fded9eb467321c6f3d9ceaf5aaec20ca7304003
react-native-haskell-shelley: 92544de7277b53cda2393528d530b526c81b48a6
react-native-pager-view: 0ccb8bf60e2ebd38b1f3669fa3650ecce81db2df
react-native-quick-base64: 62290829c619fbabca4c41cfec75ae759d08fc1c
react-native-randombytes: b6677f7d495c27e9ee0dbd77ebc97b3c59173729
Expand Down Expand Up @@ -925,6 +930,7 @@ SPEC CHECKSUMS:
RNFlashList: ade81b4e928ebd585dd492014d40fb8d0e848aab
RNGestureHandler: dec4645026e7401a0899f2846d864403478ff6a5
RNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f
RNLocalize: dbea38dcb344bf80ff18a1757b1becf11f70cae4
RNPermissions: f1b49dd05fa9b83993cd05a9ee115247944d8f1a
RNReanimated: d6b4b867b6d1ee0798f5fb372708fa4bb8d66029
RNScreens: 50ffe2fa2342eabb2d0afbe19f7c1af286bc7fb3
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/ios/nightly.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>471</string>
<string>480</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand Down
8 changes: 4 additions & 4 deletions apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 471;
CURRENT_PROJECT_VERSION = 480;
DEVELOPMENT_TEAM = F8NVT2G2L4;
ENABLE_BITCODE = NO;
ENVFILE = "$(PODS_ROOT)/../../.env";
Expand Down Expand Up @@ -857,7 +857,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 471;
CURRENT_PROJECT_VERSION = 480;
DEVELOPMENT_TEAM = F8NVT2G2L4;
ENVFILE = "$(PODS_ROOT)/../../.env.production";
INFOPLIST_FILE = yoroi/Info.plist;
Expand Down Expand Up @@ -1046,7 +1046,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-nightly";
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 471;
CURRENT_PROJECT_VERSION = 480;
DEVELOPMENT_TEAM = F8NVT2G2L4;
ENABLE_BITCODE = NO;
ENVFILE = "$(PODS_ROOT)/../../.env.nightly";
Expand Down Expand Up @@ -1085,7 +1085,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-nightly";
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 471;
CURRENT_PROJECT_VERSION = 480;
DEVELOPMENT_TEAM = F8NVT2G2L4;
ENVFILE = "$(PODS_ROOT)/../../.env.nightly";
INFOPLIST_FILE = nightly.plist;
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/ios/yoroi/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>471</string>
<string>480</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/ios/yoroiTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>471</string>
<string>480</string>
</dict>
</plist>
28 changes: 28 additions & 0 deletions apps/wallet-mobile/jestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ jest.mock('react-native-reanimated', () => {
Reanimated.default.call = () => {}
return Reanimated
})
jest.mock('react-native-localize', () => ({
getLocales: () => [
// extend if needed, add the locales you want
{countryCode: 'US', languageTag: 'en-US', languageCode: 'en', isRTL: false},
{countryCode: 'FR', languageTag: 'fr-FR', languageCode: 'fr', isRTL: false},
],

// use a provided translation, or return undefined to test your fallback
findBestLanguageTag: () => ({
languageTag: 'en-US',
isRTL: false,
}),

getNumberFormatSettings: () => ({
decimalSeparator: '.',
groupingSeparator: ',',
}),

getCalendar: () => 'gregorian', // the calendar identifier you want
getCountry: () => 'US', // the country code you want
getCurrencies: () => ['USD', 'EUR'], // can be empty array
getTemperatureUnit: () => 'celsius', // or "fahrenheit"
getTimeZone: () => 'Europe/Paris', // the timezone you want
uses24HourClock: () => true,
usesMetricSystem: () => true,
usesAutoDateAndTime: () => true,
usesAutoTimeZone: () => true,
}))

Logger.setLogLevel(LogLevel.Nothing)
YoroiLogging.Logger.setLogLevel(YoroiLogging.LogLevel.Nothing)
17 changes: 9 additions & 8 deletions apps/wallet-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"release:ios:nightly": "bundle exec fastlane ios release --env nightly",
"prerelease:ios:production": "bundle install && ./scripts/update-commit.sh && npx pod-install",
"release:ios:production": "bundle exec fastlane ios release --env production",
"reset": "yarn reset:android && yarn reset:ios",
"reset:android": "cd android && ./gradlew clean && cd ..",
"reset:ios": "yarn pod-install",
"reset": "yarn reset:android && yarn reset:ios",
"run:android:dev:debug": "ENVFILE=.env react-native run-android --mode=devDebug --appIdSuffix=dev --verbose",
"run:android:nightly:debug": "ENVFILE=.env.nightly react-native run-android --mode=nightlyDebug --appIdSuffix=nightly --verbose",
"run:android:nightly:release": "ENVFILE=.env.nightly react-native run-android --mode=nightlyRelease --appIdSuffix=nightly --verbose",
Expand Down Expand Up @@ -56,11 +56,11 @@
},
"jest": {
"cacheDirectory": ".jest/cache",
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"collectCoverage": true,
"coverageReporters": [
"text-summary",
"html"
Expand Down Expand Up @@ -94,7 +94,7 @@
"@emurgo/cip4-js": "1.0.7",
"@emurgo/cross-csl-core": "^3.4.0",
"@emurgo/cross-csl-mobile": "^3.4.0",
"@emurgo/csl-mobile-bridge": "^5.1.2",
"@emurgo/csl-mobile-bridge": "^5.1.3",
"@emurgo/react-native-blockies-svg": "^0.0.2",
"@emurgo/react-native-hid": "^5.15.6",
"@emurgo/yoroi-lib": "/Users/michalszorad/Desktop/yoroi-lib",
Expand All @@ -119,10 +119,10 @@
"@sentry/react-native": "^5.8.0",
"@shopify/flash-list": "^1.4.1",
"@unstoppabledomains/resolution": "6.0.3",
"@yoroi/banxa": "1.2.0",
"@yoroi/api": "1.2.0",
"@yoroi/common": "1.2.0",
"@yoroi/swap": "1.2.0",
"@yoroi/api": "1.3.0",
"@yoroi/banxa": "1.3.0",
"@yoroi/common": "1.3.0",
"@yoroi/swap": "1.3.0",
"add": "2.0.6",
"assert": "^2.0.0",
"base-64": "^1.0.0",
Expand Down Expand Up @@ -156,6 +156,7 @@
"react-native-gesture-handler": "^2.9.0",
"react-native-keychain": "7.0.0",
"react-native-linear-gradient": "2.5.6",
"react-native-localize": "^3.0.2",
"react-native-markdown-display": "^7.0.0-alpha.2",
"react-native-pager-view": "^6.2.0",
"react-native-paper": "^4.12.0",
Expand Down Expand Up @@ -236,7 +237,7 @@
"@wdio/mocha-framework": "^7.16.6",
"@wdio/selenium-standalone-service": "^7.25.1",
"@wdio/spec-reporter": "^7.16.4",
"@yoroi/types": "1.2.0",
"@yoroi/types": "1.3.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.2.1",
"babel-loader": "8.2.2",
Expand Down
22 changes: 3 additions & 19 deletions apps/wallet-mobile/src/Catalyst/QrCode.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import {useFocusEffect} from '@react-navigation/native'
import React, {useState} from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {NativeModules, Platform, ScrollView, StyleSheet, View} from 'react-native'
import {ScrollView, StyleSheet, View} from 'react-native'
import QRCodeSVG from 'react-native-qrcode-svg'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button, CopyButton, ProgressStep, Spacer, Text} from '../components'
import {confirmationMessages} from '../i18n/global-messages'
import {useBlockGoBack} from '../navigation'
import {COLORS} from '../theme'
import {useAllowScreenshots} from '../utils'
import {Actions, Description, Title} from './components'
import {useCountdown} from './hooks'
import {VotingRegistrationBackupCheckModal} from './VotingRegistrationBackupCheckModal'

const {FlagSecure} = NativeModules

export const QrCode = ({onNext, votingKeyEncrypted}: {onNext: () => void; votingKeyEncrypted: string}) => {
useBlockGoBack()
useAllowScreenshot()
useAllowScreenshots()
const strings = useStrings()

const [showBackupWarningModal, setShowBackupWarningModal] = useState(false)
Expand Down Expand Up @@ -165,17 +163,3 @@ const useStrings = () => {
completeButton: intl.formatMessage(confirmationMessages.commonButtons.completeButton),
}
}

const useAllowScreenshot = () => {
useFocusEffect(
React.useCallback(() => {
if (Platform.OS === 'android') {
FlagSecure.deactivate()

return () => {
FlagSecure.activate()
}
}
}, []),
)
}
5 changes: 4 additions & 1 deletion apps/wallet-mobile/src/InitApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as Sentry from 'sentry-expo'
import uuid from 'uuid'

import {AppNavigator} from './AppNavigator'
import {useInitScreenShare} from './features/Settings/ScreenShare'
import {CONFIG, isProduction} from './legacy/config'
import {useCrashReportsEnabled} from './yoroi-wallets/hooks'
import {walletManager} from './yoroi-wallets/walletManager'
Expand All @@ -31,6 +32,8 @@ const useInitApp = () => {
const storage = useStorage()
const crashReportsEnabled = useCrashReportsEnabled()

const {initialised: screenShareInitialized} = useInitScreenShare()

useInitSentry({enabled: crashReportsEnabled})

useEffect(() => {
Expand All @@ -42,7 +45,7 @@ const useInitApp = () => {
load()
}, [storage])

return loaded
return loaded && screenShareInitialized
}

const initInstallationId = async (storage: App.Storage) => {
Expand Down
Loading

0 comments on commit 84a64e6

Please sign in to comment.