@@ -28,10 +28,10 @@ impl SinglesigKeys {
2828 pub ( crate ) fn build_descriptors (
2929 & self ,
3030 bitcoin_network : & BitcoinNetwork ,
31- bdk_network : & BdkNetwork ,
3231 ) -> Result < ( WalletDescriptors , bool ) , Error > {
33- let xpub_rgb = str_to_xpub ( & self . account_xpub_colored , bdk_network) ?;
34- let xpub_btc = str_to_xpub ( & self . account_xpub_vanilla , bdk_network) ?;
32+ let network_kind = bitcoin_network. network_kind ( ) ;
33+ let xpub_rgb = str_to_xpub ( & self . account_xpub_colored , & network_kind) ?;
34+ let xpub_btc = str_to_xpub ( & self . account_xpub_vanilla , & network_kind) ?;
3535 Ok ( if let Some ( mnemonic) = & self . mnemonic {
3636 let descs = get_descriptors (
3737 bitcoin_network,
@@ -154,10 +154,9 @@ impl Wallet {
154154 /// [`SinglesigKeys`].
155155 pub fn new ( wallet_data : WalletData , keys : SinglesigKeys ) -> Result < Self , Error > {
156156 let wdata = wallet_data. clone ( ) ;
157- let bdk_network = BdkNetwork :: from ( wdata. bitcoin_network ) ;
158157
159158 // wallet keys
160- let ( descs, watch_only) = keys. build_descriptors ( & wdata. bitcoin_network , & bdk_network ) ?;
159+ let ( descs, watch_only) = keys. build_descriptors ( & wdata. bitcoin_network ) ?;
161160
162161 // wallet directory and file logging setup
163162 let ( wallet_dir, logger, _logger_guard) =
@@ -170,7 +169,7 @@ impl Wallet {
170169 descs. colored ,
171170 descs. vanilla ,
172171 watch_only,
173- bdk_network ,
172+ BdkNetwork :: from ( wdata . bitcoin_network ) ,
174173 ) ?;
175174
176175 // setup RGB
@@ -204,10 +203,7 @@ impl Wallet {
204203 /// Return the descriptors of the wallet.
205204 pub fn get_descriptors ( & self ) -> WalletDescriptors {
206205 self . keys
207- . build_descriptors (
208- & self . internals . wallet_data . bitcoin_network ,
209- & BdkNetwork :: from ( self . internals . wallet_data . bitcoin_network ) ,
210- )
206+ . build_descriptors ( & self . internals . wallet_data . bitcoin_network )
211207 . expect ( "already succeeded at wallet creation" )
212208 . 0
213209 }
0 commit comments