Bitcoin ABC 0.33.12
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
11namespace avalanche {
12
13struct TestProofBuilder;
14
16 uint64_t sequence;
20
22 bool operator()(const SignedStake &lhs, const SignedStake &rhs) const {
23 return lhs.getStake().getId() < rhs.getStake().getId();
24 }
25 };
26 std::set<SignedStake, SignedStakeComparator> stakes;
27
28public:
29 ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CKey masterKey_,
30 const CScript &payoutScriptPubKey_)
31 : sequence(sequence_), expirationTime(expirationTime_),
32 masterKey(std::move(masterKey_)),
33 payoutScriptPubKey(payoutScriptPubKey_) {}
34
35 [[nodiscard]] bool addUTXO(COutPoint utxo, Amount amount, uint32_t height,
36 bool is_coinbase, CKey key);
37
39
40private:
42 ProofId getProofId() const;
43
44 friend struct TestProofBuilder;
45};
46
47} // namespace avalanche
48
49#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:26
ProofId getProofId() const
LimitedProofId getLimitedProofId() const
ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CKey masterKey_, const CScript &payoutScriptPubKey_)
Definition: proofbuilder.h:29
const Stake & getStake() const
Definition: proof.h:94
const StakeId & getId() const
Definition: proof.h:80
Implement std::hash so RCUPtr can be used as a key for maps or sets.
Definition: rcu.h:259
Definition: amount.h:23
bool operator()(const SignedStake &lhs, const SignedStake &rhs) const
Definition: proofbuilder.h:22