@@ -208,7 +208,7 @@ class DescriptorImpl : public Descriptor
208
208
// ! Public key arguments for this descriptor (size 1 for PK, PKH, WPKH; any size of Multisig).
209
209
const std::vector<std::unique_ptr<PubkeyProvider>> m_pubkey_args;
210
210
// ! 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;
212
212
// ! The string name of the descriptor function.
213
213
const std::string m_name;
214
214
@@ -230,7 +230,7 @@ class DescriptorImpl : public Descriptor
230
230
virtual std::vector<CScript> MakeScripts (const std::vector<CPubKey>& pubkeys, const CScript* script, FlatSigningProvider& out) const = 0;
231
231
232
232
public:
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) {}
234
234
235
235
bool IsSolvable () const override
236
236
{
@@ -426,7 +426,7 @@ class SHDescriptor final : public DescriptorImpl
426
426
protected:
427
427
std::vector<CScript> MakeScripts (const std::vector<CPubKey>&, const CScript* script, FlatSigningProvider&) const override { return Singleton (GetScriptForDestination (CScriptID (*script))); }
428
428
public:
429
- SHDescriptor (std::unique_ptr<Descriptor > desc) : DescriptorImpl({}, std::move(desc), " sh" ) {}
429
+ SHDescriptor (std::unique_ptr<DescriptorImpl > desc) : DescriptorImpl({}, std::move(desc), " sh" ) {}
430
430
};
431
431
432
432
/* * A parsed wsh(...) descriptor. */
@@ -435,7 +435,7 @@ class WSHDescriptor final : public DescriptorImpl
435
435
protected:
436
436
std::vector<CScript> MakeScripts (const std::vector<CPubKey>&, const CScript* script, FlatSigningProvider&) const override { return Singleton (GetScriptForDestination (WitnessV0ScriptHash (*script))); }
437
437
public:
438
- WSHDescriptor (std::unique_ptr<Descriptor > desc) : DescriptorImpl({}, std::move(desc), " wsh" ) {}
438
+ WSHDescriptor (std::unique_ptr<DescriptorImpl > desc) : DescriptorImpl({}, std::move(desc), " wsh" ) {}
439
439
};
440
440
441
441
// //////////////////////////////////////////////////////////////////////////
@@ -583,7 +583,7 @@ std::unique_ptr<PubkeyProvider> ParsePubkey(const Span<const char>& sp, bool per
583
583
}
584
584
585
585
/* * 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)
587
587
{
588
588
auto expr = Expr (sp);
589
589
if (Func (" pk" , expr)) {
@@ -663,7 +663,7 @@ std::unique_ptr<PubkeyProvider> InferPubkey(const CPubKey& pubkey, ParseScriptCo
663
663
return key_provider;
664
664
}
665
665
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)
667
667
{
668
668
std::vector<std::vector<unsigned char >> data;
669
669
txnouttype txntype = Solver (script, data);
@@ -733,7 +733,7 @@ std::unique_ptr<Descriptor> Parse(const std::string& descriptor, FlatSigningProv
733
733
{
734
734
Span<const char > sp (descriptor.data (), descriptor.size ());
735
735
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)) ;
737
737
return nullptr ;
738
738
}
739
739
0 commit comments