-
Notifications
You must be signed in to change notification settings - Fork 13
feat: build out key-wallet ffi and improve ci #108
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
Changes from 25 commits
3c35153
7f8f19d
90e0442
ea9bbe1
e2c33ff
97e6b59
461baeb
678a120
c90f618
b49ec4a
c743035
6a62a2d
34154d4
34427ee
36d7bc8
25de03f
43d87b4
ba9c28f
2e3064d
2d0039e
6cf2223
bdd57dc
352fe89
e9871fd
51c06da
7f9799f
6e3b0b9
07bcdb4
88ccbe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "strict_check_crates": [ | ||
| "key-wallet", | ||
| "key-wallet-manager", | ||
| "key-wallet-ffi" | ||
| ], | ||
| "excluded_crates": [ | ||
| "dash", | ||
| "dash-network", | ||
| "dash-network-ffi", | ||
| "hashes", | ||
| "internals", | ||
| "fuzz", | ||
| "rpc-client", | ||
| "rpc-json", | ||
| "rpc-integration-test", | ||
| "dash-spv", | ||
| "dash-spv-ffi", | ||
| "test-utils" | ||
| ], | ||
| "comment": "Crates in strict_check_crates will fail CI on any warnings or clippy issues. Add or remove crates as needed." | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,13 +44,14 @@ jobs: | |||||||||||||||||||||
| id: cache-fuzz | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| path: | | ||||||||||||||||||||||
| ~/.cargo/bin | ||||||||||||||||||||||
| ~/.cargo/registry | ||||||||||||||||||||||
| ~/.cargo/git | ||||||||||||||||||||||
| fuzz/target | ||||||||||||||||||||||
| target | ||||||||||||||||||||||
| key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | ||||||||||||||||||||||
| key: cache-${{ matrix.fuzz_target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} | ||||||||||||||||||||||
| - uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| toolchain: 1.85 | ||||||||||||||||||||||
| toolchain: 1.89 | ||||||||||||||||||||||
| override: true | ||||||||||||||||||||||
| profile: minimal | ||||||||||||||||||||||
| - name: fuzz | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Migrate off actions-rs/toolchain and pin patch version (align with rust.yml). actions-rs/toolchain is archived and increasingly incompatible with current runners. Also, pin the toolchain to 1.89.0 (not 1.89) for reproducibility and to match the rest of CI. Apply this diff: - - uses: actions-rs/toolchain@v1
- with:
- toolchain: 1.89
- override: true
- profile: minimal
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ toolchain: 1.89.0📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)51-51: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,7 +26,7 @@ jobs: | |||||||||||||||||||||||||||
| AS_DEPENDENCY: true | ||||||||||||||||||||||||||||
| DO_NO_STD: false | ||||||||||||||||||||||||||||
| DO_DOCS: true | ||||||||||||||||||||||||||||
| - rust: 1.85.0 | ||||||||||||||||||||||||||||
| - rust: 1.89.0 | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| AS_DEPENDENCY: true | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
|
|
@@ -41,6 +41,137 @@ jobs: | |||||||||||||||||||||||||||
| - name: Running test script | ||||||||||||||||||||||||||||
| env: ${{ matrix.env }} | ||||||||||||||||||||||||||||
| run: ./contrib/test.sh | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| workspace-tests: | ||||||||||||||||||||||||||||
| name: Workspace Tests | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||
| rust: [stable, beta, nightly, 1.89.0] | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout Crate | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| - name: Setup Rust toolchain | ||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| profile: minimal | ||||||||||||||||||||||||||||
| toolchain: ${{ matrix.rust }} | ||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||
| - name: Cache cargo registry | ||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||
| ~/.cargo/registry | ||||||||||||||||||||||||||||
| ~/.cargo/git | ||||||||||||||||||||||||||||
| target | ||||||||||||||||||||||||||||
| key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | ||||||||||||||||||||||||||||
| - name: Run workspace tests | ||||||||||||||||||||||||||||
| run: cargo test --workspace --all-features | ||||||||||||||||||||||||||||
| - name: Run workspace tests (no default features) | ||||||||||||||||||||||||||||
| run: cargo test --workspace --no-default-features | ||||||||||||||||||||||||||||
| - name: Build workspace (release mode) | ||||||||||||||||||||||||||||
| run: cargo build --workspace --release | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| clippy: | ||||||||||||||||||||||||||||
| name: Clippy (Non-strict) | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout Crate | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| - name: Setup Rust toolchain | ||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| profile: minimal | ||||||||||||||||||||||||||||
| toolchain: stable | ||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||
| components: clippy | ||||||||||||||||||||||||||||
| - name: Run clippy (excluding strict-checked crates) | ||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| # Auto-discover all workspace crates and exclude strict-checked ones | ||||||||||||||||||||||||||||
| STRICT_CRATES=("key-wallet" "key-wallet-manager" "key-wallet-ffi") | ||||||||||||||||||||||||||||
| mapfile -t ALL_CRATES < <(cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name' | sort -u) | ||||||||||||||||||||||||||||
| for crate in "${ALL_CRATES[@]}"; do | ||||||||||||||||||||||||||||
| if printf '%s\n' "${STRICT_CRATES[@]}" | grep -qx "$crate"; then | ||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||
| echo "Checking $crate (warnings allowed)..." | ||||||||||||||||||||||||||||
| cargo clippy -p "$crate" --all-features --all-targets || true | ||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| strict-checks: | ||||||||||||||||||||||||||||
| name: Strict Warnings and Clippy Checks | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout Crate | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| - name: Setup Rust toolchain | ||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| profile: minimal | ||||||||||||||||||||||||||||
| toolchain: stable | ||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||
| components: clippy | ||||||||||||||||||||||||||||
| - name: Cache cargo registry | ||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||
| ~/.cargo/registry | ||||||||||||||||||||||||||||
| ~/.cargo/git | ||||||||||||||||||||||||||||
| target | ||||||||||||||||||||||||||||
| key: ${{ runner.os }}-cargo-strict-${{ hashFiles('**/Cargo.lock') }} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Check key-wallet with strict warnings | ||||||||||||||||||||||||||||
| - name: Check key-wallet (deny warnings) | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| RUSTFLAGS: "-D warnings" | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cargo check -p key-wallet --all-features --lib --bins --tests | ||||||||||||||||||||||||||||
| cargo build -p key-wallet --all-features --lib --bins | ||||||||||||||||||||||||||||
| cargo test -p key-wallet --all-features --lib --bins | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Clippy key-wallet (deny all warnings) | ||||||||||||||||||||||||||||
| run: cargo clippy -p key-wallet --all-features --lib --bins --tests -- -D warnings | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Check key-wallet-manager with strict warnings | ||||||||||||||||||||||||||||
| - name: Check key-wallet-manager (deny warnings) | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| RUSTFLAGS: "-D warnings" | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cargo check -p key-wallet-manager --all-features --lib --bins --tests | ||||||||||||||||||||||||||||
| cargo build -p key-wallet-manager --all-features --lib --bins | ||||||||||||||||||||||||||||
| cargo test -p key-wallet-manager --all-features --lib --bins | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Clippy key-wallet-manager (deny all warnings) | ||||||||||||||||||||||||||||
| run: cargo clippy -p key-wallet-manager --all-features --lib --bins --tests -- -D warnings | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Check key-wallet-ffi with strict warnings | ||||||||||||||||||||||||||||
| - name: Check key-wallet-ffi (deny warnings) | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| RUSTFLAGS: "-D warnings" | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cargo check -p key-wallet-ffi --all-features --lib --bins --tests | ||||||||||||||||||||||||||||
| cargo build -p key-wallet-ffi --all-features --lib --bins | ||||||||||||||||||||||||||||
| cargo test -p key-wallet-ffi --all-features --lib --bins | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Clippy key-wallet-ffi (deny all warnings) | ||||||||||||||||||||||||||||
| run: cargo clippy -p key-wallet-ffi --all-features --lib --bins --tests -- -D warnings | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| fmt: | ||||||||||||||||||||||||||||
| name: Format | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout Crate | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| - name: Setup Rust toolchain | ||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| profile: minimal | ||||||||||||||||||||||||||||
| toolchain: stable | ||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||
| components: rustfmt | ||||||||||||||||||||||||||||
| - name: Check formatting | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion fmt job: migrate toolchain action. Apply this diff: - - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- components: rustfmt
+ - name: Setup Rust toolchain
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ toolchain: stable
+ components: rustfmt📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)163-163: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| run: cargo fmt --all -- --check | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # TODO: need to support compiling rust-x11-hash under s390x | ||||||||||||||||||||||||||||
| # Cross: | ||||||||||||||||||||||||||||
|
|
@@ -88,7 +219,7 @@ jobs: | |||||||||||||||||||||||||||
| # run: cd hashes/embedded && cargo run --target thumbv7m-none-eabi --features=alloc | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| rpc-tests: | ||||||||||||||||||||||||||||
| name: Tests | ||||||||||||||||||||||||||||
| name: RPC Tests | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||
|
|
@@ -99,7 +230,7 @@ jobs: | |||||||||||||||||||||||||||
| - rust: nightly | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| RUSTFMTCHK: false | ||||||||||||||||||||||||||||
| - rust: 1.85.0 | ||||||||||||||||||||||||||||
| - rust: 1.89.0 | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| PIN_VERSIONS: true | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| fn main() { | ||
| uniffi::generate_scaffolding("src/dash_network.udl").unwrap(); | ||
| // Build script for dash-network-ffi | ||
| // Standard FFI compilation without uniffi | ||
| } |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify crate names map 1:1 to package.name across the workspace; consider adding a schema_version and sorting lists
Run this script from repo root to verify names and detect overlaps/missing entries:
If you want, I can wire a small CI step to consume this JSON and feed cargo clippy invocations accordingly.
Apply this diff to add a schema_version and alphabetize entries:
{ + "schema_version": 1, "strict_check_crates": [ - "key-wallet", - "key-wallet-manager", - "key-wallet-ffi" + "key-wallet", + "key-wallet-ffi", + "key-wallet-manager" ], "excluded_crates": [ - "dash", - "dash-network", - "dash-network-ffi", - "hashes", - "internals", - "fuzz", - "rpc-client", - "rpc-json", - "rpc-integration-test", - "dash-spv", - "dash-spv-ffi", - "test-utils" + "dash", + "dash-network", + "dash-network-ffi", + "dash-spv", + "dash-spv-ffi", + "fuzz", + "hashes", + "internals", + "rpc-client", + "rpc-integration-test", + "rpc-json", + "test-utils" ], "comment": "Crates in strict_check_crates will fail CI on any warnings or clippy issues. Add or remove crates as needed." }🏁 Script executed:
Length of output: 1318
Update .github/strict-checks.json to match actual crates and wire into CI
strict_check_cratesexactly matchpackage.namein theirCargo.toml(no missing crates).excluded_crateslist contains eight names that no longer exist in the workspace and must be removed or renamed:strict_check_cratesorexcluded_crates. Decide whether each should be strictly checked or explicitly excluded:.github/workflows/*.ymlreference this config, so CI will not actually enforce these rules. Add a step to load and use this JSON in your lint/test pipeline.Proposed patch—adds a
schema_version, removes obsolete names, alphabetizes lists, and highlights where to wire into CI:.github/strict-checks.json { + "schema_version": 1, "strict_check_crates": [ - "key-wallet", - "key-wallet-ffi", - "key-wallet-manager" + "key-wallet", + "key-wallet-ffi", + "key-wallet-manager" ], "excluded_crates": [ - "dash", - "dash-network", - "dash-network-ffi", - "dash-spv", - "dash-spv-ffi", - "fuzz", - "hashes", - "internals", - "rpc-client", - "rpc-integration-test", - "rpc-json", - "test-utils" + "dash-network", + "dash-network-ffi", + "dash-spv", + "dash-spv-ffi" ], "comment": "Crates in strict_check_crates will fail CI on any warnings or clippy issues. Add or remove crates as needed." }• Remove the eight missing/ex-obsolete crate names from
excluded_crates.• Decide and add the eleven “unlisted” crates under the appropriate list.
• Alphabetize both arrays to reduce churn.
• Add a CI job (e.g. in
.github/workflows/ci.yml) that reads this JSON and feeds its lists into yourcargo clippy/cargo testmatrix.📝 Committable suggestion
🤖 Prompt for AI Agents