Skip to content

Commit 295b2ce

Browse files
committed
Handle conditional NodeEntropy types for UniFFI
Adapt the NodeEntropy initialization to account for diverging constructor signatures when the uniffi feature is active. The UniFFI layer requires shared ownership (Arc) and dynamic byte validation (Result/Vec) to facilitate memory management and error handling across the FFI boundary. This change ensures the builder receives the expected pointer type in UniFFI builds while maintaining the zero-cost stack allocation for standard Rust usage.
1 parent 1f51948 commit 295b2ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/integration_tests_rust.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,9 @@ async fn persistence_backwards_compatibility() {
24452445

24462446
let storage_path = common::random_storage_path().to_str().unwrap().to_owned();
24472447
let seed_bytes = [42u8; 64];
2448+
#[cfg(feature = "uniffi")]
2449+
let node_entropy = Arc::new(NodeEntropy::from_seed_bytes(seed_bytes.to_vec()).unwrap());
2450+
#[cfg(not(feature = "uniffi"))]
24482451
let node_entropy = NodeEntropy::from_seed_bytes(seed_bytes);
24492452

24502453
// Setup a v0.6.2 `Node`

0 commit comments

Comments
 (0)