Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofbuilder.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_PROOFBUILDER_H | #ifndef BITCOIN_AVALANCHE_PROOFBUILDER_H | ||||
#define BITCOIN_AVALANCHE_PROOFBUILDER_H | #define BITCOIN_AVALANCHE_PROOFBUILDER_H | ||||
#include <avalanche/proof.h> | #include <avalanche/proof.h> | ||||
#include <key.h> | #include <key.h> | ||||
#include <cstdio> | #include <cstdio> | ||||
namespace avalanche { | namespace avalanche { | ||||
namespace { | |||||
struct TestProofBuilder; | |||||
} // namespace | |||||
class ProofBuilder { | class ProofBuilder { | ||||
uint64_t sequence; | uint64_t sequence; | ||||
int64_t expirationTime; | int64_t expirationTime; | ||||
CPubKey master; | CPubKey master; | ||||
struct StakeSigner { | struct StakeSigner { | ||||
Stake stake; | Stake stake; | ||||
CKey key; | CKey key; | ||||
Show All 18 Lines | public: | ||||
/** | /** | ||||
* Builds a randomized (and therefore invalid) Proof. | * Builds a randomized (and therefore invalid) Proof. | ||||
* Useful for tests. | * Useful for tests. | ||||
*/ | */ | ||||
static Proof buildRandom(uint32_t score); | static Proof buildRandom(uint32_t score); | ||||
private: | private: | ||||
ProofId getProofId() const; | ProofId getProofId(); | ||||
friend struct ::avalanche::TestProofBuilder; | |||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROOFBUILDER_H | #endif // BITCOIN_AVALANCHE_PROOFBUILDER_H |