Skip to content

Commit f845653

Browse files
authored
feat: use uniffi-dart
2 parents a80981b + 47de04c commit f845653

25 files changed

+728
-1683
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, "**" ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Setup Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
24+
- name: Setup Dart
25+
uses: dart-lang/setup-dart@v1
26+
27+
- name: Install lipo (macOS)
28+
if: matrix.os == 'macos-latest'
29+
run: |
30+
which lipo || echo 'lipo available in Xcode toolchain'
31+
32+
- name: Generate bindings and native library
33+
run: |
34+
chmod +x scripts/generate_bindings.sh
35+
./scripts/generate_bindings.sh
36+
37+
- name: Ensure generated bindings exist
38+
run: test -f lib/bdk.dart
39+
40+
- name: Pub get
41+
run: dart pub get
42+
43+
- name: Format check
44+
run: dart format --output=none --set-exit-if-changed .
45+
46+
- name: Analyze
47+
run: dart analyze --fatal-infos --fatal-warnings
48+
49+
- name: Run tests
50+
run: |
51+
dart test

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ Cargo.lock
2222
Thumbs.db
2323

2424
# Logs
25-
*.log
25+
*.log
26+
27+
# Native libs built locally
28+
libbdkffi.*
29+
test_output.txt
30+
test output.txt
31+
lib/bdk.dart

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "uniffi-dart"]
2-
path = uniffi-dart
3-
url = https://github.com/NiallBunting/uniffi-rs-dart.git
41
[submodule "bdk-ffi"]
52
path = bdk-ffi
63
url = https://github.com/bitcoindevkit/bdk-ffi.git

Cargo.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0"
99
[lib]
1010
crate-type = ["lib", "staticlib", "cdylib"]
1111
name = "bdkffi"
12+
path = "bdk-ffi/bdk-ffi/src/lib.rs"
1213

1314
[[bin]]
1415
name = "uniffi-bindgen"
@@ -18,19 +19,21 @@ path = "uniffi-bindgen.rs"
1819
default = ["uniffi/cli"]
1920

2021
[dependencies]
21-
bdk_wallet = { version = "2.0.0", features = ["all-keys", "keys-bip39", "rusqlite"] }
22-
bdk_esplora = { version = "0.22.0", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
23-
bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls-ring"] }
24-
bdk_kyoto = { version = "0.13.1" }
22+
bdk_wallet = { version = "2.2.0", features = ["all-keys", "keys-bip39", "rusqlite"] }
23+
bdk_esplora = { version = "0.22.1", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
24+
bdk_electrum = { version = "0.23.2", default-features = false, features = ["use-rustls-ring"] }
25+
bdk_kyoto = { version = "0.15.1" }
2526

26-
uniffi = { version = "=0.29.1" }
27-
thiserror = "1.0.58"
27+
uniffi = { version = "=0.29.4" }
28+
uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "946c5642c0521a184c4b52dcf0d203edb97f1ffc" }
29+
thiserror = "1.0.65"
2830

2931
[build-dependencies]
30-
uniffi = { version = "=0.29.1", features = ["build"] }
32+
uniffi = { version = "=0.29.4", features = ["build"] }
33+
uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "946c5642c0521a184c4b52dcf0d203edb97f1ffc", features = ["build"] }
3134

3235
[dev-dependencies]
33-
uniffi = { version = "=0.29.1", features = ["bindgen-tests"] }
36+
uniffi = { version = "=0.29.4", features = ["bindgen-tests"] }
3437
assert_matches = "1.5.0"
3538

3639
[profile.release-smaller]
@@ -39,4 +42,4 @@ opt-level = 'z' # Optimize for size.
3942
lto = true # Enable Link Time Optimization
4043
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
4144
panic = "abort" # Abort on panic
42-
strip = "debuginfo" # Partially strip symbols from binary
45+
strip = "debuginfo" # Partially strip symbols from binary

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
analyzer:
2+
exclude:
3+
- lib/bdk.dart
4+

bdk-ffi

Submodule bdk-ffi updated 129 files

build.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)