fix: remove deprecated max_satisfaction_weight
Description
Continuation of #1115. Closes #1036.
- Change deprecated
max_satisfaction_weighttomax_weight_to_satisfy - Remove
#[allow(deprecated)]flags
Notes to the reviewers
I've changed all max_satisfaction_weight() to max_weight_to_satisfy() in Wallet.get_available_utxo() and Wallet.build_fee_bump(). Checking the docs on the miniscript crate for max_weight_to_satisfy has the following note:
We are testing if the underlying descriptor is.segwit() or .is_taproot,
then adding 4WU if true or leaving as it is otherwise.
Another thing, we are not testing in BDK tests for legacy (pre-segwit) descriptors. Should I also add them to this PR?
Changelog notice
Fixed
Replace the deprecated max_satisfaction_weight from rust-miniscript to max_weight_to_satisfy.
Checklists
All Submissions:
- [x] I've signed all my commits
- [x] I followed the contribution guidelines
- [x] I ran
cargo fmtandcargo clippybefore committing
Bugfixes:
- [ ] This pull request breaks the existing API
- [ ] I've added tests to reproduce the issue which are now passing
- [x] I'm linking the issue being fixed by this PR
Can I please have some input on my statement here? Thanks!
I think it's okay to assume all transactions are segwit transactions for now? Unless if someone can figure out how to take away the witness len elegantly (for non-segwit txs).
I think it's okay to assume all transactions are segwit transactions for now? Unless if someone can figure out how to take away the witness len elegantly (for non-segwit txs).
I agree. We currently don't test any non-segwit tx anyways...
I think it's okay to assume all transactions are segwit transactions for now? Unless if someone can figure out how to take away the witness len elegantly (for non-segwit txs).
Because we already assume this:
https://github.com/bitcoindevkit/bdk/blob/master/crates%2Fbdk%2Fsrc%2Fwallet%2Fmod.rs#L1505-L1513
So I think it is okay.
@storopoli can we please rebase the two commits into one and I'll ACK it.
@storopoli can we please rebase the two commits into one and I'll ACK it.
Done, thanks mate!
@storopoli sorry can you do a rebase on master? thanks
@storopoli sorry can you do a rebase on master? thanks
Don't worry man. Sure, rebased to master :)