Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegation.h
Show All 39 Lines | Delegation(const LimitedProofId &limitedProofid_, | ||||
std::vector<Level> levels_) | std::vector<Level> levels_) | ||||
: limitedProofid(limitedProofid_), proofMaster(proofMaster_), | : limitedProofid(limitedProofid_), proofMaster(proofMaster_), | ||||
dgid(dgid_), levels(std::move(levels_)) {} | dgid(dgid_), levels(std::move(levels_)) {} | ||||
public: | public: | ||||
explicit Delegation() {} | explicit Delegation() {} | ||||
const DelegationId &getId() const { return dgid; } | const DelegationId &getId() const { return dgid; } | ||||
const LimitedProofId &getLimitedProofId() const { return limitedProofid; } | |||||
const CPubKey &getProofMaster() const { return proofMaster; } | |||||
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 |