Bitcoin ABC  0.24.7
P2P Digital Currency
delegationbuilder.h
Go to the documentation of this file.
1 // Copyright (c) 2020 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_AVALANCHE_DELEGATIONBUILDER_H
6 #define BITCOIN_AVALANCHE_DELEGATIONBUILDER_H
7 
8 #include <avalanche/delegation.h>
9 
10 #include <vector>
11 
12 class CKey;
13 class CPubKey;
14 
15 namespace avalanche {
16 
17 struct LimitedProofId;
18 class Proof;
19 
23 
24  std::vector<Delegation::Level> levels;
25 
26  DelegationBuilder(const LimitedProofId &ltdProofId,
27  const CPubKey &proofMaster,
28  const DelegationId &delegationId);
29 
30 public:
31  DelegationBuilder(const LimitedProofId &ltdProofId,
32  const CPubKey &proofMaster);
33  explicit DelegationBuilder(const Proof &p);
34  explicit DelegationBuilder(const Delegation &dg);
35 
36  bool addLevel(const CKey &delegatorKey, const CPubKey &delegatedPubKey);
37 
38  Delegation build() const;
39 };
40 
41 } // namespace avalanche
42 
43 #endif // BITCOIN_AVALANCHE_DELEGATIONBUILDER_H
avalanche::Delegation
Definition: delegation.h:23
delegation.h
avalanche::DelegationId
Definition: delegationid.h:14
avalanche
Definition: avalanche.h:11
avalanche::DelegationBuilder::build
Delegation build() const
Definition: delegationbuilder.cpp:61
avalanche::DelegationBuilder::dgid
DelegationId dgid
Definition: delegationbuilder.h:22
avalanche::DelegationBuilder::limitedProofid
LimitedProofId limitedProofid
Definition: delegationbuilder.h:21
avalanche::DelegationBuilder::levels
std::vector< Delegation::Level > levels
Definition: delegationbuilder.h:24
avalanche::DelegationBuilder
Definition: delegationbuilder.h:20
avalanche::LimitedProofId
Definition: proofid.h:28
avalanche::Proof
Definition: proof.h:102
CPubKey
An encapsulated public key.
Definition: pubkey.h:31
avalanche::DelegationBuilder::DelegationBuilder
DelegationBuilder(const LimitedProofId &ltdProofId, const CPubKey &proofMaster, const DelegationId &delegationId)
Definition: delegationbuilder.cpp:15
CKey
An encapsulated secp256k1 private key.
Definition: key.h:28
avalanche::DelegationBuilder::addLevel
bool addLevel(const CKey &delegatorKey, const CPubKey &delegatedPubKey)
Definition: delegationbuilder.cpp:40