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; | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(pubkey); | READWRITE(pubkey); | ||||
READWRITE(sig); | READWRITE(sig); | ||||
} | } | ||||
Show All 34 Lines |