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: add ffi get mnemonic wordlist #3538
feat: add ffi get mnemonic wordlist #3538
Conversation
Added an FFI method to get the entire mnemonic wordlist for a given language.
74af9db
to
dd251cf
Compare
2296a9d
to
fd91d4a
Compare
fd91d4a
to
9784943
Compare
Although |
So you would rather repeat all the helper functions except that single one (which returns feedback that something is wrong)? We are dealing with a very clunky FFI interface here which is unsafe on many levels so needs careful handling by the client and this is a case where I believe that adding 3 completely repeated helpers functions for a SLIGHTLY more appropriate API interface is definitely the wrong move. Edit: To be clear the original PR already missed 2 of these functions which was get_length and get_at. I feel this already demonstrates the issue of adding more types that are not really necessary. |
Thank you @delta1, @philipr-za and @StriderDM for the review comments; applied all. Unit tests and cucumber test working properly. |
@StriderDM the code panics if if position >= len as u32 {
error = LibWalletError::from(InterfaceError::PositionInvalidError).code;
ptr::swap(error_out, &mut error as *mut c_int);
} else {
word = CString::new((*seed_words).0[position as usize].clone()).unwrap()
} |
@hansieodendaal Good find. Yeah I realized that right after posting my comment. |
Addressed and holding up merge queue maybe
Description
Added an FFI method to get the entire mnemonic word list for a given language.
Motivation and Context
See above.
How Has This Been Tested?