Skip to content

Commit

Permalink
Merge branch 'develop' into production
Browse files Browse the repository at this point in the history
Signed-off-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com>
  • Loading branch information
stackchain authored Jul 31, 2023
2 parents d67eed8 + 1685107 commit f58cf0d
Show file tree
Hide file tree
Showing 68 changed files with 8,126 additions and 7,416 deletions.
94 changes: 94 additions & 0 deletions apps/wallet-mobile/.detoxrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/** @type {Detox.DetoxConfig} */
module.exports = {
testRunner: {
args: {
'$0': 'jest',
config: 'e2e/jest.config.js'
},
jest: {
setupTimeout: 120000
}
},
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/yoroi.app',
build: 'xcodebuild -workspace ios/yoroi.xcworkspace -scheme yoroi -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build'
},
'ios.release': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/yoroi.app',
build: 'xcodebuild -workspace ios/yoroi.xcworkspace -scheme yoroi -configuration Release -sdk iphonesimulator -derivedDataPath ios/build'
},
'android.dev.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/dev/debug/app-dev-debug.apk',
build: 'ENVFILE=.env cd android && ./gradlew assembleDevDebug assembleDevDebugAndroidTest -DtestBuildType=debug',
reversePorts: [
8081
]
},
'android.nightly.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/nightly/release/app-nightly-release.apk',
build: 'ENVFILE=.env.nightly cd android && ./gradlew assembleNightlyRelease assembleNightlyReleaseAndroidTest -DtestBuildType=release',
reversePorts: [
8081
]
}
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14'
}
},
attached: {
type: 'android.attached',
device: {
adbName: '.*'
}
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Pixel_3_e2e'
}
}
},
configurations: {
'ios.sim.debug': {
device: 'simulator',
app: 'ios.debug'
},
'ios.sim.release': {
device: 'simulator',
app: 'ios.release'
},
'android.att.debug': {
device: 'attached',
app: 'android.debug'
},
'android.att.release': {
device: 'attached',
app: 'android.release'
},
'android.emu.dev.debug': {
device: 'emulator',
app: 'android.dev.debug'
},
'android.emu.release': {
device: 'emulator',
app: 'android.release'
},
'android.emu.nightly.release': {
device: 'emulator',
app: 'android.nightly.release'
},
'android.att.nightly.release': {
device: 'attached',
app: 'android.nightly.release'
}
}
};
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COMMIT=cc2ffa0d
BUILD_VARIANT=STAGING
SENTRY=https://fb3745d47d994059917e358dae581466@o1138840.ingest.sentry.io/4505319746764800

DISABLE_LOG_BOX=true
DISABLE_LOGBOX=true
SHOW_PROD_POOLS_IN_DEV=true
USE_TESTNET=true

Expand Down
23 changes: 18 additions & 5 deletions apps/wallet-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 529
versionName "4.13.0"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

splits {
Expand All @@ -134,13 +136,15 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
}
}

Expand Down Expand Up @@ -181,25 +185,29 @@ android {
}

dependencies {

androidTestImplementation('com.wix:detox:+')
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
// implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')

// If your app supports Android versions before Ice Cream Sandwich (API level 14)
implementation 'com.facebook.fresco:animated-base-support:1.3.0'
implementation('com.facebook.fresco:animated-base-support:1.3.0')

// For animated GIF support
implementation 'com.facebook.fresco:animated-gif:2.5.0'
implementation ('com.facebook.fresco:animated-gif:2.5.0')

// For WebP support, including animated WebP
implementation 'com.facebook.fresco:animated-webp:2.5.0'
implementation ('com.facebook.fresco:animated-webp:2.5.0')
implementation 'com.facebook.fresco:webpsupport:2.5.0'

// For WebP support, without animations
implementation 'com.facebook.fresco:webpsupport:2.5.0'
implementation ('com.facebook.fresco:webpsupport:2.5.0')

// react-native-bootsplash
implementation("androidx.core:core-splashscreen:1.0.0")
Expand All @@ -215,6 +223,11 @@ dependencies {
} else {
implementation jscFlavor
}

}

configurations.implementation {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}

apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.emurgo; // (1)

import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;

@RunWith(AndroidJUnit4.class)
@LargeTest
public class DetoxTest {
@Rule // (2)
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);

@Test
public void runDetoxTests() {
DetoxConfig detoxConfig = new DetoxConfig();
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);

Detox.runTests(mActivityRule, detoxConfig);
}
}
3 changes: 2 additions & 1 deletion apps/wallet-mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/BootTheme">
android:theme="@style/BootTheme"
android:networkSecurityConfig="@xml/network_security_config">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
42 changes: 42 additions & 0 deletions apps/wallet-mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,61 @@ buildscript {
maven {
url 'https://www.jitpack.io'
}

}
dependencies {
classpath "com.android.tools.build:gradle:7.3.1"
classpath "com.facebook.react:react-native-gradle-plugin"
classpath "org.mozilla.rust-android-gradle:plugin:0.9.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"
}
}


allprojects {

repositories {

mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// All of Detox' artifacts are provided via the npm module
url("$rootDir/../../../node_modules/detox/Detox-android")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
// react-native-ble-plx setup
// https://github.com/Polidea/react-native-ble-plx (@2.0.0)
maven { url 'https://jitpack.io' }

maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../../../node_modules/expo-camera/android/maven"
}
}

afterEvaluate {
if (it.hasProperty('android')){
android {
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion // Replace '21' with whatever suites your case
}
}
}
}
}
5 changes: 4 additions & 1 deletion apps/wallet-mobile/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ newArchEnabled=false
hermesEnabled=true

# Increases the sql lite limit default 6MB
AsyncStorage_db_size_in_MB=32
AsyncStorage_db_size_in_MB=32

#avoid adding the stdlib by default
kotlin.stdlib.default.dependency=false
10 changes: 0 additions & 10 deletions apps/wallet-mobile/e2e/config.json

This file was deleted.

84 changes: 84 additions & 0 deletions apps/wallet-mobile/e2e/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
export enum WalletType {
NormalWallet,
DaedalusWallet,
}

/**
* @property {String} checksum wallet checksum
* @property {String} name wallet name
* @property {Array<String>} phrase wallet recovery phrase
* @property {WalletType} type a 15-word wallet or a 24-word wallet
*/
type RestoredWallet = {
checksum: string
name: string
phrase: string[]
type: WalletType
}

export const VALID_PIN = '123456'
export const WALLET_NAME = 'New Test Wallet'
export const LEDGER_WALLET_NAME = 'Test Ledger'
export const SPENDING_PASSWORD = '1234567890'
export const ADA_TOKEN = 'ADA'
export const TADA_TOKEN = 'TADA'
export const STAKE_POOL_ID = 'fe662c24cf56fb98626161f76d231ac50ab7b47dd83986a30c1d4796'
export const APP_ID = 'com.emurgo.nightly'
export const APP_ID_PARENT = 'com.emurgo.*'
export const NORMAL_15_WORD_WALLET: RestoredWallet = {
checksum: 'CONL-2085',
name: 'RTW-15-word',
phrase: [
'ritual',
'nerve',
'sweet',
'social',
'level',
'pioneer',
'cream',
'artwork',
'material',
'three',
'thumb',
'melody',
'zoo',
'fence',
'east',
],
type: WalletType.NormalWallet,
}
export const NORMAL_24_WORD_WALLET: RestoredWallet = {
name: 'RTW-24-word',
checksum: 'CCPL-3231',
phrase: [
'like',
'project',
'body',
'tribe',
'track',
'wheat',
'noble',
'blur',
'reflect',
'tomorrow',
'beach',
'document',
'market',
'enforce',
'clever',
'submit',
'gorilla',
'hockey',
'can',
'surge',
'fossil',
'asthma',
'salmon',
'cry',
],
type: WalletType.DaedalusWallet,
}
export const RESTORED_WALLETS: RestoredWallet[] = [
NORMAL_15_WORD_WALLET,
NORMAL_24_WORD_WALLET,
]
Loading

0 comments on commit f58cf0d

Please sign in to comment.