| 2284 | } |
| 2285 | |
| 2286 | template<typename I> std::optional<Key> FromPKBytes(I begin, I end) const |
| 2287 | { |
| 2288 | assert(m_in); |
| 2289 | Key key = m_keys.size(); |
| 2290 | if (miniscript::IsTapscript(m_script_ctx) && end - begin == 32) { |
| 2291 | XOnlyPubKey pubkey; |
| 2292 | std::copy(begin, end, pubkey.begin()); |
| 2293 | if (auto pubkey_provider = InferXOnlyPubkey(pubkey, ParseContext(), *m_in)) { |
| 2294 | m_keys.emplace_back(); |
| 2295 | m_keys.back().push_back(std::move(pubkey_provider)); |
| 2296 | return key; |
| 2297 | } |
| 2298 | } else if (!miniscript::IsTapscript(m_script_ctx)) { |
| 2299 | CPubKey pubkey(begin, end); |
| 2300 | if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) { |
| 2301 | m_keys.emplace_back(); |
| 2302 | m_keys.back().push_back(std::move(pubkey_provider)); |
| 2303 | return key; |
| 2304 | } |
| 2305 | } |
| 2306 | return {}; |
| 2307 | } |
| 2308 | |
| 2309 | template<typename I> std::optional<Key> FromPKHBytes(I begin, I end) const |
| 2310 | { |
nothing calls this directly
no test coverage detected