-
Notifications
You must be signed in to change notification settings - Fork 382
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
Upgrade to rust-bitcoin 0.29 #770
Upgrade to rust-bitcoin 0.29 #770
Conversation
I added a link in the description to bitcoindevkit/rust-esplora-client#20, it should be merged shortly and then we can create a new |
4116dfa
to
8cab6f0
Compare
15c9385
to
1ffd59d
Compare
@@ -1,8 +1,18 @@ | |||
// Bitcoin Dev Kit | |||
// | |||
// Copyright (c) 2020-2021 Bitcoin Dev Kit Developers |
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.
Small nit, the year should be bumped to 2022 or soon 2023. But I think we should do this for all the files that need updating in one PR. I'll open a PR and we can discuss there.
@@ -4832,7 +4752,7 @@ pub(crate) mod test { | |||
let (wallet, _, _) = get_funded_wallet(get_test_tr_repeated_key()); | |||
let addr = wallet.get_address(AddressIndex::New).unwrap(); | |||
|
|||
let path = vec![("rn4nre9c".to_string(), vec![0])] | |||
let path = vec![("e5mmg3xh".to_string(), vec![0])] |
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.
Just curious, why did the policy path id change here? is it related to the miniscript update?
assert!(result); | ||
} | ||
|
||
#[test] |
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.
Were the tests here removed because they aren't needed/valid? or are did they break and need to be fixed?
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 c7a43d9
I was only able to do a shallow review, and had a few questions but no show stoppers. Since this is primarily version bumping dependencies I'm counting our our test coverage to ensure nothing important was broke.
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 have some comments, I still need to review src/descriptor/mod.rs
@@ -98,6 +98,11 @@ test-esplora = ["electrsd/legacy", "electrsd/esplora_a33e97e1", "electrsd/bitcoi | |||
test-md-docs = ["electrum"] | |||
test-hardware-signer = ["hardware-signer"] | |||
|
|||
# This feature is used to run `cargo check` in our CI targeting wasm. It's not recommended | |||
# for libraries to explicitly include the "getrandom/js" feature, so we only do it when | |||
# necessary for running our CI. See: https://docs.rs/getrandom/0.2.8/getrandom/#webassembly-support |
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.
nit: add something along the lines as
If you plan to use BDK with wasm, don't include this feature, but include getrandom
instead. More info here: link to README
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 found this a little confusing too, but I was thinking a little example project would be the best way to demo how to use bdk + wasm.
@@ -1,63 +0,0 @@ | |||
// Bitcoin Dev Kit |
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.
Why are address validators being removed? Is it because they are replaced by something in the new rust-bitcoin? (If you could expand a bit more in the changelog as well, it'd be great!)
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.
Ohhh they were deprecated already, sorry
>= self | ||
.create_height | ||
.unwrap_or(0) | ||
.checked_add(n.to_consensus_u32()) |
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.
if n is in seconds, doing create_height + *seconds value*
is wrong
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.
@@ -999,6 +1008,9 @@ impl<Ctx: ScriptContext + 'static> ExtractPolicy for Miniscript<DescriptorPublic | |||
|
|||
Policy::make_thresh(mapped, threshold)? | |||
} | |||
|
|||
// Unsupported | |||
Terminal::RawPkH(_) => None, |
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 am not really sure what's going on here, can you add a little comment explaining why it's unsupported? (If it's trivial, it's ok if you just reply to this comment without commenting the code :))
psbt_input.redeem_script = derived_descriptor.psbt_redeem_script(); | ||
psbt_input.witness_script = derived_descriptor.psbt_witness_script(); | ||
psbt_input | ||
.update_with_descriptor_unchecked(&derived_descriptor) |
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.
Can you add a comment explaining why it's unchecked here?
Description
Upgrade BDK to rust-bitcoin 0.29
Missing pieces:
update_output_with_descriptor
- AddPsbtOutputExt::update_with_descriptor
rust-bitcoin/rust-miniscript#465Notes to the reviewers
The commits still need to be reordered and cleaned up
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing