scripted-diff: Replace EnsureChainman with Assert in unit tests

-BEGIN VERIFY SCRIPT-
sed --regexp-extended -i -e 's/EnsureChainman\((m?_?node)\)\./Assert(\1.chainman)->/g' $(git grep -l EnsureChainman)
-END VERIFY SCRIPT-
This commit is contained in:
MarcoFalke
2020-06-14 14:44:35 -04:00
parent fa6ef701ad
commit fa34587f1c
6 changed files with 15 additions and 15 deletions

View File

@@ -32,7 +32,7 @@ CTxIn MineBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey)
assert(block->nNonce);
}
bool processed{EnsureChainman(node).ProcessNewBlock(Params(), block, true, nullptr)};
bool processed{Assert(node.chainman)->ProcessNewBlock(Params(), block, true, nullptr)};
assert(processed);
return CTxIn{block->vtx[0]->GetHash(), 0};

View File

@@ -228,7 +228,7 @@ CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransa
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
EnsureChainman(m_node).ProcessNewBlock(chainparams, shared_pblock, true, nullptr);
Assert(m_node.chainman)->ProcessNewBlock(chainparams, shared_pblock, true, nullptr);
CBlock result = block;
return result;