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

[Wallet] A few docs and build cleanup #1138

Merged
merged 3 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions packages/mobile/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ DEFAULT_TESTNET=alfajoresstaging
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=debug
INSTABUG_TOKEN=
INSTABUG_EVENTS=
LOCAL_CURRENCY_SYMBOL=MXN
SHOW_TESTNET_BANNER=true
2 changes: 0 additions & 2 deletions packages/mobile/.env.alfajores
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajores-dot-celo-testnet-production.appspot.com/
DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
INSTABUG_TOKEN=
INSTABUG_EVENTS=button,shake
LOCAL_CURRENCY_SYMBOL=
SHOW_TESTNET_BANNER=true
2 changes: 0 additions & 2 deletions packages/mobile/.env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://integration-dot-celo-testnet.appspot.com/
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=integration
INSTABUG_TOKEN=
INSTABUG_EVENTS=button,shake
LOCAL_CURRENCY_SYMBOL=
SHOW_TESTNET_BANNER=true
2 changes: 0 additions & 2 deletions packages/mobile/.env.pilot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://pilot-dot-celo-testnet-production.appspot.com/
DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
INSTABUG_TOKEN=
INSTABUG_EVENTS=button,shake
LOCAL_CURRENCY_SYMBOL=MXN
SHOW_TESTNET_BANNER=false
2 changes: 0 additions & 2 deletions packages/mobile/.env.pilotstaging
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://pilotstaging-dot-celo-testnet.appspot.com/
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=pilotstaging
INSTABUG_TOKEN=
INSTABUG_EVENTS=button,shake
LOCAL_CURRENCY_SYMBOL=MXN
SHOW_TESTNET_BANNER=false
2 changes: 0 additions & 2 deletions packages/mobile/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://argentinaproduction-dot-celo-testnet-production.appsp
DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
INSTABUG_TOKEN=
INSTABUG_EVENTS=shake
LOCAL_CURRENCY_SYMBOL=
SHOW_TESTNET_BANNER=false
2 changes: 0 additions & 2 deletions packages/mobile/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajoresstaging-dot-celo-testnet.appspot.com/
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=staging
INSTABUG_TOKEN=
INSTABUG_EVENTS=shake
LOCAL_CURRENCY_SYMBOL=
SHOW_TESTNET_BANNER=
2 changes: 0 additions & 2 deletions packages/mobile/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajores-dot-celo-testnet-production.appspot.com
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=false
SECRETS_KEY=debug
INSTABUG_TOKEN=
INSTABUG_EVENTS=
LOCAL_CURRENCY_SYMBOL=MXN
SHOW_TESTNET_BANNER=false
38 changes: 34 additions & 4 deletions packages/mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ before rebuilding the app. Note that this will assume the testnets have a corres

To execute the suite of tests, run `yarn test`

## Snapshot testing
### Snapshot testing

We use Jest [snapshot testing][jest] to assert that no intentional changes to the
component tree have been made without explicit developer intention. See an
Expand All @@ -116,7 +116,7 @@ react components. It allows for deep rendering and interaction with the rendered
tree to assert proper reactions to user interaction and input. See an example at
[`src/send/SendAmount.test.tsx`] or read more about the [docs][rntl-docs]

## Saga testing
### Saga testing

We use [redux-saga-test-plan][redux-saga-test-plan] to test complex sagas.
See [`src/identity/verification.test.ts`] for an example.
Expand All @@ -140,11 +140,41 @@ Next, the VM snapshot settings should be modified:
For information on how to run and extend the e2e tests, refer to the
[e2e readme][e2e readme].

## Building APKs / Bundles

The app can be build via the command line or in Android Studio.
For an exact set of commands, refer to the lanes in `fastlane/FastFile`.
For convinience, the basic are described below:

### Creating a fake keystore

If you have not yet created a keystore, one will be required to generate a release APKs / bundles:

```sh
cd android/app
keytool -genkey -v -keystore celo-release-key.keystore -alias celo-key-alias -storepass celoFakeReleaseStorePass -keypass celoFakeReleaseKeyPass -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
export CELO_RELEASE_STORE_PASSWORD=celoFakeReleaseStorePass
export CELO_RELEASE_KEY_PASSWORD=celoFakeReleaseKeyPass
```

### Building an APK or Bundle

```sh
cd android/
./gradlew clean
./gradlew bundle{YOUR_BUILDING_VARIANT}JsAndAssets
# For an APK:
./gradlew assemble{YOUR_BUILDING_VARIANT} -x bundle{YOUR_BUILDING_VARIANT}JsAndAssets
# Or for a bundle:
./gradlew bundle{YOUR_BUILDING_VARIANT} -x bundle{YOUR_BUILDING_VARIANT}JsAndAssets
```

Where `YOUR_BUILD_VARIANT` can be any of the app's build variants, such as debug or release.

## Generating GraphQL Types

We're using [GraphQL Code Generator][graphql code generator] to properly type
GraphQL queries. If you make a change to a query, run `yarn run gen-types` to
update the typings in the `typings` directory.
GraphQL queries. If you make a change to a query, run `yarn build:gen-graphql-types` to update the typings in the `typings` directory.

## Troubleshooting

Expand Down
1 change: 0 additions & 1 deletion packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ android {
dependencies {
implementation project(':react-native-install-referrer')
implementation project(':react-native-send-intent')
// implementation project(':instabug-reactnative')
// implementation project(':react-native-screens')
Copy link
Contributor

@jeanregisser jeanregisser Oct 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated: do you know why react-native-screens was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmcewen do you remember why react-native-screens was disabled?

implementation project(':react-native-webview')
implementation project(':@react-native-community_netinfo')
Expand Down
2 changes: 0 additions & 2 deletions packages/mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />

<application android:name=".MainApplication" android:allowBackup="true" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:screenOrientation="portrait" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/app_name" android:launchMode="singleInstance" android:theme="@style/AppTheme" android:windowSoftInputMode="adjustResize">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@

// Disabled due to dex count
// import com.swmansion.rnscreens.RNScreensPackage;
// import com.instabug.library.invocation.InstabugInvocationEvent;
// import com.instabug.reactlibrary.RNInstabugReactnativePackage;

public class MainApplication extends Application implements ShareApplication, ReactApplication {

Expand Down Expand Up @@ -126,20 +124,6 @@ protected List<ReactPackage> getPackages() {
packageList.add(new RNConfirmDeviceCredentialsPackage());
}

// Instabug - disabled due to dex count
//
// String tempInvocationEvents = BuildConfig.INSTABUG_EVENTS;
// String[] instabugInvocationEvents = tempInvocationEvents.split(",");

// if (instabugInvocationEvents.length > 0) {
// packageList.add(new RNInstabugReactnativePackage.Builder(BuildConfig.INSTABUG_TOKEN, MainApplication.this)
// .setInvocationEvent(instabugInvocationEvents)
// .setPrimaryColor("#42D689")
// .setFloatingEdge("right")
// .setFloatingButtonOffsetFromTop(250)
// .build());
// }

return packageList;
}

Expand Down
3 changes: 0 additions & 3 deletions packages/mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ allprojects {
flatDir {
dirs celoClientDirectory
}
maven {
url "https://sdks.instabug.com/nexus/repository/instabug-cp"
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions packages/mobile/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ include ':react-native-send-intent'
project(':react-native-send-intent').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-send-intent/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-webview/android')
include ':instabug-reactnative'
project(':instabug-reactnative').projectDir = new File(rootProject.projectDir, '../../../node_modules/instabug-reactnative/android')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../../../node_modules/@react-native-community/netinfo/android')
include ':react-native-screens'
Expand Down
1 change: 0 additions & 1 deletion packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"google-libphonenumber": "^3.2.4",
"graphql": "^14.1.1",
"i18next": "^11.9.1",
"instabug-reactnative": "^8.4.3",
"js-sha3": "^0.7.0",
"lodash": "^4.17.14",
"moment": "^2.22.1",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17535,11 +17535,6 @@ inquirer@^6.2.2, inquirer@~6.3.1:
strip-ansi "^5.1.0"
through "^2.3.6"

instabug-reactnative@^8.4.3:
version "8.4.3"
resolved "https://registry.yarnpkg.com/instabug-reactnative/-/instabug-reactnative-8.4.3.tgz#a169b2c2fe81984f8400d04b7bb6aba403ddf3e2"
integrity sha512-NOjl1aMDQPeqa9XpaF38nMWKZ/YTSZEQ5uOhdAcAP8mNjd0W4Pr/Cdx1SZcRztqiJgYPgcp8d5dcvDOGZeKkzw==

interpret@1.2.0, interpret@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
Expand Down