2021-12-30 19:36:57 +02:00
|
|
|
// Copyright (c) 2019-2021 The Bitcoin Core developers
|
2019-11-25 02:44:40 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_TEST_UTIL_MINING_H
|
|
|
|
#define BITCOIN_TEST_UTIL_MINING_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2021-04-03 13:39:42 +02:00
|
|
|
#include <vector>
|
2019-11-25 02:44:40 +01:00
|
|
|
|
|
|
|
class CBlock;
|
2021-04-03 13:39:42 +02:00
|
|
|
class CChainParams;
|
2019-11-25 02:44:40 +01:00
|
|
|
class CScript;
|
|
|
|
class CTxIn;
|
2019-12-17 07:11:44 +07:00
|
|
|
struct NodeContext;
|
2019-11-25 02:44:40 +01:00
|
|
|
|
2021-04-03 13:39:42 +02:00
|
|
|
/** Create a blockchain, starting from genesis */
|
|
|
|
std::vector<std::shared_ptr<CBlock>> CreateBlockChain(size_t total_height, const CChainParams& params);
|
|
|
|
|
2019-11-25 02:44:40 +01:00
|
|
|
/** Returns the generated coin */
|
2019-12-17 07:11:44 +07:00
|
|
|
CTxIn MineBlock(const NodeContext&, const CScript& coinbase_scriptPubKey);
|
2019-11-25 02:44:40 +01:00
|
|
|
|
|
|
|
/** Prepare a block to be mined */
|
2019-12-17 07:11:44 +07:00
|
|
|
std::shared_ptr<CBlock> PrepareBlock(const NodeContext&, const CScript& coinbase_scriptPubKey);
|
2019-11-25 02:44:40 +01:00
|
|
|
|
|
|
|
/** RPC-like helper function, returns the generated coin */
|
2019-12-17 07:11:44 +07:00
|
|
|
CTxIn generatetoaddress(const NodeContext&, const std::string& address);
|
2019-11-25 02:44:40 +01:00
|
|
|
|
|
|
|
#endif // BITCOIN_TEST_UTIL_MINING_H
|