Skip to content

Commit

Permalink
wallet: add WalletDescr::with_descriptor_mut method
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Aug 29, 2024
1 parent bf54d1b commit 01a6a16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ impl<K, D: Descriptor<K>, L2: Layer2Descriptor> WalletDescr<K, D, L2> {
_phantom: PhantomData,
}
}

pub fn with_descriptor_mut<E>(
&mut self,
f: impl FnOnce(&mut D) -> Result<(), E>,
) -> Result<(), E> {
f(&mut self.generator)?;
self.mark_dirty();
Ok(())
}

Check warning on line 140 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L133-L140

Added lines #L133 - L140 were not covered by tests
}

impl<K, D: Descriptor<K>, L2: Layer2Descriptor> Deref for WalletDescr<K, D, L2> {
Expand Down

0 comments on commit 01a6a16

Please sign in to comment.