-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(wallet_ffi): add coin join and split #4218
feat(wallet_ffi): add coin join and split #4218
Conversation
}) | ||
} | ||
|
||
fn to_string_vec(&self) -> Result<Vec<String>, InterfaceError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The to_*
functions should be marked as unsafe because they do not provide any additional safety guarantees than from_raw_parts (which is unsafe). If the data that TariVector points to is null/deallocated the Vec will be invalid and the program will crash. Moreover if the vector is mutated (as you are free to do with an owned Vec, it could be reallocated and the pointer is no longer valid.
I think the method signature should be: wont work
unsafe fn as_string_slice(&self) -> Result<&[&str], InterfaceError>
added a simple output querying function Signed-off-by: Andrey Gubarev <[email protected]>
added a simple output querying function. added an output database shortcut for easier access from the wallet context, circumventing hops through async fall-through constructs; updated all usages - `cargo test` passing. Signed-off-by: Andrey Gubarev <[email protected]>
Co-authored-by: stringhandler <[email protected]>
Co-authored-by: stringhandler <[email protected]>
fixed TariVector conversion bug found a problem in the coin_join approach, need reconsideration this commit is for review only before the final brushing/wrap-up Signed-off-by: Andrei Gubarev <[email protected]>
b0640fe
to
a5d9e5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred less duplication of code, but I'm not sure how often this functionality is actually going to be used, so let's try it and we can DRY it up later
Signed-off-by: Andrei Gubarev <[email protected]>
Signed-off-by: Andrei Gubarev <[email protected]>
2b7b5c0
to
be22697
Compare
Signed-off-by: Andrei Gubarev <[email protected]>
Description
Adding new FFI
wallet_coin_join()
function and working on unit tests forwallet_coin_join()
and an already existingwallet_coin_split()
Motivation and Context
To enable users to join (collapse) UTXOs depending on the selected strategy, with default behavior to join outputs selected by the user.
How Has This Been Tested?
unit tests (WIP)