fix(rpc-json): disable key-wallet default features#596
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dash-spv-ffi/src/config.rs`:
- Around line 169-184: This PR introduces an unrelated FFI API addition (the
function dash_spv_ffi_config_clear_peers operating on FFIClientConfig /
ClientConfig and touching cfg.peers) that should be split into a separate,
focused change; remove or revert the dash_spv_ffi_config_clear_peers addition
from this branch (or move it to a new branch/PR) and open a dedicated PR for the
FFI feature, or alternatively retitle/recategorize this PR to include the ffi
change so it matches pr-title.yml policies.
In `@dash-spv-ffi/tests/test_config.rs`:
- Around line 97-119: Update the test to exercise both networks and assert setup
calls succeed: for each FFINetwork variant (Testnet and Mainnet) call
dash_spv_ffi_config_new and assert it returns a non-null config, call
dash_spv_ffi_config_add_peer for each peer and assert the return equals
FFIErrorCode::Success, then call dash_spv_ffi_config_clear_peers and assert
success (including the second clear on an already-empty config), and finally
call dash_spv_ffi_config_destroy; reference dash_spv_ffi_config_new,
dash_spv_ffi_config_add_peer, dash_spv_ffi_config_clear_peers and
dash_spv_ffi_config_destroy when making these changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 668767a7-8bf3-4e98-bf68-c9f62abd44fd
📒 Files selected for processing (4)
dash-spv-ffi/FFI_API.mddash-spv-ffi/src/config.rsdash-spv-ffi/tests/test_config.rsrpc-json/Cargo.toml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #596 +/- ##
=============================================
- Coverage 67.06% 67.05% -0.02%
=============================================
Files 318 318
Lines 67026 67026
=============================================
- Hits 44950 44941 -9
- Misses 22076 22085 +9
|
rpc-json only needs key-wallet for types and serde. With default-features, it pulls in the manager module (tokio) which inflates WASM builds that depend on dashcore-rpc transitively. Add default-features = false with explicit getrandom + serde features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55bfdec to
13fa6f6
Compare
Summary
Add
default-features = falseto key-wallet dep in rpc-json with explicitgetrandom+serdefeatures.rpc-json only needs key-wallet for type definitions and serde — it doesn't use the wallet manager or SPV. Without this fix, any crate depending on dashcore-rpc transitively enables key-wallet's
managerdefault feature which pulls intokio, inflating WASM builds unnecessarily (e.g. platform's wasm-sdk).Changes
rpc-json/Cargo.toml:default-features = false, features=["serde", "getrandom"]Testing
cargo check --workspacepassescargo test -p dashcore-rpc-json --all-features --no-runpassesSummary by CodeRabbit