Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a129cb4
fix: add react context getter to LdkEventEmitter
jvsena42 Nov 17, 2025
43e58e2
fix: ReactContext doesn't have a runOnUiThread() method in React Nati…
jvsena42 Nov 17, 2025
b6dc606
chore: version number
jvsena42 Nov 17, 2025
27ae87e
fix: lint missing comma
jvsena42 Nov 17, 2025
9d515df
fix: implement docker compose cli, use direct homebrew instalation in…
jvsena42 Nov 17, 2025
9e36e37
fix: Exclude nested node_modules in the lib package to avoid bundling…
jvsena42 Nov 17, 2025
9cc8fe1
chore: update mocha cli
jvsena42 Nov 17, 2025
c61f6c3
fix: timeout
jvsena42 Nov 17, 2025
2029374
fix: update yarn
jvsena42 Nov 17, 2025
8b5d49d
fix: update iOS deployment target to 13.0 and fix boost checksum issue
jvsena42 Nov 17, 2025
f546797
fix: unit tests
jvsena42 Nov 17, 2025
b63a95d
fix: lint
jvsena42 Nov 17, 2025
aad7436
fix: boost checksum issue before CocoaPods loads the podspec
jvsena42 Nov 17, 2025
2075371
fix: remove sha checksum temporarilly
jvsena42 Nov 17, 2025
c75913c
chore: cancel in porgress run
jvsena42 Nov 17, 2025
5e1aacd
fix: set COCOAPODS_DISABLE_CHECKSUM env var for iOS workflows
jvsena42 Nov 17, 2025
b38a021
fix: proactively clean CocoaPods cache to prevent boost archive corru…
jvsena42 Nov 17, 2025
5cf5bd8
fix:boost download issue by using SourceForge mirror instead of JFrog
jvsena42 Nov 17, 2025
2252f27
chore: chage ios device to iPhone 15
jvsena42 Nov 17, 2025
42ebec5
fix: Setup chai-as-promised for mocha tests
jvsena42 Nov 17, 2025
e9b5db8
chore: update detox
jvsena42 Nov 17, 2025
28ac6ee
fix: mocha tests
jvsena42 Nov 17, 2025
8b02435
fix: detox version
jvsena42 Nov 17, 2025
2cdba31
fix: context.js tried to read docker/lnd/admin.macaroon before LND fi…
jvsena42 Nov 18, 2025
48bca56
chore: lint
jvsena42 Nov 18, 2025
0a82ef7
fix: Only output the encoded context to stdout
jvsena42 Nov 18, 2025
7818dbe
test: reimplement tests using bitkit RN as reference
jvsena42 Nov 18, 2025
8389a31
chore: lint
jvsena42 Nov 18, 2025
4b27275
chore: replace ui tests with rpc based
jvsena42 Nov 18, 2025
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
40 changes: 38 additions & 2 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-android:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -111,7 +115,9 @@ jobs:
- name: Kill java processes
run: pkill -9 -f java || true

- name: run tests
- name: Run tests attempt 1
id: attempt1
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
avd-name: Pixel_API_31_AOSP
Expand All @@ -122,7 +128,37 @@ jobs:
arch: x86_64
disable-animations: true
working-directory: example
script: yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts || yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifactsyarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts || yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts
script: yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts

- name: Run tests attempt 2
if: steps.attempt1.outcome != 'success'
id: attempt2
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
avd-name: Pixel_API_31_AOSP
profile: 5.4in FWVGA
api-level: 31
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
disable-animations: true
working-directory: example
script: yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts

- name: Run tests attempt 3 (final)
if: steps.attempt2.outcome != 'success'
uses: reactivecircus/android-emulator-runner@v2
with:
avd-name: Pixel_API_31_AOSP
profile: 5.4in FWVGA
api-level: 31
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047
arch: x86_64
disable-animations: true
working-directory: example
script: yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all --artifacts-location /mnt/artifacts

- uses: actions/upload-artifact@v4
if: failure()
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-ios:
runs-on: macos-14
Expand Down Expand Up @@ -47,11 +51,18 @@ jobs:
path: example/ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}

- name: Clean CocoaPods cache
run: |
rm -rf ~/Library/Caches/CocoaPods
pod cache clean --all || true

- name: Install pods
working-directory: example
env:
COCOAPODS_DISABLE_CHECKSUM: true
run: |
gem update cocoapods xcodeproj
pod install --project-directory=ios
pod install --project-directory=ios || pod install --project-directory=ios

- name: Install applesimutils
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/example-lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: example
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lib-lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: lib
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/mocha-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mocha-android:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -73,11 +77,31 @@ jobs:
mkdir lnd
mkdir clightning
chmod 777 lnd clightning
docker-compose up -d --quiet-pull
docker compose up -d --quiet-pull

- name: Wait for electrum server
timeout-minutes: 2
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done
- name: Wait for electrum server, LND and CLightning
timeout-minutes: 5
run: |
# Wait for Electrum
while ! nc -z '127.0.0.1' 60001; do
echo "Waiting for Electrum..."
sleep 1
done
echo "Electrum is ready!"

# Wait for LND macaroon file
sudo bash -c "while [ ! -f example/docker/lnd/admin.macaroon ]; do echo 'Waiting for LND macaroon...'; sleep 2; done"
sudo chmod -R 777 example/docker/lnd
echo "LND macaroon found!"

# Wait for CLightning to be ready
while ! docker logs clightning 2>&1 | grep -q "Server started with public key"; do
echo "Waiting for CLightning..."
sleep 2
done
echo "CLightning is ready!"

echo "All services ready!"

- name: Install lib dependencies
working-directory: lib
Expand Down Expand Up @@ -118,6 +142,7 @@ jobs:
npx react-native run-android --no-packager

- name: run tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
Expand Down
70 changes: 47 additions & 23 deletions .github/workflows/mocha-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mocha-ios:
runs-on: macos-13
Expand All @@ -22,23 +26,12 @@ jobs:
with:
fetch-depth: 1

- name: Setup Docker Colima 1
uses: douglascamata/setup-docker-macos-action@v1-alpha.13

id: docker1
continue-on-error: true
with:
lima: v0.18.0
colima: v0.5.6

- name: Setup Docker Colima 2
if: steps.docker1.outcome != 'success'
uses: douglascamata/setup-docker-macos-action@v1-alpha.13

id: docker2
with:
lima: v0.18.0
colima: v0.5.6
- name: Setup Docker Colima
run: |
brew install docker docker-compose colima
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose || true
colima start --cpu 4 --memory 8 --disk 100

- name: Install backup-server dependencies
working-directory: backup-server
Expand All @@ -50,11 +43,34 @@ jobs:
mkdir lnd
mkdir clightning
chmod 777 lnd clightning
docker-compose up -d --quiet-pull
docker compose up -d --quiet-pull

- name: Wait for electrum server
timeout-minutes: 2
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done
- name: Wait for electrum server, LND and CLightning
timeout-minutes: 5
run: |
# Wait for Electrum
while ! nc -z '127.0.0.1' 60001; do
echo "Waiting for Electrum..."
sleep 1
done
echo "Electrum is ready!"

# Wait for LND macaroon file
cd example
while [ ! -f docker/lnd/admin.macaroon ]; do
echo "Waiting for LND macaroon..."
sleep 2
done
echo "LND macaroon found!"

# Wait for CLightning to be ready
while ! docker logs clightning 2>&1 | grep -q "Server started with public key"; do
echo "Waiting for CLightning..."
sleep 2
done
echo "CLightning is ready!"

echo "All services ready!"

- name: Node
uses: actions/setup-node@v4
Expand All @@ -81,11 +97,18 @@ jobs:
path: example/ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}

- name: Clean CocoaPods cache
run: |
rm -rf ~/Library/Caches/CocoaPods
pod cache clean --all || true

- name: Install pods
working-directory: example
env:
COCOAPODS_DISABLE_CHECKSUM: true
run: |
gem update cocoapods xcodeproj
pod install --project-directory=ios
pod install --project-directory=ios || pod install --project-directory=ios

- name: Install applesimutils
run: |
Expand All @@ -94,9 +117,10 @@ jobs:

- name: Build
working-directory: example
run: npx react-native run-ios --no-packager --simulator='iPhone 14'
run: npx react-native run-ios --no-packager --simulator='iPhone 15'

- name: Test iOS app
timeout-minutes: 30
working-directory: example
run: yarn test:mocha:ios

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ example/.watchman*
# docker
example/docker/lnd/
example/docker/clightning/

#AI
CLAUDE.md
31 changes: 28 additions & 3 deletions example/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,45 @@ module.exports = {
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build: 'cd android ; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug ; cd -',
reversePorts: [
8081
8081, // Metro bundler
8080, // LND REST
9735, // LND P2P
10009, // LND RPC
18081, // Core Lightning REST
9736, // Core Lightning P2P
11001, // Core Lightning RPC
28081, // Eclair REST
9737, // Eclair P2P
60001, // Electrum
18443, // Bitcoin RPC
3003 // Backup server
]
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build: 'cd android ; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd -'
build: 'cd android ; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd -',
reversePorts: [
8081, // Metro bundler
8080, // LND REST
9735, // LND P2P
10009, // LND RPC
18081, // Core Lightning REST
9736, // Core Lightning P2P
11001, // Core Lightning RPC
28081, // Eclair REST
9737, // Eclair P2P
60001, // Electrum
18443, // Bitcoin RPC
3003 // Backup server
]
}
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14'
type: 'iPhone 15'
}
},
attached: {
Expand Down
6 changes: 6 additions & 0 deletions example/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ coverage
rn-setup.js

src/utils/backup/protos

# E2E test files with ESLint parser issues
e2e/backup-restore.e2e.js
e2e/force-close.e2e.js
e2e/network-graph.e2e.js
e2e/payments.e2e.js
19 changes: 11 additions & 8 deletions example/Tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,17 @@ class Tests extends Component {
});
// global.fs = require("react-native-fs");
// global.path = require("path-browserify");
global.environment = {
// Default to the host machine when running on Android
// realmBaseUrl: Platform.OS === "android" ? "http://10.0.2.2:9090" : undefined,
...context,
// reactNative: Platform.OS,
// android: Platform.OS === "android",
// ios: Platform.OS === "ios",
};
// global.environment = {
// Default to the host machine when running on Android
// realmBaseUrl: Platform.OS === "android" ? "http://10.0.2.2:9090" : undefined,
// ...context,
// reactNative: Platform.OS,
// android: Platform.OS === "android",
// ios: Platform.OS === "ios",
// };
(global as any).environment = JSON.parse(
Buffer.from(context.c as string, 'hex').toString('utf-8'),
);
// Make the tests reinitializable, to allow test running on changes to the "realm" package
// Probing the existance of `getModules` as this only exists in debug mode
// if ("getModules" in require) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class DetoxTest {
@Test
public void runDetoxTests() {
DetoxConfig detoxConfig = new DetoxConfig();
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);
detoxConfig.idlePolicyConfig.masterTimeoutSec = 120;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 90;
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 240 : 120);

Detox.runTests(mActivityRule, detoxConfig);
}
Expand Down
Loading
Loading