Skip to content
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
14 changes: 7 additions & 7 deletions key-wallet-ffi/src/utxo.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! UTXO management

use crate::error::{FFIError, FFIErrorCode};
use crate::managed_wallet::FFIManagedWalletInfo;
use key_wallet::wallet::managed_wallet_info::wallet_info_interface::WalletInfoInterface;
use std::ffi::CString;
use std::os::raw::c_char;
use std::ptr;

use crate::error::{FFIError, FFIErrorCode};
use crate::managed_wallet::FFIManagedWalletInfo;

/// UTXO structure for FFI
#[repr(C)]
pub struct FFIUTXO {
Expand Down Expand Up @@ -99,7 +99,7 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(
let managed_info = &*managed_info;

// Get UTXOs from the managed wallet info
let utxos = managed_info.inner().get_utxos();
let utxos = managed_info.inner().utxos();

if utxos.is_empty() {
*count_out = 0;
Expand All @@ -108,10 +108,10 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(
// Convert UTXOs to FFI format
let mut ffi_utxos = Vec::with_capacity(utxos.len());

for (outpoint, utxo) in utxos {
for utxo in utxos {
// Convert txid to byte array
let mut txid_bytes = [0u8; 32];
txid_bytes.copy_from_slice(&outpoint.txid[..]);
txid_bytes.copy_from_slice(&utxo.outpoint.txid[..]);

// Convert address to string
let address_str = utxo.address.to_string();
Expand All @@ -128,7 +128,7 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(

let ffi_utxo = FFIUTXO::new(
txid_bytes,
outpoint.vout,
utxo.outpoint.vout,
utxo.value(),
address_str,
script_bytes,
Expand Down
1 change: 0 additions & 1 deletion key-wallet/src/wallet/managed_wallet_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod managed_account_operations;
pub mod managed_accounts;
pub mod transaction_builder;
pub mod transaction_building;
pub mod utxo;
pub mod wallet_info_interface;

pub use managed_account_operations::ManagedAccountOperations;
Expand Down
216 changes: 0 additions & 216 deletions key-wallet/src/wallet/managed_wallet_info/utxo.rs

This file was deleted.