Skip to content
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

fix(ffi): mut pointers should be const #3775

Merged
merged 2 commits into from
Jan 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions base_layer/wallet_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ pub unsafe extern "C" fn private_key_from_hex(key: *const c_char, error_out: *mu
/// prevent a memory leak
#[no_mangle]
pub unsafe extern "C" fn commitment_signature_create_from_bytes(
public_nonce_bytes: *mut ByteVector,
u_bytes: *mut ByteVector,
v_bytes: *mut ByteVector,
public_nonce_bytes: *const ByteVector,
u_bytes: *const ByteVector,
v_bytes: *const ByteVector,
error_out: *mut c_int,
) -> *mut TariCommitmentSignature {
let mut error = 0;
Expand Down Expand Up @@ -936,7 +936,7 @@ pub unsafe extern "C" fn commitment_signature_create_from_bytes(
Err(e) => {
error!(
target: LOG_TARGET,
"Error creating a Public Key (u) from bytes: {:?}", e
"Error creating a Private Key (u) from bytes: {:?}", e
);
error = LibWalletError::from(e).code;
ptr::swap(error_out, &mut error as *mut c_int);
Expand All @@ -948,7 +948,7 @@ pub unsafe extern "C" fn commitment_signature_create_from_bytes(
Err(e) => {
error!(
target: LOG_TARGET,
"Error creating a Public Key (v) from bytes: {:?}", e
"Error creating a Private Key (v) from bytes: {:?}", e
);
error = LibWalletError::from(e).code;
ptr::swap(error_out, &mut error as *mut c_int);
Expand Down Expand Up @@ -5011,7 +5011,7 @@ pub unsafe extern "C" fn wallet_import_utxo(
features,
message_string,
(*metadata_signature).clone(),
&(*spending_key).clone(),
&(*script_private_key).clone(),
&(*sender_offset_public_key).clone(),
0,
covenant,
Expand Down