Bitcoin ABC 0.26.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
11#include <cstdio>
12
13namespace avalanche {
14
15struct TestProofBuilder;
16
22
24 bool operator()(const SignedStake &lhs, const SignedStake &rhs) const {
25 return lhs.getStake().getId() < rhs.getStake().getId();
26 }
27 };
28 std::set<SignedStake, SignedStakeComparator> stakes;
29
30public:
36
37 [[nodiscard]] bool addUTXO(COutPoint utxo, Amount amount, uint32_t height,
38 bool is_coinbase, CKey key);
39
41
42private:
44 ProofId getProofId() const;
45
46 friend struct TestProofBuilder;
47};
48
49} // namespace avalanche
50
51#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:431
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_)
Implement std::hash so RCUPtr can be used as a key for maps or sets.
Definition rcu.h:257
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
bool operator()(const SignedStake &lhs, const SignedStake &rhs) const