Repository: dusk-network/rusk (language: rust)

Issue:
wallet-core: Update phoenix function to allow data to be passed to transaction
#### Summary
Currently the phoenix function has a `todo()` concerning the passing of data to the `transaction` function.  In order for the web wallet to provide the same functionality as the CLI wallet (and allow memos to be sent with to both shielded and unshielded transfers), then the phoenix function in the FFI needs to be updated

#### Possible solution design or implementation
Use the same data handling approach as with the `moonlight` function.

#### Additional context
It may be the case that this was left unimplemented due to the possibility of encrypting the data in shielded transfers, however, this can be added later if needed and in any case might well be considered the responsibility of the client and not the library, as @HDauven mentioned.



Discussion / hints:

Fix patch:
diff --git a/wallet-core/CHANGELOG.md b/wallet-core/CHANGELOG.md
index 3b0b53e40b..0062b08322 100644
--- a/wallet-core/CHANGELOG.md
+++ b/wallet-core/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Changed
+
+- Changed phoenix function to allow data to be passed to transaction [#3438] 
+
 ## [1.0.1] - 2025-01-23
 
 ### Changed
@@ -18,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - First `dusk-wallet-core` release
 
 <!-- Issues -->
+[#3438]: https://github.com/dusk-network/rusk/issues/3438
 [#3405]: https://github.com/dusk-network/rusk/issues/3405
 
 [Unreleased]: https://github.com/dusk-network/rusk/compare/dusk-wallet-core-1.0.1...HEAD
diff --git a/wallet-core/src/ffi.rs b/wallet-core/src/ffi.rs
index 5bf7e742f5..1e4e38b13d 100644
--- a/wallet-core/src/ffi.rs
+++ b/wallet-core/src/ffi.rs
@@ -384,8 +384,13 @@ pub unsafe fn phoenix(
         .filter_map(|(note, opening)| opening.map(|op| (note, op)))
         .collect();
 
-    let data: Option<TransactionData> =
-        if data.is_null() { None } else { todo!() };
+    let data: Option<TransactionData> = if data.is_null() {
+        None
+    } else {
+        let buffer = mem::read_buffer(data);
+
+        Some(buffer[1..].to_vec().into())
+    };
 
     let prover = NoOpProver::default();
 


Test patch: