HomePhabricator

scripted-diff: test: Use existing chainman in unit tests

Description

scripted-diff: test: Use existing chainman in unit tests

Summary:

-BEGIN VERIFY SCRIPT-
git ls-files -- src/test \
    | grep -v '^src/test/fuzz' \
    | xargs sed -i -E \
            -e 's@g_chainman\.m_blockman@m_node.chainman->m_blockman@g' \
            -e 's@([^:])(Chain(state|)Active)@\1::\2@g' \
            -e 's@::Chain(state|)Active\(\)@m_node.chainman->ActiveChain\1()@g' \
            -e 's@ActiveChain\(\)\.Tip\(\)->nHeight([^+-])@ActiveHeight()\1@g' \
            -e 's@ActiveChain\(\)\.Tip\(\)@ActiveTip()@g' \
            -e 's@ActiveChain\(\)\.Height\(\)@ActiveHeight()@g'
arc lint
-END VERIFY SCRIPT-

This is a backport of core#21866 [5/12]
https://github.com/bitcoin/bitcoin/pull/21866/commits/0d61634c066a7102d539e85e2b1a4ca15be9660a

Note: In addition to the change in the source material, this diff also uses of the ChainstaeManager::ActiveTip() and ChainstateManager::ActiveHeight()
shortcuts where applicable.

Depends on D11649 and D11650

Test Plan: ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11651

Details

Provenance
PiRKAuthored on Jun 21 2022, 08:25
PiRKPushed on Jun 22 2022, 07:31
Reviewer
Restricted Project
Differential Revision
D11651: scripted-diff: test: Use existing chainman in unit tests
Parents
rABC645dcc26aba7: miner_tests: pass chainman and active_chainstate to helper functions
Branches
Unknown
Tags
Unknown