backport part of 4915: Deprecate weight constructors#5082
Closed
tcharding wants to merge 1 commit intorust-bitcoin:0.32.xfrom
Closed
backport part of 4915: Deprecate weight constructors#5082tcharding wants to merge 1 commit intorust-bitcoin:0.32.xfrom
tcharding wants to merge 1 commit intorust-bitcoin:0.32.xfrom
Conversation
Deprecation in trait methods is painful and these two weight constructors are now defined in `TxInExt`. In rust-bitcoin#4915 we deprecate `Weight::from_non_witness_data_size` and `Weight::from_witness_data_size` in favour of `Weight::from_vb` and `Weight::from_wu` respectively but doing so messes with the APIs of these to `TxIn` methods because the return value changes from `Weight` to `Option<Weight>`. Deprecate the functions here so we can either break the API in 0.33 or delete the functions entirely. Note this only does the stuff from 4915 in `bitcoin` not in `units`.
4690210 to
789e23f
Compare
Member
|
See my comment on #4915 -- I think we need to also add replacement methods since currently there aren't really any, so users can't take action based on this deprecation notice. |
Member
Author
|
You mean the conversation starting here, right: #4915 (comment) My interpretation of that convo is just to close this PR and do the break on master. |
Member
|
Yep, that's the conversation I mean. And yes, agreed, you've convinced me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deprecation in trait methods is painful and these two weight constructors are now defined in
TxInExt.In #4915 we deprecate
Weight::from_non_witness_data_sizeandWeight::from_witness_data_sizein favour ofWeight::from_vbandWeight::from_wurespectively but doing so messes with the APIs of these toTxInmethods because the return value changes fromWeighttoOption<Weight>.Deprecate the functions here so we can either break the API in 0.33 or delete the functions entirely.
Note this only does the stuff from 4915 in
bitcoinnot inunits.