Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): merge_chains outdated documentation #1806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/chain/src/local_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,10 @@ impl std::error::Error for ApplyHeaderError {}

/// Applies `update_tip` onto `original_tip`.
///
/// On success, a tuple is returned `(changeset, can_replace)`. If `can_replace` is true, then the
/// `update_tip` can replace the `original_tip`.
/// On success, a tuple is returned `([`CheckPoint`], [`ChangeSet`])`.
///
/// [`CheckPoint`]: bdk_core::CheckPoint
/// [`ChangeSet`]: bdk_chain::local_chain::CheckPoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a note about how this could fail when the chains don't connect. The test update_local_chain has some examples of this where the error is typically a variation of "two disjoint chains cannot merge".

I see we also propagate the error from apply_changeset_to_checkpoint, but as far as I know we don't have coverage for it (#1576).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll take a look at those.

fn merge_chains(
original_tip: CheckPoint,
update_tip: CheckPoint,
Expand Down
Loading