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 { | ||||
struct TestProofBuilder; | |||||
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 12 Lines | ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CPubKey master_) | ||||
master(std::move(master_)) {} | master(std::move(master_)) {} | ||||
bool addUTXO(COutPoint utxo, Amount amount, uint32_t height, | bool addUTXO(COutPoint utxo, Amount amount, uint32_t height, | ||||
bool is_coinbase, CKey key); | bool is_coinbase, CKey key); | ||||
Proof build(); | Proof build(); | ||||
private: | private: | ||||
ProofId getProofId() const; | ProofId getProofId(); | ||||
friend struct TestProofBuilder; | |||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROOFBUILDER_H | #endif // BITCOIN_AVALANCHE_PROOFBUILDER_H |