Conversation
|
Still need some polish but almost good |
a8be767 to
1612395
Compare
|
Rebased and squashed, this is now ready for review |
|
Wrt #15 (comment) i wonder how far we should go with type safety. We could for example have I think the current state is a good tradeoff (obviously), but i'm really interested in your opinions as well. |
|
ACK ccb869d |
Benefits: - Enforce types at compilation - Better API (no Result at creation, errors are statics, more fine-grained) - Actual types (no enum variant) Drawbacks: - Boilerplate, partially handled by macros Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Separated from the next one to highlight the usage of the new API. Lot of tests removal here: what was tested would not even compile anymore now :-). Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This is definitely *WAY* nicer to use. The only downside of this one is the panical-libbitcoinconsensus-assertion but hey, i left a FIXME! I found a bug, too. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This corrects a typo that -surprinsingly enough- passed all the tests.. And fixes the tests satisfier. Added some drive-by sanity checks for the 512 seconds granularity "feature" of CSV. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
It's dumb and annoying af Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Now it's done at compile time. Not removing libibtcoinconsensus' one as i expect to get it back Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
I think so too. I think type-safety here helps us guarantee that signatures are only generated for RevaultTransactions that conform to the protocol and avoids unnecessary exposure of private keys for inappropriate transactions. What would be gained from having returning RevaultPrevOut instead of OutPoint? |
Typically it'd have prevented my mistake in #15 (comment) . Which was: // ..Or the spend_tx's change
let _sec_emer_tx = EmergencyTransaction::new(
(VaultPrevout::new(spend_tx.into_prevout(1)), RBF_SEQUENCE),
);Instead of // ..Or the spend_tx's change
let _sec_emer_tx = EmergencyTransaction::new(
(VaultPrevout::new(spend_tx.into_prevout(0)), RBF_SEQUENCE),
);Sneaky, isn't it ? If |
…ctions cf19162 transactions: allow caller to set nLockTime (anti fee-snipping) (Antoine Poinsot) f57f94d transactions: refactor RevaultTransaction into using traits (Antoine Poinsot) Pull request description: Based on #15. It adds a new parameter to the transactions constructor for them to be able to set the transaction's `nLockTime`. ACKs for top commit: darosior: ACK cf19162 (re-applying Jacob's ACK) Tree-SHA512: 0d956839f08cb926c6156e328ad30b3c8c7de8bb1c2b665c6e2134880e383788533fcf4f5546fa71a4f9256b5509a108e17d553107fbacff5de703caddae9580
2855c5b scripts: expose a raw interface to the unvault script (Antoine Poinsot) 4ab3f78 cleanup dependencies (Antoine Poinsot) Pull request description: This is based on #10 (itself base on #15 ...), see: - cd829a3 - 5feaa58 This adds an interface to fix #14 . Good news: we can apparently support threshold-based managers set. Question news: [what now](https://github.com/re-vault/practical-revault/issues/19#issuecomment-699479602) ? ACKs for top commit: JSwambo: Ack 2855c5b Tree-SHA512: 02f02191e935193ca9baf989cdb64a7d0d528f9274e719eab49f1dbef515647950611a9ca7f68e31a06d51e604487e7cc7e8e4bb4301b658a3916cbffcf96a56
I had basically two choices for the first implem: going with traits vs going with a big enum. This was a bad choice and this refactor reverts it to The Right Thing which was to use traits. So: sorry for the big diff, but it had to be done.
This:
I also found a bug as i went through this.