Re-import PSBTv0 code from rust-bitcoin and rust-miniscript#23
Merged
Re-import PSBTv0 code from rust-bitcoin and rust-miniscript#23
rust-bitcoin and rust-miniscript#23Conversation
76ed608 to
d8405f4
Compare
We would like the PSBTv0 code to be as close as possible to the code we originally imported from `rust-bitcoin` and `rust-miniscript`. This gives us a few things: - Same code means downstream can easily switch from using the `psbt` modules in `rust-bitcoin` and `rust-miniscritp`, hopefully just need to change import paths. - Re-basing on new versions of the original code will be easier and less bug-prone if the files stay as close to the same as possible. Re-import the original code, make as few a changes as possible to get it to build. Use the same directory structure as the original, unlike what we did when we originally imported the code. Note, this patch is not PSBTv2 compliant because deserialization of v0 PSBTs does not fail for excluded map keys. That will be added in a subsequent patch.
With the introduction of BIP-370 there are now map keys that must be explicitly excluded instead of added to the `unknowns` map. Check for excluded keys when deserializing the three maps (input, output, and global).
We don't control the function signature that this helper function must conform to. Just shoosh clippy.
d8405f4 to
162e8f5
Compare
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.
We would like the PSBTv0 code to be as close as possible to the code we originally imported from
rust-bitcoinandrust-miniscript. This gives us a few things:psbtmodules inrust-bitcoinandrust-miniscritp, hopefully just need to change import paths.Re-import the original code, make as few a changes as possible to get it to build. Use the same directory structure as the original, unlike what we did when we originally imported the code.
Note, this patch is not PSBTv2 compliant because deserialization of v0 PSBTs does not fail for excluded map keys. That will be added in a subsequent patch.