MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FromPKBytes

Method FromPKBytes

src/test/miniscript_tests.cpp:170–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168
169 template<typename I>
170 std::optional<Key> FromPKBytes(I first, I last) const {
171 if (!miniscript::IsTapscript(m_script_ctx)) {
172 Key key{first, last};
173 if (key.IsValid()) return key;
174 return {};
175 }
176 if (last - first != 32) return {};
177 XOnlyPubKey xonly_pubkey;
178 std::copy(first, last, xonly_pubkey.begin());
179 return xonly_pubkey.GetEvenCorrespondingCPubKey();
180 }
181
182 template<typename I>
183 std::optional<Key> FromPKHBytes(I first, I last) const {

Callers

nothing calls this directly

Calls 4

IsTapscriptFunction · 0.85
IsValidMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected