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
8 changes: 4 additions & 4 deletions bdk-ffi/src/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,15 +605,15 @@ impl From<&BdkTxIn> for TxIn {
#[derive(Debug, Clone, uniffi::Record)]
pub struct TxOut {
/// The value of the output, in satoshis.
pub value: u64,
pub value: Arc<Amount>,
/// The script which must be satisfied for the output to be spent.
pub script_pubkey: Arc<Script>,
}

impl From<&BdkTxOut> for TxOut {
fn from(tx_out: &BdkTxOut) -> Self {
TxOut {
value: tx_out.value.to_sat(),
value: Arc::new(Amount(tx_out.value)),
script_pubkey: Arc::new(Script(tx_out.script_pubkey.clone())),
}
}
Expand All @@ -622,7 +622,7 @@ impl From<&BdkTxOut> for TxOut {
impl From<BdkTxOut> for TxOut {
fn from(tx_out: BdkTxOut) -> Self {
Self {
value: tx_out.value.to_sat(),
value: Arc::new(Amount(tx_out.value)),
script_pubkey: Arc::new(Script(tx_out.script_pubkey)),
}
}
Expand All @@ -631,7 +631,7 @@ impl From<BdkTxOut> for TxOut {
impl From<TxOut> for BdkTxOut {
fn from(tx_out: TxOut) -> Self {
Self {
value: BdkAmount::from_sat(tx_out.value),
value: tx_out.value.0,
script_pubkey: tx_out.script_pubkey.0.clone(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion bdk-ffi/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl From<BdkLocalOutput> for LocalOutput {
vout: local_utxo.outpoint.vout,
},
txout: TxOut {
value: local_utxo.txout.value.to_sat(),
value: Arc::new(Amount(local_utxo.txout.value)),
script_pubkey: Arc::new(Script(local_utxo.txout.script_pubkey)),
},
keychain: local_utxo.keychain,
Expand Down
Loading