-
Notifications
You must be signed in to change notification settings - Fork 311
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
refactor(wallet)!: Use Weight
type instead of usize
#1468
refactor(wallet)!: Use Weight
type instead of usize
#1468
Conversation
e0acc69
to
fe0f5e5
Compare
44e446f
to
3bcb211
Compare
Weight
type instead of usize
Weight
type instead of usize
3bcb211
to
51e6f6d
Compare
@evanlinjin mentioned it the #1448 (comment). I'm moving the discussion to here as I've tried to address it here at 51e6f6d. edit: also refer to upstream issue rust-bitcoin/rust-miniscript#695 |
Ok, moving my comment here: Regarding the error path of
|
Thanks for the suggestions! Although I've tried to do something similar to option (1), I'm now wondering about option (2), still need to think about the possible panics down the line 🤔 |
I'm wondering whether it's even possible to create a bdk Wallet with an unsatisfiable descriptor |
51e6f6d
to
6250c36
Compare
I think that what idea (2) meant was to use the If we hit that, then we get a I think that's what it is meant as could cause panics. What am I missing? I probably could be wrong here. |
I'm also ok with just fixing the |
6250c36
to
70a568b
Compare
Yes, I removed the other commit. I only fixes the usage of |
70a568b
to
729fec6
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 729fec6
I know this is picky but since this change is API breaking, the commit should tell us that in conventional commits style, so something like
refactor(wallet)!: change
WeightedUtxo
to useWeight
type
In general the changelog should communicate any API changes so in this case the fact that WeightedUtxo
is changed as well as the function signatures for add_foreign_utxo{_with_sequence}
Note to reviewers we didn't fix the unwrap
for max_weight_to_satisfy
but an issue has been created to discuss further.
729fec6
to
d8c609b
Compare
No worries, thanks for the suggestions. 🚀 |
d8c609b
to
438cd46
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.
I'm also ok with just fixing the
usize
toWeight
stuff in this PR and creating a separate issue to decide how to handle an unsatisfiable descriptor
I second this. Do we have the issue open? I did not see linked to this PR.
Anyways, ACK 438cd46
Yes, it's on the PR description, issue: #1485 |
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 438cd46
Weight
type instead of usize
Weight
type instead of usize
fixes #1466
depends on #1448
Description
This PR is a follow-up on top of #1448, and should be rebased and merged after it, it uses the rust-bitcoin
Weight
type instead of the currentusize
usage.NOTE:
It also adds a newAs suggested I'll address this on another issue #1485, trying to reproduce the error first.MiniscriptError
variant, and remove the.unwrap()
usage.Notes to the reviewers
It should be ready to review after #1448 gets merged.
Changelog notice
WeightedUtxo
satisfaction_weight
has been changed to useWeight
type.TxBuilder
methodsadd_foreign_utxo
andadd_foreign_utxo_with_sequence
to expectWeight
assatisfaction_weight
type.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing