Bitcoin ABC 0.32.11
P2P Digital Currency
proofbuilder.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_PROOFBUILDER_H
6#define BITCOIN_AVALANCHE_PROOFBUILDER_H
7
8#include <avalanche/proof.h>
9#include <key.h>
10
11
12namespace avalanche {
13
14struct TestProofBuilder;
15
17 uint64_t sequence;
21
23 bool operator()(const SignedStake &lhs, const SignedStake &rhs) const {
24 return lhs.getStake().getId() < rhs.getStake().getId();
25 }
26 };
27 std::set<SignedStake, SignedStakeComparator> stakes;
28
29public:
30 ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CKey masterKey_,
31 const CScript &payoutScriptPubKey_)
32 : sequence(sequence_), expirationTime(expirationTime_),
33 masterKey(std::move(masterKey_)),
34 payoutScriptPubKey(payoutScriptPubKey_) {}
35
36 [[nodiscard]] bool addUTXO(COutPoint utxo, Amount amount, uint32_t height,
37 bool is_coinbase, CKey key);
38
40
41private:
43 ProofId getProofId() const;
44
45 friend struct TestProofBuilder;
46};
47
48} // namespace avalanche
49
50#endif // BITCOIN_AVALANCHE_PROOFBUILDER_H
An encapsulated secp256k1 private key.
Definition: key.h:28
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:20
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:432
bool addUTXO(COutPoint utxo, Amount amount, uint32_t height, bool is_coinbase, CKey key)
std::set< SignedStake, SignedStakeComparator > stakes
Definition: proofbuilder.h:27
ProofId getProofId() const
LimitedProofId getLimitedProofId() const
ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CKey masterKey_, const CScript &payoutScriptPubKey_)
Definition: proofbuilder.h:30
const Stake & getStake() const
Definition: proof.h:97
const StakeId & getId() const
Definition: proof.h:83
Implement std::hash so RCUPtr can be used as a key for maps or sets.
Definition: rcu.h:259
Definition: amount.h:21
bool operator()(const SignedStake &lhs, const SignedStake &rhs) const
Definition: proofbuilder.h:23