Introduce interfaces Signing Provider/BaseSignatureCreator #2837
+102
−95
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 PR is the start of the road to implementing BIP-174
In order to integrate PSBT, we have several necessary prerequisites that include this PR.
CKeyStore
class has more than the majority of what the sign functions will use/need, so changing to providing only keys and scripts.CKeyStore
is no longer the interface that signing relies on, thus swapping the dependency around whereCKeyStore
now relies onSigningProvider
.Next, we changed
DummySignatureCreator
to a stateless objectDUMMY_SIGNATURE_CREATOR
.BaseSignatureCreator
is now its own interface and can now implement new derivations for signing with it. Alongside this now provides transaction-specific logic and/or other signing logic.Lastly, this PR refactored
TransactionSignatureCreator
into a templatedGenericTransactionSignatureCreator
that works with bothCMutableTransaction
andCTransaction
. Which speeds up the resolution in our Unit testing.Backports for reference:
bitcoin#12714
bitcoin#12803
bitcoin#13309