From e037568c5fe647e524e6c493a8910260e9ba1da1 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 25 Jun 2025 19:31:09 -0500 Subject: [PATCH] refactor: use macros for `WordCount` --- bdk-ffi/src/bdk.udl | 8 -------- bdk-ffi/src/lib.rs | 1 - bdk-ffi/src/types.rs | 11 +++++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index ab853e35..24663806 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -304,14 +304,6 @@ typedef record Condition; // bdk_wallet crate - bitcoin re-exports // ------------------------------------------------------------------------ -[Remote] -enum WordCount { - "Words12", - "Words15", - "Words18", - "Words21", - "Words24", -}; typedef interface Script; diff --git a/bdk-ffi/src/lib.rs b/bdk-ffi/src/lib.rs index 0c65db76..70d11b08 100644 --- a/bdk-ffi/src/lib.rs +++ b/bdk-ffi/src/lib.rs @@ -35,6 +35,5 @@ use crate::types::LockTime; use crate::types::PkOrF; use bdk_wallet::bitcoin::Network; -use bdk_wallet::keys::bip39::WordCount; uniffi::include_scaffolding!("bdk"); diff --git a/bdk-ffi/src/types.rs b/bdk-ffi/src/types.rs index 3b56aebd..d6ae57b8 100644 --- a/bdk-ffi/src/types.rs +++ b/bdk-ffi/src/types.rs @@ -48,6 +48,17 @@ pub enum KeychainKind { Internal = 1, } +type WordCount = bdk_wallet::keys::bip39::WordCount; + +#[uniffi::remote(Enum)] +pub enum WordCount { + Words12, + Words15, + Words18, + Words21, + Words24, +} + /// Represents the observed position of some chain data. #[derive(Debug, uniffi::Enum, Clone)] pub enum ChainPosition {