Skip to content

Commit

Permalink
Merge #1734: chore(chain)!: use debug_assert! on apply_update
Browse files Browse the repository at this point in the history
2ec5aa4 chore(chain)!: use `debug_assert!` on `apply_update` (Leonardo Lima)

Pull request description:

  fixes #1689

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description
  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`.

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  - Add usage of `debug_assert!()` to `LocalChain::apply_update`.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  ValuedMammal:
    ACK 2ec5aa4 Thank you @oleonardolima
  notmandatory:
    ACK 2ec5aa4

Tree-SHA512: 31ac1accc825fb2b9ecfde38e43c2a662f933cfc0b8488775276ca770a5cce1d61a20ad8ba689327ed264252ad2f3ae10c9baba462a22f567395df493fb24886
  • Loading branch information
notmandatory committed Nov 22, 2024
2 parents 62e84d7 + 2ec5aa4 commit 03c7368
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/chain/src/local_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 03c7368

Please sign in to comment.