Handle PSBT_GLOBAL_XPUB in PSBT global scope#519
Closed
justinmoon wants to merge 1 commit intorust-bitcoin:masterfrom
justinmoon:global-xpub
Closed
Handle PSBT_GLOBAL_XPUB in PSBT global scope#519justinmoon wants to merge 1 commit intorust-bitcoin:masterfrom justinmoon:global-xpub
justinmoon wants to merge 1 commit intorust-bitcoin:masterfrom
justinmoon:global-xpub
Conversation
justinmoon
commented
Nov 16, 2020
| /// empty. | ||
| pub unsigned_tx: Transaction, | ||
| /// Extended pubkey metadata for PSBT signers | ||
| pub global_xpub: BTreeMap<ExtendedPubKey, KeySource>, |
Author
There was a problem hiding this comment.
Maybe I should just call it xpubs?
justinmoon
commented
Nov 16, 2020
|
|
||
| #[test] | ||
| fn global_xpub() { | ||
| let raw = "70736274ff01009d0100000002710ea76ab45c5cb6438e607e59cc037626981805ae9e0dfd9089012abb0be5350100000000ffffffff190994d6a8b3c8c82ccbcfb2fba4106aa06639b872a8d447465c0d42588d6d670000000000ffffffff0200e1f505000000001976a914b6bc2c0ee5655a843d79afedd0ccc3f7dd64340988ac605af405000000001600141188ef8e4ce0449eaac8fb141cbf5a1176e6a088000000004f010488b21e039e530cac800000003dbc8a5c9769f031b17e77fea1518603221a18fd18f2b9a54c6c8c1ac75cbc3502f230584b155d1c7f1cd45120a653c48d650b431b67c5b2c13f27d7142037c1691027569c503100008000000080000000800001011f00e1f5050000000016001433b982f91b28f160c920b4ab95e58ce50dda3a4a220203309680f33c7de38ea6a47cd4ecd66f1f5a49747c6ffb8808ed09039243e3ad5c47304402202d704ced830c56a909344bd742b6852dccd103e963bae92d38e75254d2bb424502202d86c437195df46c0ceda084f2a291c3da2d64070f76bf9b90b195e7ef28f77201220603309680f33c7de38ea6a47cd4ecd66f1f5a49747c6ffb8808ed09039243e3ad5c1827569c5031000080000000800000008000000000010000000001011f00e1f50500000000160014388fb944307eb77ef45197d0b0b245e079f011de220202c777161f73d0b7c72b9ee7bde650293d13f095bc7656ad1f525da5fd2e10b11047304402204cb1fb5f869c942e0e26100576125439179ae88dca8a9dc3ba08f7953988faa60220521f49ca791c27d70e273c9b14616985909361e25be274ea200d7e08827e514d01220602c777161f73d0b7c72b9ee7bde650293d13f095bc7656ad1f525da5fd2e10b1101827569c5031000080000000800000008000000000000000000000220202d20ca502ee289686d21815bd43a80637b0698e1fbcdbe4caed445f6c1a0a90ef1827569c50310000800000008000000080000000000400000000"; |
Author
There was a problem hiding this comment.
This text vector is from BIP 174
justinmoon
commented
Nov 16, 2020
| ret[45..78].copy_from_slice(&self.public_key.key.serialize()[..]); | ||
| ret.to_vec() | ||
| } | ||
| } |
Author
There was a problem hiding this comment.
This code is mostly copied from the Display impl for ExtendedPubKey. I'm sure there's a better way ...
justinmoon
commented
Nov 16, 2020
| } = pair; | ||
|
|
||
| match raw_key.type_value { | ||
| 1u8 => {} |
Author
There was a problem hiding this comment.
This entire insert_pair method isn't called by anything since we don't use the impl_psbtmap_consensus_decoding macro on Global, currently. Not sure what to do here ...
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.
Edit: hmmmm just realized that #499 does much the same thing 😬