diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 16b9d88b..0152fcfc 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -205,7 +205,7 @@ where script_type: ScriptType, id: SignerId, ordering: SignerOrdering, - signer: Arc>, + signer: Arc, ) { let signers = match script_type { ScriptType::External => Arc::make_mut(&mut self.signers), diff --git a/src/wallet/signer.rs b/src/wallet/signer.rs index 5ac1ce7a..f0392a80 100644 --- a/src/wallet/signer.rs +++ b/src/wallet/signer.rs @@ -82,7 +82,7 @@ //! ScriptType::External, //! Fingerprint::from_str("e30f11b8").unwrap().into(), //! SignerOrdering(200), -//! Arc::new(Box::new(custom_signer)) +//! Arc::new(custom_signer) //! ); //! //! # Ok::<_, bdk::Error>(()) @@ -320,7 +320,7 @@ impl From<(SignerId, SignerOrdering)> for SignersContainerKey { /// Container for multiple signers #[derive(Debug, Default, Clone)] -pub struct SignersContainer(BTreeMap>>); +pub struct SignersContainer(BTreeMap>); impl SignersContainer { pub fn as_key_map(&self) -> KeyMap { @@ -346,12 +346,12 @@ impl From for SignersContainer { .to_pubkeyhash(), ), SignerOrdering::default(), - Arc::new(Box::new(private_key.key)), + Arc::new(private_key.key), ), DescriptorSecretKey::XPrv(xprv) => container.add_external( SignerId::from(xprv.root_fingerprint()), SignerOrdering::default(), - Arc::new(Box::new(xprv)), + Arc::new(xprv), ), }; } @@ -372,17 +372,13 @@ impl SignersContainer { &mut self, id: SignerId, ordering: SignerOrdering, - signer: Arc>, - ) -> Option>> { + signer: Arc, + ) -> Option> { self.0.insert((id, ordering).into(), signer) } /// Removes a signer from the container and returns it - pub fn remove( - &mut self, - id: SignerId, - ordering: SignerOrdering, - ) -> Option>> { + pub fn remove(&mut self, id: SignerId, ordering: SignerOrdering) -> Option> { self.0.remove(&(id, ordering).into()) } @@ -395,12 +391,12 @@ impl SignersContainer { } /// Returns the list of signers in the container, sorted by lowest to highest `ordering` - pub fn signers(&self) -> Vec<&Arc>> { + pub fn signers(&self) -> Vec<&Arc> { self.0.values().collect() } /// Finds the signer with lowest ordering for a given id in the container. - pub fn find(&self, id: SignerId) -> Option<&Arc>> { + pub fn find(&self, id: SignerId) -> Option<&Arc> { self.0 .range(( Included(&(id.clone(), SignerOrdering(0)).into()),