Remove Witness::from_parts__unstable#5139
Conversation
|
I wouldn't call this a "hack", but it does stuff in the wrong order. What we should do instead is add a dep to Then most of your "ugly hack" would be replaced with a call to So let's add a variant to |
I did try that this morning but ran into trouble, I stopped at the EDIT: Oh I remember now, |
|
You should add the variant to In this current PR you add a variant to |
|
Oh I didn't think of that, it will mean the |
aabd6b5 to
17423e1
Compare
|
Lint failure is real (clippy) |
17423e1 to
54c782c
Compare
|
Looks like this still inlines "decode from bitcoin::io::BufRead" logic which should be in |
|
Thanks, I'll come back. |
I'm not sure what you mean? This is a copy of |
|
It should be a single call to |
54c782c to
77ff014
Compare
77ff014 to
b5ccd0d
Compare
85f78e0 to
3c42ec3
Compare
|
🚨 API BREAKING CHANGE DETECTED To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section. |
3c42ec3 to
9f0dd8d
Compare
|
🚨 API BREAKING CHANGE DETECTED To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section. |
|
The API break is expected and comes from #5249. |
9f0dd8d to
5e823e8
Compare
Use the new `consensus_encoding` crate (by way of the `io` crate decoding function) to implement `consensus_decode` for `Witness`. This is ugly a bit ugly because we remove equality derives from `ParseError` so that we can jam the witness decoding error into it. Cleanly it should not go there but in order to keep `encode::deserialize_partial` working we have to be able to return a `ParseError` and we have to be able to include the witness decoding error if there was one. Each subsequent time we try to do this in other decoding impls we will add a new error variant each time also. This encoding code is on its way out and will hopefully be deprecated soon so I believe this is ok.
5e823e8 to
4edc248
Compare
This was added solely so that we could call it in the consensus decoding function in `bitcoin`. That call site no longer exists, remove the function.
4edc248 to
9b261de
Compare
This is nice enough now. Use the new
consensus_encodingcrate to decode aWitness(inbitcoin). Then remove thefrom_parts__unstablefunction.Close #4062