-
Notifications
You must be signed in to change notification settings - Fork 320
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(wallet): reword the next_unused_address
doc
#1680
docs(wallet): reword the next_unused_address
doc
#1680
Conversation
168fbbe
to
83f86cd
Compare
83f86cd
to
07b85ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 07b85ca
New name looks good to me.
Okay thinking about it, this method actually returns the earliest unused... |
lets make this a doc only change |
As per last call discussion, I'll repurpose this PR to keep |
Will re-review after new direction changes pushed.
FWIW the docs tripped me up a bit, such that I was confused what the actual difference between On subsequent readings it's perfectly clear, so I might have just been careless in my first reading... But I think the distinction between "used" and "derived" was not in my mind on my first reading.
Maybe instead of "available" it could be "unused" ? ("available" sent my mind to the generated key pools of pre-HD wallet bitcoin core) and/or at the risk of repeating nearly the same thing as the first and second lines, add something like "If any previously derived addresses are unused, |
@Ademan That's a great suggestion, thanks for weighing in on this. Here's another way we could word it as well: /// This will attempt to reveal a new address if all previously revealed addresses have
/// been used, in which case the returned address will be the same as calling
/// [`reveal_next_address`].
|
I like that! It directly contrasts the two calls. As a side note, is there are reason why BDK uses the word "reveal" instead of "derive" in the API? |
When you create a wallet we first derive a number of addresses (script pubkeys) and store them internally. When you reveal an address, it comes from the pool of derived scripts. The concept of "revealing" exists for the purpose of keeping track of the highest index that we've uncovered. An address is considered "used" when you receive a transaction paying to that address. |
07b85ca
to
7ece14a
Compare
last_unused_address
next_unused_address
doc
Thanks for the suggestions. I repurposed the PR to have only the documentation change: i) added a statement on what |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7ece14a.
@notmandatory @ValuedMammal do we want to get this one in for 1.0? Any other required changes? |
7ece14a
to
bcc5329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-ACK d051e73
@oleonardolima please just squash the commits and then we can merge this one. |
docs(wallet): reword the `next_unused_address` doc Adds an example on what `used` stands for, and make it explicit that it has the same behavior as `Wallet::reveal_next_address` in the scenario where all previously revealed addresses have been used. docs(wallet): fix typo in doc comment
d051e73
to
b39cf08
Compare
Done b39cf08, sorry for the typo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b39cf08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b39cf08
Description
Adds an example on what
used
stands for, and make it explicit that ithas the same behavior as
Wallet::reveal_next_address
in the scenariowhere all previously revealed addresses have been used.
Notes to the reviewers
Is there any other behavior of
next_unused_address
we'd need to make clear through documentation ?Changelog notice
Wallet::next_unused_address
documentation to better describe expected behavior/usage.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: