Refactor, second episode: move to PSBTs#21
Merged
darosior merged 12 commits intorevault:masterfrom Oct 3, 2020
Merged
Conversation
Member
Author
|
Rebased after #10 rebase. |
Member
Author
|
Rebased after #10 merge 🎉 |
darosior
commented
Oct 2, 2020
| sigmap: &'a mut BTreeMap<bitcoin::PublicKey, Vec<u8>>, | ||
| sequence: u32, | ||
| ) -> RevaultInputSatisfier { | ||
| // This hack isn't going to last, see above. |
Member
Author
There was a problem hiding this comment.
Actually it is, here or upstream :)
5f84d66 to
5e4dd40
Compare
Member
Author
edouardparis
reviewed
Oct 2, 2020
| bitcoin::Address::p2wsh(witness_script, bitcoin::Network::Bitcoin) | ||
| .script_pubkey(); | ||
| if expected_script_pubkey | ||
| != psbtin |
Member
There was a problem hiding this comment.
weird indentation, Is it rustfmt ?
JSwambo
reviewed
Oct 2, 2020
src/txins.rs
Outdated
| /// Get a reference to the txout this txin refers | ||
| fn txout(&self) -> &T; | ||
| /// Get the actual txout this txin refers | ||
| fn get_txout(self) -> T; |
Member
There was a problem hiding this comment.
rename to as_outpoint(), as_txout(), into_txout() as per #19 ?
Member
Author
There was a problem hiding this comment.
I considered doing an actual cleanup PR for this and the documentation (maybe some more test cov as well). I could avoid introducing more here but... That incurs some non-trivial rebases (opened the issue after finishing this, fwiw)
JSwambo
reviewed
Oct 2, 2020
| @@ -12,28 +15,36 @@ pub trait RevaultTxOut: fmt::Debug + Clone + PartialEq { | |||
| fn inner_txout(&self) -> &TxOut; | |||
| /// Get the actual inner txout | |||
| fn get_txout(self) -> TxOut; | |||
JSwambo
reviewed
Oct 2, 2020
JSwambo
approved these changes
Oct 2, 2020
edouardparis
reviewed
Oct 2, 2020
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This also removes the useless test_transaction_creation() test, just added to highlight the API. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Still prep work for PSBT integration Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This avoids confusion, also some slight drive-by doc improvements. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This was coming. PrevOuts can be reused and with the inclusion of the TxOut into them we lost the Copy, intuitively bounding their lifetimes to one usage. Besides, we had those monstruous inputs in RevaultTransactions' new()s. Now that their sequence is bounded to them, they are one-shot transaction inputs, and their usage is much more intuitive! Of course, this helps me with PSBT as well :-) Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This: - Replaces the inner Transaction by a PSBT in RevaultTransaction - Adapts the API to use BIP174 roles (somewhat) - Implements the satisfaction as part of the RevaultTransaction, under the Finalizer role. - Still makes use of our internal satisfier (even though the pub API is now part of RevaultTransaction). - Reuses some logic from Miniscript descriptors until upstream implements comprehensive PSBT support for them. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
We won't finalize a transaction that does not pass the libbitcoinconsensus check. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Member
Author
|
Ok so:
Can you re review please ? |
Merged
darosior
added a commit
that referenced
this pull request
Oct 3, 2020
e1ab2c6 transactions: remove state consistency TODO and useless alloc (Antoine Poinsot) 3d2b1f5 transactions: centralize the signature_hash() method (Antoine Poinsot) 6d63c38 transactions: don't unwrap in add_signature() (Antoine Poinsot) 108fc00 Improve documentation, remove error mod (Antoine Poinsot) 1715199 Cargo: use latest stable Miniscript version (Antoine Poinsot) bead86f Change method names to conventional ones (Antoine Poinsot) Pull request description: Based on #21 ACKs for top commit: JSwambo: Ack e1ab2c6 Tree-SHA512: 09e938dc55bf8b3b5330cc2a36695f940d3ccb5ad806a4409eea2160b859f3903cbcf0e69e02567173ade31b573f8a793a42d08bc64a498ef98ddb0aa8c506b2
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.
This is based on #10 (as pretty much everything now..) and implements the usage of PSBT in our
RevaultTransactionmanagement, from the creation to the satisfaction.This unlocked a few side improvements, such as:
The methods of the
RevaultTransactiontraits have been modified with BIP174 roles in mind, which will likely guide us toward less footguns downstream.