Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegation.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public: | ||||
explicit Delegation() {} | explicit Delegation() {} | ||||
static bool FromHex(Delegation &dg, const std::string &dgHex, | static bool FromHex(Delegation &dg, const std::string &dgHex, | ||||
bilingual_str &errorOut); | bilingual_str &errorOut); | ||||
const DelegationId &getId() const { return dgid; } | const DelegationId &getId() const { return dgid; } | ||||
const LimitedProofId &getLimitedProofId() const { return limitedProofid; } | const LimitedProofId &getLimitedProofId() const { return limitedProofid; } | ||||
const CPubKey &getProofMaster() const { return proofMaster; } | const CPubKey &getProofMaster() const { return proofMaster; } | ||||
const CPubKey &getDelegatedPubkey() const; | |||||
ProofId getProofId() const; | ProofId getProofId() const; | ||||
SERIALIZE_METHODS(Delegation, obj) { | SERIALIZE_METHODS(Delegation, obj) { | ||||
READWRITE(obj.limitedProofid, obj.proofMaster, obj.levels); | READWRITE(obj.limitedProofid, obj.proofMaster, obj.levels); | ||||
SER_READ(obj, obj.dgid = obj.computeDelegationId()); | SER_READ(obj, obj.dgid = obj.computeDelegationId()); | ||||
} | } | ||||
bool verify(DelegationState &state, CPubKey &auth) const; | bool verify(DelegationState &state, CPubKey &auth) const; | ||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_DELEGATION_H | #endif // BITCOIN_AVALANCHE_DELEGATION_H |