test(dpp): require shielded-client in shield-from-asset-lock signing tests#3827
Conversation
…tests
The `signing_tests` module for `ShieldFromAssetLockTransition` imports
`crate::shielded::builder::*`, but `pub mod builder;` is gated on the
`shielded-client` feature (it pulls in `grovedb-commitment-tree` / Orchard).
The test module was only gated on `state-transition-signing` + `core_key_wallet`,
so under `cargo check --workspace --all-targets` feature unification the lib-test
target enabled those two features WITHOUT `shielded-client` and failed to compile:
error[E0433]: failed to resolve: could not find `builder` in `shielded`
error[E0432]: unresolved import `crate::shielded::builder`
Align the gate with the test's actual dependency by adding
`feature = "shielded-client"` to both the `mod signing_tests;` declaration and
the file's inner `#![cfg(...)]`. The test genuinely needs the builder (it calls
`build_shield_from_asset_lock_transition_with_signer`), which cannot exist without
`shielded-client`, so requiring it is correct rather than a workaround.
Verified with `cargo check --workspace --all-targets` and
`cargo check -p dpp --all-features --tests` (both pass).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesShielded signing + persistence fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.1-dev #3827 +/- ##
=============================================
- Coverage 87.01% 69.91% -17.11%
=============================================
Files 2677 19 -2658
Lines 329958 2712 -327246
=============================================
- Hits 287118 1896 -285222
+ Misses 42840 816 -42024
🚀 New features to boost your workflow:
|
…eError::backend `SledFfiPersister::load` returns `Result<_, PersistenceError>`, and `PersistenceError` does not implement `From<String>`. The OVK outgoing-notes load path (added in #3819) returned its errors with `.into()` on a `String`/ `&str`, which fails to compile under `cargo clippy --workspace --all-features`: error[E0277]: the trait bound `PersistenceError: From<String>` is not satisfied error: could not compile `platform-wallet-ffi` (lib) due to 2 previous errors This broke the workspace clippy check on `v3.1-dev` (and therefore every open PR's "Tests (macOS)" job). Build both error sites with `PersistenceError::backend(..)` instead — the same constructor the sibling incoming-notes / sync-state paths in this function already use (`E: Into<Box<dyn StdError + Send + Sync>>`, which `String` and `&str` satisfy). No behavior change beyond the errors now being typed correctly. Verified with `cargo clippy --workspace --all-features --locked -- --no-deps -D warnings`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Issue being fixed or feature implemented
Primary fix (dpp test-cfg):
cargo check --workspace --all-targetsfails to compile thedpplib-test target on a cleanv3.1-dev-based tree:The
signing_testsmodule forShieldFromAssetLockTransitionimportscrate::shielded::builder::*, butpub mod builder;inshielded/mod.rsis gated on theshielded-clientfeature (which pulls ingrovedb-commitment-tree/ Orchard). The test module was gated only onstate-transition-signing+core_key_wallet. Under--all-targets/--workspacefeature unification, the lib-test target gets those two features enabled withoutshielded-client, socrate::shielded::builderdoes not exist and compilation fails.Additional fix (platform-wallet, required to get CI green): CI's
cargo clippy --workspace --all-featureswas already broken onv3.1-dev— independently of this PR — by code merged in #3819:SledFfiPersister::loadreturnsResult<_, PersistenceError>, but the OVK outgoing-notes load path returned its errors via.into()on aString/&str, andPersistenceErrorhas noFrom<String>. This fails the workspace clippy step that the "Tests (macOS)" check runs, so every open PR is red on it. Since this PR's CI runs the same workspace clippy, it cannot go green without this fix included.What was done?
test(dpp)— addedfeature = "shielded-client"to thesigning_testsgate (both themoddeclaration inshield_from_asset_lock_transition/mod.rsand the inner#![cfg(all(...))]ofsigning_tests.rs, with an explanatory comment). The test genuinely depends onshielded-client: it callsbuild_shield_from_asset_lock_transition_with_signer, which lives inside the builder module, whose body usesgrovedb_commitment_tree(a dep pulled in only byshielded-client). Requiring it is the correct alignment, not a workaround — exposingpub mod builder;withoutshielded-clientis not viable since the module would fail to compile for lack of that dep. The other in-module builder test references (shield.rs,unshield.rs, etc.) live inside the builder module, so they only compile whenshielded-clientis on and need no change.fix(platform-wallet)— built both outgoing-notes load error sites inpersistence.rswithPersistenceError::backend(..)(the same constructor the sibling incoming-notes / sync-state paths in the samefn loadalready use;E: Into<Box<dyn StdError + Send + Sync>>, whichString/&strsatisfy) instead of.into(). No behavior change beyond the errors being typed correctly. This is a drive-by fix for a pre-existing base-branch breakage; happy to split it into a standalone PR if maintainers prefer, but note it's needed for this PR's CI to pass.How Has This Been Tested?
cargo check -p dpp --tests --no-default-features --features state-transition-signing,core_key_wallet→ after the fix, clean.cargo check -p dpp --all-features --tests— passes.cargo check --workspace --all-targets— passes (exit 0); the originally-failing command.cargo clippy -p platform-wallet-ffi --all-features --locked -- --no-deps -D warnings→ after the fix, clean.cargo clippy --workspace --all-features --locked -- --no-deps -D warnings(the exact CI command) — passes with no errors or warnings.cargo fmt— clean on both crates.Breaking Changes
None. A test-only cfg-gate change plus an error-construction fix; no production behavior or consensus is affected.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit