mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 4d0c00dffd into merged_master (Bitcoin PR bitcoin/bitcoin#25168)
This commit is contained in:
commit
66bc45020f
21 changed files with 68 additions and 94 deletions
|
|
@ -216,7 +216,6 @@ ChainTestingSetup::~ChainTestingSetup()
|
|||
TestingSetup::TestingSetup(const std::string& chainName, const std::string& fedpegscript, const std::vector<const char*>& extra_args)
|
||||
: ChainTestingSetup(chainName, fedpegscript, extra_args)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
// Ideally we'd move all the RPC tests to the functional testing framework
|
||||
// instead of unit tests, but for now we need these here.
|
||||
RegisterAllCoreRPCCommands(tableRPC);
|
||||
|
|
@ -225,7 +224,6 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::string& fedp
|
|||
*Assert(m_node.chainman.get()),
|
||||
Assert(m_node.mempool.get()),
|
||||
fPruneMode,
|
||||
chainparams.GetConsensus(),
|
||||
m_args.GetBoolArg("-reindex-chainstate", false),
|
||||
m_cache_sizes.block_tree_db,
|
||||
m_cache_sizes.coins_db,
|
||||
|
|
@ -238,10 +236,8 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::string& fedp
|
|||
*Assert(m_node.chainman),
|
||||
fReindex.load(),
|
||||
m_args.GetBoolArg("-reindex-chainstate", false),
|
||||
chainparams.GetConsensus(),
|
||||
m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS),
|
||||
m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL),
|
||||
/*get_unix_time_seconds=*/static_cast<int64_t(*)()>(GetTime));
|
||||
m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL));
|
||||
assert(!maybe_verify_error.has_value());
|
||||
|
||||
BlockValidationState state;
|
||||
|
|
@ -255,7 +251,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::string& fedp
|
|||
m_node.args->GetIntArg("-checkaddrman", 0));
|
||||
m_node.banman = std::make_unique<BanMan>(m_args.GetDataDirBase() / "banlist", nullptr, DEFAULT_MISBEHAVING_BANTIME);
|
||||
m_node.connman = std::make_unique<ConnmanTestMsg>(0x1337, 0x1337, *m_node.addrman, *m_node.netgroupman); // Deterministic randomness for tests.
|
||||
m_node.peerman = PeerManager::make(chainparams, *m_node.connman, *m_node.addrman,
|
||||
m_node.peerman = PeerManager::make(*m_node.connman, *m_node.addrman,
|
||||
m_node.banman.get(), *m_node.chainman,
|
||||
*m_node.mempool, false);
|
||||
{
|
||||
|
|
@ -300,9 +296,8 @@ CBlock TestChain100Setup::CreateBlock(
|
|||
const CScript& scriptPubKey,
|
||||
CChainState& chainstate)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
CTxMemPool empty_pool;
|
||||
CBlock block = BlockAssembler(chainstate, empty_pool, chainparams).CreateNewBlock(scriptPubKey)->block;
|
||||
CBlock block = BlockAssembler{chainstate, empty_pool}.CreateNewBlock(scriptPubKey)->block;
|
||||
|
||||
Assert(block.vtx.size() == 1);
|
||||
for (const CMutableTransaction& tx : txns) {
|
||||
|
|
@ -310,7 +305,7 @@ CBlock TestChain100Setup::CreateBlock(
|
|||
}
|
||||
RegenerateCommitments(block, *Assert(m_node.chainman));
|
||||
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, m_node.chainman->GetConsensus())) ++block.nNonce;
|
||||
|
||||
return block;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue