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

chore: fix naming of ffi functions and comments #4930

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 8 additions & 9 deletions base_layer/wallet_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1661,8 +1661,6 @@ pub unsafe extern "C" fn encrypted_value_destroy(encrypted_value: *mut TariEncry
/// `output_type` - The encoded value of the output type as a byte
/// `maturity` - The encoded value maturity as bytes
/// `metadata` - The metadata componenet as a ByteVector. It cannot be null
/// `unique_id` - The unique id componenet as a ByteVector. It can be null
/// `mparent_public_key` - The parent public key component as a ByteVector. It can be null
/// `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions
/// as an out parameter.
///
Expand Down Expand Up @@ -2778,9 +2776,9 @@ pub unsafe extern "C" fn completed_transaction_get_transaction_id(
/// ptr::null_mut() if transaction is null
///
/// # Safety
/// The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
/// The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
#[no_mangle]
pub unsafe extern "C" fn completed_transaction_get_destination_public_key(
pub unsafe extern "C" fn completed_transaction_get_destination_tari_address(
transaction: *mut TariCompletedTransaction,
error_out: *mut c_int,
) -> *mut TariWalletAddress {
Expand Down Expand Up @@ -2863,7 +2861,7 @@ pub unsafe extern "C" fn completed_transaction_get_transaction_kernel(
/// # Safety
/// The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
#[no_mangle]
pub unsafe extern "C" fn completed_transaction_get_source_public_key(
pub unsafe extern "C" fn completed_transaction_get_source_tari_address(
transaction: *mut TariCompletedTransaction,
error_out: *mut c_int,
) -> *mut TariWalletAddress {
Expand Down Expand Up @@ -3200,9 +3198,9 @@ pub unsafe extern "C" fn pending_outbound_transaction_get_transaction_id(
/// ptr::null_mut() if transaction is null
///
/// # Safety
/// The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
/// The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
#[no_mangle]
pub unsafe extern "C" fn pending_outbound_transaction_get_destination_public_key(
pub unsafe extern "C" fn pending_outbound_transaction_get_destination_tari_address(
transaction: *mut TariPendingOutboundTransaction,
error_out: *mut c_int,
) -> *mut TariWalletAddress {
Expand Down Expand Up @@ -3434,9 +3432,10 @@ pub unsafe extern "C" fn pending_inbound_transaction_get_transaction_id(
/// ptr::null_mut() if transaction is null
///
/// # Safety
/// The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
/// The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory
/// leak
#[no_mangle]
pub unsafe extern "C" fn pending_inbound_transaction_get_source_public_key(
pub unsafe extern "C" fn pending_inbound_transaction_get_source_tari_address(
transaction: *mut TariPendingInboundTransaction,
error_out: *mut c_int,
) -> *mut TariWalletAddress {
Expand Down
24 changes: 11 additions & 13 deletions base_layer/wallet_ffi/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,6 @@ void encrypted_value_destroy(TariEncryptedValue *encrypted_value);
* `output_type` - The encoded value of the output type as a byte
* `maturity` - The encoded value maturity as bytes
* `metadata` - The metadata componenet as a ByteVector. It cannot be null
* `unique_id` - The unique id componenet as a ByteVector. It can be null
* `mparent_public_key` - The parent public key component as a ByteVector. It can be null
* `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions
* as an out parameter.
*
Expand Down Expand Up @@ -1585,10 +1583,10 @@ unsigned long long completed_transaction_get_transaction_id(TariCompletedTransac
* ptr::null_mut() if transaction is null
*
* # Safety
* The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
* The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
*/
TariWalletAddress *completed_transaction_get_destination_public_key(TariCompletedTransaction *transaction,
int *error_out);
TariWalletAddress *completed_transaction_get_destination_tari_address(TariCompletedTransaction *transaction,
int *error_out);

/**
* Gets the TariTransactionKernel of a TariCompletedTransaction
Expand Down Expand Up @@ -1625,8 +1623,8 @@ TariTransactionKernel *completed_transaction_get_transaction_kernel(TariComplete
* # Safety
* The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
*/
TariWalletAddress *completed_transaction_get_source_public_key(TariCompletedTransaction *transaction,
int *error_out);
TariWalletAddress *completed_transaction_get_source_tari_address(TariCompletedTransaction *transaction,
int *error_out);

/**
* Gets the status of a TariCompletedTransaction
Expand Down Expand Up @@ -1831,10 +1829,10 @@ unsigned long long pending_outbound_transaction_get_transaction_id(TariPendingOu
* ptr::null_mut() if transaction is null
*
* # Safety
* The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
* The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
*/
TariWalletAddress *pending_outbound_transaction_get_destination_public_key(TariPendingOutboundTransaction *transaction,
int *error_out);
TariWalletAddress *pending_outbound_transaction_get_destination_tari_address(TariPendingOutboundTransaction *transaction,
int *error_out);

/**
* Gets the amount of a TariPendingOutboundTransaction
Expand Down Expand Up @@ -1978,10 +1976,10 @@ unsigned long long pending_inbound_transaction_get_transaction_id(TariPendingInb
* ptr::null_mut() if transaction is null
*
* # Safety
* The ```public_key_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
* The ```tari_address_destroy``` method must be called when finished with a TariWalletAddress to prevent a memory leak
*/
TariWalletAddress *pending_inbound_transaction_get_source_public_key(TariPendingInboundTransaction *transaction,
int *error_out);
TariWalletAddress *pending_inbound_transaction_get_source_tari_address(TariPendingInboundTransaction *transaction,
int *error_out);

/**
* Gets the amount of a TariPendingInboundTransaction
Expand Down