Skip to content

Commit c9a5455

Browse files
authored
Merge pull request #114 from XRPL-Labs/develop
v3.0.0
2 parents e222dca + d497e6f commit c9a5455

File tree

1,259 files changed

+36964
-21644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,259 files changed

+36964
-21644
lines changed

.detoxrc.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,45 @@
11
module.exports = {
22
apps: {
3-
'ios.debug': {
4-
type: 'ios.app',
5-
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Xaman.app',
6-
build: 'xcodebuild -workspace ios/Xaman.xcworkspace -scheme Xaman -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
7-
},
8-
'ios.release': {
3+
'xaman.ios': {
94
type: 'ios.app',
105
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Xaman.app',
116
build: 'xcodebuild -workspace ios/Xaman.xcworkspace -scheme Xaman -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
127
},
13-
'android.debug': {
14-
type: 'android.apk',
15-
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
16-
build: 'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..',
17-
},
18-
'android.release': {
8+
'xaman.android': {
199
type: 'android.apk',
20-
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
10+
binaryPath: 'android/app/build/outputs/apk/release/app-x86_64-release.apk',
2111
build: 'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..',
2212
},
2313
},
2414
devices: {
2515
'ios.simulator': {
2616
type: 'ios.simulator',
17+
headless: process.env.CI ? true : undefined,
2718
device: { type: 'iPhone 15 Pro' },
2819
},
2920
'android.emulator': {
3021
type: 'android.apk',
3122
device: { avdName: 'Nexus_5X_API_28' },
3223
},
24+
'android.attached': {
25+
type: 'android.attached',
26+
device: {
27+
adbName: '.*',
28+
},
29+
},
3330
},
3431
configurations: {
35-
'ios.sim.debug': {
36-
device: 'ios.simulator',
37-
app: 'ios.debug',
38-
},
39-
'ios.sim.release': {
32+
'ios.simulator+xaman.ios': {
4033
device: 'ios.simulator',
41-
app: 'ios.release',
34+
app: 'xaman.ios',
4235
},
43-
'android.emu.debug': {
36+
'android.emulator+xaman.android': {
4437
device: 'android.emulator',
45-
app: 'android.debug',
38+
app: 'xaman.android',
39+
},
40+
'android.attached+xaman.android': {
41+
device: 'android.attached',
42+
app: 'xaman.android',
4643
},
4744
},
4845
};

.eslintrc

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"@typescript-eslint",
55
"react-native",
66
"prettier",
7-
"jest",
8-
"spellcheck"
7+
"jest"
98
],
109
"extends": [
1110
"airbnb",
@@ -57,10 +56,13 @@
5756
"arrow-body-style": 0,
5857
"max-len": [2, {"code": 120, "tabWidth": 4, "ignoreUrls": true, "ignoreTemplateLiterals": true }],
5958
"quotes": ["error", "single"],
60-
"semi": ["error", "always"],
59+
"semi": "off",
60+
"@typescript-eslint/semi": "error",
61+
"@typescript-eslint/member-delimiter-style": "error",
62+
// "@typescript-eslint/no-explicit-any": "error",
6163
"curly": [2, "multi-line"],
6264
"comma-dangle": [2, "always-multiline"],
63-
"class-methods-use-this": ["error", {"enforceForClassFields": false, "exceptMethods": ["startApp", "componentDidMount", "componentWillUnmount", "render"] }],
65+
"class-methods-use-this": ["off", {"enforceForClassFields": false, "exceptMethods": ["startApp", "componentDidMount", "componentWillUnmount", "render"] }],
6466
"global-require": 0,
6567
"quote-props": 0,
6668
"lines-between-class-members": "off",
@@ -132,33 +134,6 @@
132134
"jest/no-disabled-tests": 1,
133135
"jest/no-focused-tests": 2,
134136
"jest/no-identical-title": 2,
135-
"react/no-unused-class-component-methods": 0,
136-
"spellcheck/spell-checker": [1, {
137-
"comments": true,
138-
"strings": true,
139-
"identifiers": true,
140-
"lang": "en_US",
141-
"skipWords": [
142-
"eslint", "redux", "middleware", "destructuring", "async", "lodash", "libs", "Backend", "istanbul", "rehydrate", "linebreak",
143-
"decrypt", "Keychain", "passphrase", "nonexist", "js", "Crashlytics", "Analytics", "init", "Onboarding", "middlewares",
144-
"firebase", "ios", "const", "renderer", "dev", "fallbacks", "Utils", "sha512", "sha256", "sha1", "fn", "ja", "cn", "auth",
145-
"cb", "loggin", "api", "src", "biometric", "Biometry", "rtl", "grey", "Unmount", "passcode", "Selectable", "png", "xrpl", "accountlib",
146-
"Prev", "orm", "reselect", "keypair", "readonly", "uuid", "uuidv4", "desc", "sml", "wss", "altnet", "rippletest", "ws", "args",
147-
"tx", "namespace", "bignumber", "Xrp", "counterparty", "str", "params", "req", "eg", "param", "timestamp", "idempotency", "Num", "testnet",
148-
"utf", "xumm", "netinfo", "uri", "Interactable", "bool", "schemas", "Ious", "upsert", "Trustline", "rpepoch", "unix", "iso8601", "ecrypt",
149-
"privatekey", "multisign", "tes", "Reactotron", "resize", "Interitem", "multisigned", "txid", "rgba", "jsx", "uint8", "img", "btn", "pbold",
150-
"Devnet", "Mainnet", "Swiper", "calc", "abcdefgh", "cancelable", "uniqBy", "memoize", "Memoized", "html", "len", "fg", "bg", "ctx", "checksum",
151-
"ecc", "uniq", "Truthy", "Responder", "ter", "ko", "zh", "mailto", "tabbar", "https", "gcm", "tf", "xlight", "aps", "tec", "barcodes", "Barcode",
152-
"txblob", "tos", "gif", "ic", "asf", "ok", "Sig", "haptic", "Signable", "Unauthorize", "Preauth", "payid", "Biometrics", "Towo", "tz", "xrpscan",
153-
"xrplorer", "bithomp", "xpring", "xrplns", "Pincode", "Txn", "iap", "Realtime", "datastore", "decrypted", "Tangem", "Sdk", "Secp256k1", "blockchain",
154-
"Escrowed", "xapp", "Veriff", "Codec", "xapps", "Pressable", "nft", "ott", "Luminance", "HexToRgbA", "Misconfiguration", "kyc", "debounce", "debounced",
155-
"nfc", "lsf", "nfts", "Taxon", "fioprotocol", "iou", "dy", "vy", "pb", "nf", "origintype", "Xaman", "xls20", "livenet", "feeunits", "Preflight", "ctid",
156-
"explainer", "Cancelled", "nftoken", "Remint", "amm"
157-
],
158-
"skipIfMatch": [
159-
"http://[^s]*",
160-
"^[-\\w]+\/[-\\w\\.]+$"
161-
]
162-
}]
137+
"react/no-unused-class-component-methods": 0
163138
}
164139
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: prepare-cocoapods
2+
description: Prepare Cocoapods
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Cache Pods
8+
uses: actions/cache@v4
9+
id: podcache
10+
with:
11+
path: ios/Pods
12+
key: pods-${{ hashFiles('**/Podfile.lock') }}
13+
14+
- name: Install Pods dependencies
15+
env:
16+
LC_ALL: en_US.UTF-8
17+
shell: bash
18+
run: |
19+
cd ios && \
20+
pod install
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: prepare-environment
2+
description: Prepare development environment
3+
4+
inputs:
5+
cocoapods:
6+
description: 'Setup env with cocoapods'
7+
required: false
8+
default: 'false'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 18.x
17+
18+
- name: Cache node_modules/
19+
uses: actions/cache@v4
20+
with:
21+
path: node_modules
22+
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.OS }}-npm-cache-
25+
26+
- name: Install Node dependencies
27+
shell: bash
28+
run: npm ci
29+
30+
- name: Prepare cocoapods
31+
if: "${{ inputs.cocoapods == 'true' }}"
32+
uses: ./.github/actions/prepare-cocoapods
33+
34+
- name: Prepare source code
35+
shell: bash
36+
run: |
37+
./scripts/build-env.sh
38+
mv src/app.tsx src/app.tsx.old && cat src/app.tsx.old|perl -pe'BEGIN{undef $/;} s/if \(isJailBroken.+?}/\/\/ No root or jailbreak detection/gms' > src/app.tsx
39+

.github/workflows/android.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: android
2+
env:
3+
CI: true
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ develop, master ]
10+
11+
jobs:
12+
build-test:
13+
if: github.event.pull_request.draft == false
14+
runs-on: [ self-hosted, macOS, ARM64 ]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
21+
- name: Prepare Environment
22+
uses: ./.github/actions/prepare-env
23+
24+
- name: Get version details from build.gradle
25+
run: |
26+
VERSION_CODE=$(awk -F'=' '/canonicalVersionCode/ {print $2; exit}' android/app/build.gradle | tr -d ' ')
27+
VERSION_NAME=$(awk -F'=' '/canonicalVersionName/ {print $2; exit}' android/app/build.gradle | tr -d ' ' | tr -d '"')
28+
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
29+
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
30+
echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
31+
32+
- name: Build tests
33+
working-directory: android
34+
run: ./gradlew app:assembleAndroidTest
35+
36+
- name: Run tests
37+
uses: reactivecircus/android-emulator-runner@v2
38+
with:
39+
api-level: 34
40+
avd-name: ci-actions-avd
41+
target: google_apis
42+
arch: arm64-v8a
43+
ndk: 25.1.8937393
44+
cmake: 3.18.1
45+
script: cd android; ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.notClass=com.xrpllabs.xumm.DetoxTest --info
46+
47+
- name: Test Summary
48+
uses: test-summary/action@dist
49+
with:
50+
paths: android/app/build/outputs/androidTest-results/connected/**/*.xml
51+
show: "all"
52+
if: always()
53+
54+
- name: Build APK
55+
working-directory: android
56+
run: ./gradlew app:assembleRelease --quiet
57+
58+
- name: Upload APK dev release
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: ${{ env.TIMESTAMP }}_Xaman_${{ env.VERSION_NAME }}_${{ env.VERSION_CODE }} APK(s)
62+
path: android/app/build/outputs/apk/release/

.github/workflows/e2e.yml

Lines changed: 24 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,44 @@
11
name: e2e
2+
env:
3+
CI: true
4+
DETOX_CONFIGURATION: ios.simulator+xaman.ios
25

3-
on: [pull_request]
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ develop, master ]
411

512
jobs:
6-
build-run:
7-
if: "contains(github.event.commits[0].message, '[include e2e]')"
8-
runs-on: macos-11
13+
build-test:
14+
if: github.event.pull_request.draft == false
15+
runs-on: [ self-hosted, macOS, ARM64 ]
916

1017
steps:
11-
- name: Setup Xcode
12-
uses: maxim-lobanov/setup-xcode@v1.1
13-
with:
14-
xcode-version: latest-stable
15-
1618
- name: Checkout
17-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1820
with:
1921
fetch-depth: 1
2022

21-
- name: Node
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: 18.x
25-
26-
- run: node --version
27-
28-
- name: Cache node modules
29-
uses: actions/cache@v1
30-
id: cache
23+
- name: Prepare Environment
24+
uses: ./.github/actions/prepare-env
3125
with:
32-
path: node_modules
33-
key: node-modules-${{ hashFiles('**/package-lock.json') }}
26+
cocoapods: 'true'
3427

3528
- name: Rebuild detox
36-
if: steps.cache.outputs.cache-hit == 'true'
37-
run: npx detox clean-framework-cache && npx detox build-framework-cache
38-
39-
- name: Install Dependencies
40-
if: steps.cache.outputs.cache-hit != 'true'
41-
run: npm ci
42-
43-
- name: Cache Pods
44-
uses: actions/cache@v1
45-
id: podcache
46-
with:
47-
path: ios/Pods
48-
key: pods-${{ hashFiles('**/Podfile.lock') }}
49-
50-
- name: Update Pods
5129
run: |
52-
gem update cocoapods xcodeproj
53-
cd ios && pod install && cd ..
54-
- name: Prepare
55-
run: |
56-
brew tap wix/brew
57-
brew install applesimutils
58-
make build-env
59-
make generate-locales
60-
mv src/app.tsx src/app.tsx.old && cat src/app.tsx.old|perl -pe'BEGIN{undef $/;} s/if \(isJailBroken.+?}/\/\/ No root or jailbreak detection/gms' > src/app.tsx
30+
npx detox clean-framework-cache
31+
npx detox build-framework-cache
32+
33+
- name: Build app for detox
34+
run: npx detox build e2e --configuration ${DETOX_CONFIGURATION} --if-missing
6135

62-
- run: npx detox build e2e --configuration ios.sim.release
63-
- run: npx cucumber-js ./e2e --configuration ios.sim.release
36+
- name: Run e2e tests
37+
run: npx cucumber-js ./e2e test
6438

6539
- name: Upload artifact files
6640
if: ${{ always() }}
67-
uses: actions/upload-artifact@v2
41+
uses: actions/upload-artifact@v4
6842
with:
69-
name: artifact
43+
name: e2e artifact
7044
path: e2e/artifacts/

.github/workflows/ios.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: ios
2+
env:
3+
CI: true
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ develop, master ]
10+
11+
jobs:
12+
build-test:
13+
if: github.event.pull_request.draft == false
14+
runs-on: [ self-hosted, macOS, ARM64 ]
15+
strategy:
16+
matrix:
17+
ios: [ 17.4 ]
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 1
23+
24+
- name: Prepare Environment
25+
uses: ./.github/actions/prepare-env
26+
with:
27+
cocoapods: 'true'
28+
29+
- name: Run tests
30+
working-directory: ios
31+
run: |
32+
xcodebuild -quiet -workspace Xaman.xcworkspace -scheme Xaman -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=${{ matrix.ios }}' -resultBundlePath TestResults test
33+
34+
- name: Test Summary
35+
uses: kishikawakatsumi/xcresulttool@v1
36+
with:
37+
path: ios/TestResults.xcresult
38+
if: success() || failure()

0 commit comments

Comments
 (0)