Skip to content

Commit 1e84562

Browse files
committed
refactor: use macros for CanonicalTx
1 parent cae7f37 commit 1e84562

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bdk-ffi/src/bdk.udl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,7 @@ typedef dictionary TxOut;
309309

310310
typedef enum ChainPosition;
311311

312-
dictionary CanonicalTx {
313-
Transaction transaction;
314-
ChainPosition chain_position;
315-
};
312+
typedef dictionary CanonicalTx;
316313

317314
/// Builds a [`FullScanRequest`].
318315
interface FullScanRequestBuilder {

bdk-ffi/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use crate::keys::DescriptorPublicKey;
4444
use crate::keys::DescriptorSecretKey;
4545
use crate::keys::Mnemonic;
4646
use crate::types::AddressInfo;
47-
use crate::types::CanonicalTx;
4847
use crate::types::ChainPosition;
4948
use crate::types::Condition;
5049
use crate::types::FullScanRequest;

bdk-ffi/src/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ pub struct BlockId {
101101
pub hash: String,
102102
}
103103

104+
/// A transaction that is deemed to be part of the canonical history.
105+
#[derive(uniffi::Record)]
104106
pub struct CanonicalTx {
107+
/// The transaction.
105108
pub transaction: Arc<Transaction>,
109+
/// How the transaction is observed in the canonical chain (confirmed or unconfirmed).
106110
pub chain_position: ChainPosition,
107111
}
108112

0 commit comments

Comments
 (0)