Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegationbuilder.h
// Copyright (c) 2020 The Bitcoin developers | // Copyright (c) 2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_AVALANCHE_DELEGATIONBUILDER_H | #ifndef BITCOIN_AVALANCHE_DELEGATIONBUILDER_H | ||||
#define BITCOIN_AVALANCHE_DELEGATIONBUILDER_H | #define BITCOIN_AVALANCHE_DELEGATIONBUILDER_H | ||||
#include <avalanche/delegation.h> | #include <avalanche/delegation.h> | ||||
#include <avalanche/proof.h> | |||||
#include <pubkey.h> | |||||
#include <vector> | #include <vector> | ||||
class CKey; | class CKey; | ||||
class CPubKey; | |||||
namespace avalanche { | namespace avalanche { | ||||
struct LimitedProofId; | |||||
class Proof; | class Proof; | ||||
class DelegationBuilder { | class DelegationBuilder { | ||||
LimitedProofId limitedProofid; | LimitedProofId limitedProofid; | ||||
ProofId proofid; | |||||
DelegationId dgid; | DelegationId dgid; | ||||
std::vector<Delegation::Level> levels; | std::vector<Delegation::Level> levels; | ||||
DelegationBuilder(const LimitedProofId <dProofId, | |||||
const CPubKey &proofMaster, | |||||
const DelegationId &delegationId); | |||||
public: | public: | ||||
DelegationBuilder(const LimitedProofId <dProofId, | |||||
const CPubKey &proofMaster); | |||||
explicit DelegationBuilder(const Proof &p); | explicit DelegationBuilder(const Proof &p); | ||||
explicit DelegationBuilder(const Delegation &dg); | |||||
bool importDelegation(const Delegation &d); | |||||
bool addLevel(const CKey &delegatorKey, const CPubKey &delegatedPubKey); | bool addLevel(const CKey &delegatorKey, const CPubKey &delegatedPubKey); | ||||
Delegation build() const; | Delegation build() const; | ||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_DELEGATIONBUILDER_H | #endif // BITCOIN_AVALANCHE_DELEGATIONBUILDER_H |