| 2223 | } |
| 2224 | |
| 2225 | std::unique_ptr<PubkeyProvider> InferXOnlyPubkey(const XOnlyPubKey& xkey, ParseScriptContext ctx, const SigningProvider& provider) |
| 2226 | { |
| 2227 | CPubKey pubkey{xkey.GetEvenCorrespondingCPubKey()}; |
| 2228 | std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true); |
| 2229 | KeyOriginInfo info; |
| 2230 | if (provider.GetKeyOriginByXOnly(xkey, info)) { |
| 2231 | return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false); |
| 2232 | } |
| 2233 | return key_provider; |
| 2234 | } |
| 2235 | |
| 2236 | /** |
| 2237 | * The context for parsing a Miniscript descriptor (either from Script or from its textual representation). |
no test coverage detected