From 085072e60ee2379e4a554bdb54746608defe4251 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 9 Jun 2026 18:32:21 +0200 Subject: [PATCH] fix: build shielded FFI load path under --all-features The shielded-gated outgoing-notes load path in platform-wallet-ffi returned `String.into()` / `format!(...).into()` as its error, but `PersistenceError` does not implement `From`, so the crate failed to compile under the `shielded` feature (E0277). Construct `PersistenceError::backend(...)` to match the surrounding error sites. Regression from #3819 (only triggered with the `shielded` feature, which the congested CI on that PR didn't exercise). 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,