Bitcoin ABC 0.34.3
P2P Digital Currency
Loading...
Searching...
No Matches
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:434
bool addUTXO(COutPoint utxo, Amount amount, uint32_t height, bool is_coinbase, CKey key)
std::set< SignedStake, SignedStakeComparator > stakes
ProofId getProofId() const
LimitedProofId getLimitedProofId() const
ProofBuilder(uint64_t sequence_, int64_t expirationTime_, CKey masterKey_, const CScript &payoutScriptPubKey_)
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
bool operator()(const SignedStake &lhs, const SignedStake &rhs) const