From bdbd0b14a7a34ee55015458799daf8865d472df8 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 29 Feb 2024 01:59:44 +0300 Subject: [PATCH] chore: dashification of descriptor implementation in dash It removes mentioning of wpkh --- src/script/descriptor.cpp | 10 +++++----- test/lint/extended-lint-cppcheck.sh | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 3fc97f2998b18..14b71ce96bee6 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -401,7 +401,7 @@ class BIP32PubkeyProvider final : public PubkeyProvider /** Base class for all Descriptor implementations. */ class DescriptorImpl : public Descriptor { - //! Public key arguments for this descriptor (size 1 for PK, PKH, WPKH; any size for Multisig). + //! Public key arguments for this descriptor (size 1 for PK, PKH; any size for Multisig). const std::vector> m_pubkey_args; //! The string name of the descriptor function. const std::string m_name; @@ -668,10 +668,10 @@ class ComboDescriptor final : public DescriptorImpl out.pubkeys.emplace(id, keys[0]); ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK if (keys[0].IsCompressed()) { - CScript p2wpkh = GetScriptForDestination(PKHash(id)); - out.scripts.emplace(CScriptID(p2wpkh), p2wpkh); - ret.emplace_back(p2wpkh); - ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH + CScript p2pkh = GetScriptForDestination(PKHash(id)); + out.scripts.emplace(CScriptID(p2pkh), p2pkh); + ret.emplace_back(p2pkh); + ret.emplace_back(GetScriptForDestination(ScriptHash(p2pkh))); // P2SH-P2PKH } return ret; } diff --git a/test/lint/extended-lint-cppcheck.sh b/test/lint/extended-lint-cppcheck.sh index 9d9841004352f..e2391b11fea30 100755 --- a/test/lint/extended-lint-cppcheck.sh +++ b/test/lint/extended-lint-cppcheck.sh @@ -39,8 +39,6 @@ IGNORED_WARNINGS=( "src/script/descriptor.cpp:.* Class 'PKHDescriptor' has a constructor with 1 argument that is not explicit." "src/script/descriptor.cpp:.* Class 'RawDescriptor' has a constructor with 1 argument that is not explicit." "src/script/descriptor.cpp:.* Class 'SHDescriptor' has a constructor with 1 argument that is not explicit." - "src/script/descriptor.cpp:.* Class 'WPKHDescriptor' has a constructor with 1 argument that is not explicit." - "src/script/descriptor.cpp:.* Class 'WSHDescriptor' has a constructor with 1 argument that is not explicit." "src/script/script.h:.* Class 'CScript' has a constructor with 1 argument that is not explicit." "src/script/standard.h:.* Class 'CScriptID' has a constructor with 1 argument that is not explicit." "src/span.h:.* Class 'Span < const CRPCCommand >' has a constructor with 1 argument that is not explicit."