From 0b5470330651bdcd149c3ab20d4f6b2a682cadbf Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 9 Jun 2026 19:27:40 +0200 Subject: [PATCH 1/2] test(dpp): require shielded-client in shield-from-asset-lock signing 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) --- .../shielded/shield_from_asset_lock_transition/mod.rs | 3 ++- .../shield_from_asset_lock_transition/signing_tests.rs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/mod.rs index 19f4acede13..1d6476dd336 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/mod.rs @@ -4,7 +4,8 @@ mod proved; #[cfg(all( test, feature = "state-transition-signing", - feature = "core_key_wallet" + feature = "core_key_wallet", + feature = "shielded-client" ))] mod signing_tests; mod state_transition_estimated_fee_validation; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/signing_tests.rs b/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/signing_tests.rs index b2563604e64..0e3f2994744 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/signing_tests.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/shielded/shield_from_asset_lock_transition/signing_tests.rs @@ -10,10 +10,15 @@ //! in `state_transition::mod` pins `sign_with_core_signer` against //! `sign_by_private_key` — we don't re-derive that contract here. +// `crate::shielded::builder` (the high-level bundle builder these tests drive) only +// exists under `shielded-client`, so this module must require it too — otherwise the +// `--all-targets` feature-unified lib-test target (which enables `state-transition-signing` +// + `core_key_wallet` without `shielded-client`) fails to resolve the builder import. #![cfg(all( test, feature = "state-transition-signing", - feature = "core_key_wallet" + feature = "core_key_wallet", + feature = "shielded-client" ))] use crate::identity::state_transition::asset_lock_proof::chain::ChainAssetLockProof; From a395cbab3e1e3a868663ef26c1787bdf58af4bfb Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 9 Jun 2026 19:43:05 +0200 Subject: [PATCH 2/2] fix(platform-wallet): build outgoing-notes load errors via PersistenceError::backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `SledFfiPersister::load` returns `Result<_, PersistenceError>`, and `PersistenceError` does not implement `From`. 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` 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>`, 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) --- packages/rs-platform-wallet-ffi/src/persistence.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/rs-platform-wallet-ffi/src/persistence.rs b/packages/rs-platform-wallet-ffi/src/persistence.rs index 2cb9e57400a..60405d284f9 100644 --- a/packages/rs-platform-wallet-ffi/src/persistence.rs +++ b/packages/rs-platform-wallet-ffi/src/persistence.rs @@ -1430,10 +1430,10 @@ impl PlatformWalletPersistence for FFIPersister { .on_load_shielded_outgoing_notes_free_fn .is_some() { - return Err("on_load_shielded_outgoing_notes_fn and \ - on_load_shielded_outgoing_notes_free_fn must be provided together" - .to_string() - .into()); + return Err(PersistenceError::backend( + "on_load_shielded_outgoing_notes_fn and \ + on_load_shielded_outgoing_notes_free_fn must be provided together", + )); } // 1) notes @@ -1508,11 +1508,10 @@ impl PlatformWalletPersistence for FFIPersister { let rc = unsafe { load_outgoing(self.callbacks.context, &mut out_ptr, &mut out_count) }; if rc != 0 { - return Err(format!( + return Err(PersistenceError::backend(format!( "on_load_shielded_outgoing_notes_fn returned error code {}", rc - ) - .into()); + ))); } struct OutgoingGuard { context: *mut c_void,