Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
avalanche
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
20
class
DelegationBuilder
{
21
LimitedProofId
limitedProofid
;
22
DelegationId
dgid
;
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
CKey
An encapsulated secp256k1 private key.
Definition
key.h:28
CPubKey
An encapsulated public key.
Definition
pubkey.h:31
avalanche::DelegationBuilder
Definition
delegationbuilder.h:20
avalanche::DelegationBuilder::limitedProofid
LimitedProofId limitedProofid
Definition
delegationbuilder.h:21
avalanche::DelegationBuilder::dgid
DelegationId dgid
Definition
delegationbuilder.h:22
avalanche::DelegationBuilder::levels
std::vector< Delegation::Level > levels
Definition
delegationbuilder.h:24
avalanche::DelegationBuilder::addLevel
bool addLevel(const CKey &delegatorKey, const CPubKey &delegatedPubKey)
Definition
delegationbuilder.cpp:40
avalanche::DelegationBuilder::build
Delegation build() const
Definition
delegationbuilder.cpp:61
avalanche::Delegation
Definition
delegation.h:31
avalanche::Proof
Definition
proof.h:102
delegation.h
avalanche
Definition
avalanche.h:13
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
avalanche::DelegationId
Definition
delegationid.h:14
avalanche::LimitedProofId
Definition
proofid.h:28
Generated on Sat Nov 23 2024 02:37:57 for Bitcoin ABC by
1.9.8