diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2023-06-23 11:32:28 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-06-28 09:37:15 -0300 |
commit | 97a965d98f1582ea1b1377bd258c9088380e1b8b (patch) | |
tree | d9c6b1fbbc9bef4c91cd394a75092f48a6774ffa /src/script/descriptor.h | |
parent | 1d207e3931cf076f69d4a8335cdd6c8ebb2a963f (diff) |
refactor: extract descriptor ID calculation from spkm GetID()
This allows us to verify the descriptor ID on the descriptors
unit tests in different software versions without requiring to
use the entire DescriptorScriptPubKeyMan machinery.
Note:
The unit test changes are introduced after the bugfix commit
but this commit + the unit test commit can be cherry-picked
on top of the v25 branch to verify IDs correctness. IDs must
be the same for v25 and after the bugfix commit.
Diffstat (limited to 'src/script/descriptor.h')
-rw-r--r-- | src/script/descriptor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/descriptor.h b/src/script/descriptor.h index 39b1a37f9a..0684febf70 100644 --- a/src/script/descriptor.h +++ b/src/script/descriptor.h @@ -182,4 +182,9 @@ std::string GetDescriptorChecksum(const std::string& descriptor); */ std::unique_ptr<Descriptor> InferDescriptor(const CScript& script, const SigningProvider& provider); +/** Unique identifier that may not change over time, unless explicitly marked as not backwards compatible. +* This is not part of BIP 380, not guaranteed to be interoperable and should not be exposed to the user. +*/ +uint256 DescriptorID(const Descriptor& desc); + #endif // BITCOIN_SCRIPT_DESCRIPTOR_H |