Bitcoin ABC  0.24.11
P2P Digital Currency
util.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_TEST_UTIL_H
6 #define BITCOIN_AVALANCHE_TEST_UTIL_H
7 
8 #include <avalanche/proof.h>
10 #include <key.h>
11 
12 #include <cstdio>
13 
14 namespace avalanche {
15 
16 constexpr uint32_t MIN_VALID_PROOF_SCORE = 100 * PROOF_DUST_THRESHOLD / COIN;
17 
18 ProofRef buildRandomProof(uint32_t score,
19  const CKey &masterKey = CKey::MakeCompressedKey());
20 
21 bool hasDustStake(const ProofRef &proof);
22 
28 };
29 
30 } // namespace avalanche
31 
32 #endif // BITCOIN_AVALANCHE_TEST_UTIL_H
avalanche::ProofBuilder
Definition: proofbuilder.h:17
avalanche::PROOF_DUST_THRESHOLD
static constexpr Amount PROOF_DUST_THRESHOLD
Minimum amount per utxo.
Definition: proof.h:37
avalanche::MIN_VALID_PROOF_SCORE
constexpr uint32_t MIN_VALID_PROOF_SCORE
Definition: util.h:16
avalanche
Definition: avalanche.h:11
avalanche::hasDustStake
bool hasDustStake(const ProofRef &proof)
Definition: util.cpp:41
avalanche::ProofId
Definition: proofid.h:17
avalanche::TestProofBuilder::buildDuplicatedStakes
static ProofRef buildDuplicatedStakes(ProofBuilder &pb)
Definition: util.cpp:104
avalanche::TestProofBuilder
Definition: util.h:23
avalanche::buildRandomProof
ProofRef buildRandomProof(uint32_t score, const CKey &masterKey)
Definition: util.cpp:20
COIN
static constexpr Amount COIN
Definition: amount.h:154
proofbuilder.h
avalanche::TestProofBuilder::buildWithReversedOrderStakes
static ProofRef buildWithReversedOrderStakes(ProofBuilder &pb)
Definition: util.cpp:67
avalanche::TestProofBuilder::getReverseOrderProofId
static ProofId getReverseOrderProofId(ProofBuilder &pb)
Definition: util.cpp:50
avalanche::TestProofBuilder::getDuplicatedStakeProofId
static ProofId getDuplicatedStakeProofId(ProofBuilder &pb)
Definition: util.cpp:86
key.h
CKey
An encapsulated secp256k1 private key.
Definition: key.h:28
proof.h
CKey::MakeCompressedKey
static CKey MakeCompressedKey()
Produce a valid compressed key.
Definition: key.cpp:466
avalanche::ProofRef
std::shared_ptr< const Proof > ProofRef
Definition: proof.h:163