File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -617,6 +617,7 @@ mod tests {
617617 Arc :: new ( Descriptor :: new ( internal_descriptor, Network :: Signet ) . unwrap ( ) ) ,
618618 Network :: Signet ,
619619 Arc :: new ( Connection :: new_in_memory ( ) . unwrap ( ) ) ,
620+ None ,
620621 )
621622 . unwrap ( ) ;
622623 let client = EsploraClient :: new ( "https://mutinynet.com/api/" . to_string ( ) , None ) ;
Original file line number Diff line number Diff line change @@ -41,23 +41,23 @@ impl Wallet {
4141 /// Build a new Wallet.
4242 ///
4343 /// If you have previously created a wallet, use load instead.
44- #[ uniffi:: constructor]
44+ #[ uniffi:: constructor( default ( lookahead = None ) ) ]
4545 pub fn new (
4646 descriptor : Arc < Descriptor > ,
4747 change_descriptor : Arc < Descriptor > ,
4848 network : Network ,
4949 connection : Arc < Connection > ,
50+ lookahead : Option < u32 > ,
5051 ) -> Result < Self , CreateWithPersistError > {
5152 let descriptor = descriptor. to_string_with_secret ( ) ;
5253 let change_descriptor = change_descriptor. to_string_with_secret ( ) ;
5354 let mut binding = connection. get_store ( ) ;
5455 let db: & mut BdkConnection = binding. borrow_mut ( ) ;
55-
56- let wallet: PersistedWallet < BdkConnection > =
57- BdkWallet :: create ( descriptor, change_descriptor)
58- . network ( network)
59- . create_wallet ( db) ?;
60-
56+ let mut params = BdkWallet :: create ( descriptor, change_descriptor) . network ( network) ;
57+ if let Some ( lookahead) = lookahead {
58+ params = params. lookahead ( lookahead) ;
59+ }
60+ let wallet: PersistedWallet < BdkConnection > = params. create_wallet ( db) ?;
6161 Ok ( Wallet {
6262 inner_mutex : Mutex :: new ( wallet) ,
6363 } )
You can’t perform that action at this time.
0 commit comments