@@ -208,7 +208,7 @@ class DescriptorImpl : public Descriptor
208208 // ! Public key arguments for this descriptor (size 1 for PK, PKH, WPKH; any size of Multisig).
209209 const std::vector<std::unique_ptr<PubkeyProvider>> m_pubkey_args;
210210 // ! The sub-descriptor argument (nullptr for everything but SH and WSH).
211- const std::unique_ptr<Descriptor > m_script_arg;
211+ const std::unique_ptr<DescriptorImpl > m_script_arg;
212212 // ! The string name of the descriptor function.
213213 const std::string m_name;
214214
@@ -230,7 +230,7 @@ class DescriptorImpl : public Descriptor
230230 virtual std::vector<CScript> MakeScripts (const std::vector<CPubKey>& pubkeys, const CScript* script, FlatSigningProvider& out) const = 0;
231231
232232public:
233- DescriptorImpl (std::vector<std::unique_ptr<PubkeyProvider>> pubkeys, std::unique_ptr<Descriptor > script, const std::string& name) : m_pubkey_args(std::move(pubkeys)), m_script_arg(std::move(script)), m_name(name) {}
233+ DescriptorImpl (std::vector<std::unique_ptr<PubkeyProvider>> pubkeys, std::unique_ptr<DescriptorImpl > script, const std::string& name) : m_pubkey_args(std::move(pubkeys)), m_script_arg(std::move(script)), m_name(name) {}
234234
235235 bool IsSolvable () const override
236236 {
@@ -426,7 +426,7 @@ class SHDescriptor final : public DescriptorImpl
426426protected:
427427 std::vector<CScript> MakeScripts (const std::vector<CPubKey>&, const CScript* script, FlatSigningProvider&) const override { return Singleton (GetScriptForDestination (CScriptID (*script))); }
428428public:
429- SHDescriptor (std::unique_ptr<Descriptor > desc) : DescriptorImpl({}, std::move(desc), " sh" ) {}
429+ SHDescriptor (std::unique_ptr<DescriptorImpl > desc) : DescriptorImpl({}, std::move(desc), " sh" ) {}
430430};
431431
432432/* * A parsed wsh(...) descriptor. */
@@ -435,7 +435,7 @@ class WSHDescriptor final : public DescriptorImpl
435435protected:
436436 std::vector<CScript> MakeScripts (const std::vector<CPubKey>&, const CScript* script, FlatSigningProvider&) const override { return Singleton (GetScriptForDestination (WitnessV0ScriptHash (*script))); }
437437public:
438- WSHDescriptor (std::unique_ptr<Descriptor > desc) : DescriptorImpl({}, std::move(desc), " wsh" ) {}
438+ WSHDescriptor (std::unique_ptr<DescriptorImpl > desc) : DescriptorImpl({}, std::move(desc), " wsh" ) {}
439439};
440440
441441// //////////////////////////////////////////////////////////////////////////
@@ -583,7 +583,7 @@ std::unique_ptr<PubkeyProvider> ParsePubkey(const Span<const char>& sp, bool per
583583}
584584
585585/* * Parse a script in a particular context. */
586- std::unique_ptr<Descriptor > ParseScript (Span<const char >& sp, ParseScriptContext ctx, FlatSigningProvider& out)
586+ std::unique_ptr<DescriptorImpl > ParseScript (Span<const char >& sp, ParseScriptContext ctx, FlatSigningProvider& out)
587587{
588588 auto expr = Expr (sp);
589589 if (Func (" pk" , expr)) {
@@ -663,7 +663,7 @@ std::unique_ptr<PubkeyProvider> InferPubkey(const CPubKey& pubkey, ParseScriptCo
663663 return key_provider;
664664}
665665
666- std::unique_ptr<Descriptor > InferScript (const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)
666+ std::unique_ptr<DescriptorImpl > InferScript (const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)
667667{
668668 std::vector<std::vector<unsigned char >> data;
669669 txnouttype txntype = Solver (script, data);
@@ -733,7 +733,7 @@ std::unique_ptr<Descriptor> Parse(const std::string& descriptor, FlatSigningProv
733733{
734734 Span<const char > sp (descriptor.data (), descriptor.size ());
735735 auto ret = ParseScript (sp, ParseScriptContext::TOP, out);
736- if (sp.size () == 0 && ret) return ret;
736+ if (sp.size () == 0 && ret) return std::unique_ptr<Descriptor>( std::move ( ret)) ;
737737 return nullptr ;
738738}
739739
0 commit comments