Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegation.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_DELEGATION_H | #ifndef BITCOIN_AVALANCHE_DELEGATION_H | ||||
#define BITCOIN_AVALANCHE_DELEGATION_H | #define BITCOIN_AVALANCHE_DELEGATION_H | ||||
#include <avalanche/delegationid.h> | #include <avalanche/delegationid.h> | ||||
#include <avalanche/proofid.h> | #include <avalanche/proofid.h> | ||||
#include <key.h> | |||||
#include <pubkey.h> | #include <pubkey.h> | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <vector> | #include <vector> | ||||
namespace avalanche { | namespace avalanche { | ||||
class DelegationState; | class DelegationState; | ||||
class Proof; | class Proof; | ||||
class Delegation { | class Delegation { | ||||
ProofId proofid; | ProofId proofid; | ||||
DelegationId dgid; | DelegationId dgid; | ||||
DelegationId computeDelegationId() const; | DelegationId computeDelegationId() const; | ||||
struct Level { | struct Level { | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
std::array<uint8_t, 64> sig; | SchnorrSig sig; | ||||
SERIALIZE_METHODS(Level, obj) { READWRITE(obj.pubkey, obj.sig); } | SERIALIZE_METHODS(Level, obj) { READWRITE(obj.pubkey, obj.sig); } | ||||
}; | }; | ||||
std::vector<Level> levels; | std::vector<Level> levels; | ||||
friend class DelegationBuilder; | friend class DelegationBuilder; | ||||
Delegation(const ProofId &proofid_, const DelegationId &dgid_, | Delegation(const ProofId &proofid_, const DelegationId &dgid_, | ||||
Show All 21 Lines |