]> Untitled Git - bdk/commitdiff
chore(chain)!: use `debug_assert!` on `apply_update`
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Tue, 19 Nov 2024 16:27:20 +0000 (13:27 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Tue, 19 Nov 2024 16:27:20 +0000 (13:27 -0300)
As mentioned in issue #1689 the `debug_assert!` is being used on other
`LocalChain` methods, such as: `from_changeset`, and `apply_changeset`
but it was missing on `apply_update`.

crates/chain/src/local_chain.rs

index e16131db32f6fa4017593b3caafeb8c8887e286c..b9a1b645c8187226916e0bfda7ef201d69cbaccd 100644 (file)
@@ -174,7 +174,7 @@ impl LocalChain {
     pub fn apply_update(&mut self, update: CheckPoint) -> Result<ChangeSet, CannotConnectError> {
         let (new_tip, changeset) = merge_chains(self.tip.clone(), update)?;
         self.tip = new_tip;
-        self._check_changeset_is_applied(&changeset);
+        debug_assert!(self._check_changeset_is_applied(&changeset));
         Ok(changeset)
     }