19 errorOut =
_(
"Delegation must be an hexadecimal string.");
27 }
catch (std::exception &e) {
28 errorOut =
strprintf(
_(
"Delegation has invalid format: %s"), e.what());
35template <
typename L,
typename F>
37 for (
const auto &l : levels) {
53 return reduceLevels(hash, levels, [](
const L &) {
return true; });
62 return levels.back().pubkey;
84 return state.Invalid(DelegationResult::INVALID_SIGNATURE,
Double ended buffer combining vector and stream-like interfaces.
An encapsulated public key.
bool VerifySchnorr(const uint256 &hash, const std::array< uint8_t, SCHNORR_SIZE > &sig) const
Verify a Schnorr signature (=64 bytes).
A writer stream (for serialization) that computes a 256-bit hash.
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
ProofId getProofId() const
static bool FromHex(Delegation &dg, const std::string &dgHex, bilingual_str &errorOut)
bool verify(DelegationState &state, CPubKey &auth) const
std::vector< Level > levels
LimitedProofId limitedProofid
const CPubKey & getDelegatedPubkey() const
DelegationId computeDelegationId() const
constexpr size_t MAX_DELEGATION_LEVELS
The maximum number of delegation levels we are willing to verify.
static bool reduceLevels(uint256 &hash, const std::vector< L > &levels, F f)
ProofId computeProofId(const CPubKey &proofMaster) const
bilingual_str _(const char *psz)
Translation function.
template std::vector< std::byte > ParseHex(std::string_view)
bool IsHex(std::string_view str)
Returns true if each character in str is a hex character, and has an even number of hex digits.
static const int PROTOCOL_VERSION
network protocol versioning