Skip to content

Commit 19c4c38

Browse files
rustaceanrobthunderbiscuit
authored andcommitted
refactor: use macros for TxOut
1 parent 41e46a8 commit 19c4c38

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

bdk-ffi/src/bdk.udl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -337,20 +337,7 @@ dictionary LocalOutput {
337337
ChainPosition chain_position;
338338
};
339339

340-
/// Bitcoin transaction output.
341-
///
342-
/// Defines new coins to be created as a result of the transaction,
343-
/// along with spending conditions ("script", aka "output script"),
344-
/// which an input spending it must satisfy.
345-
///
346-
/// An output that is not yet spent by an input is called Unspent Transaction Output ("UTXO").
347-
dictionary TxOut {
348-
/// The value of the output, in satoshis.
349-
u64 value;
350-
351-
/// The script which must be satisfied for the output to be spent.
352-
Script script_pubkey;
353-
};
340+
typedef dictionary TxOut;
354341

355342
/// Represents the observed position of some chain data.
356343
[Enum]

bdk-ffi/src/bitcoin.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,18 @@ impl From<&BdkTxIn> for TxIn {
533533
}
534534
}
535535

536-
#[derive(Debug, Clone)]
536+
/// Bitcoin transaction output.
537+
///
538+
/// Defines new coins to be created as a result of the transaction,
539+
/// along with spending conditions ("script", aka "output script"),
540+
/// which an input spending it must satisfy.
541+
///
542+
/// An output that is not yet spent by an input is called Unspent Transaction Output ("UTXO").
543+
#[derive(Debug, Clone, uniffi::Record)]
537544
pub struct TxOut {
545+
/// The value of the output, in satoshis.
538546
pub value: u64,
547+
/// The script which must be satisfied for the output to be spent.
539548
pub script_pubkey: Arc<Script>,
540549
}
541550

0 commit comments

Comments
 (0)