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

docs: update docs to point to derivation_of_spk #1361

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions crates/bdk/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,8 @@ impl<D> Wallet<D> {
}

/// Return whether or not a `script` is part of this wallet (either internal or external)
/// Use `derivation_of_spk` function to find the `KeychainKind` for the `script`, or
/// None if there's no associated `Keychain`.
Comment on lines 817 to +819
Copy link
Member

Choose a reason for hiding this comment

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

Please follow rust doc conventions. Ref: https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#documenting-components

We want a separate section for the more detailed description. Also, for clarity, I would reword it like so: "If you wish to find the KeychainKind for the given script, use derivation_of_spk instead."

In addition to this, please have a link for derivation_of_spk.

Copy link
Author

Choose a reason for hiding this comment

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

Would it make sense to have seperate section telling about the derivation_of_spk in detail and include that point ?

Copy link
Member

Choose a reason for hiding this comment

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

If you want to expand on derivation_of_spk, it should be part of the docs on derivation_of_spk, not here.

pub fn is_mine(&self, script: &Script) -> bool {
self.indexed_graph.index.index_of_spk(script).is_some()
}
Expand Down
Loading