HomePhabricator

test: Remove duplicate NodeContext hacks

Description

test: Remove duplicate NodeContext hacks

Summary:

Qt tests currently are currently using two NodeContext structs at the
same
time, one in interfaces::NodeImpl::m_context, and the other in
BasicTestingSetup::m_node, and the tests have hacks transferring state
between
them.

Fix this by getting rid of the NodeImpl::m_context struct and making it
a
pointer. This way a common BitcoinApplication object can be used for all
qt
tests, but they can still have their own testing setups.

Non-test code is changing but non-test behavior is still the same as
before.

Motivation for this PR is to be able to remove the
"std::move(test.m_node.connman)" and mempool hacks for swapping
individual
NodeContext members in Qt tests, because followup PR #19099 adds yet
another
member (wallet_client) that needs to be swapped. After this change, the
whole
NodeContext struct can be swapped instead of individual members, so the
workarounds are less fragile and invasive.

Backport of core PR19098.

Depends on D7992.

Test Plan:

ninja all check-all
./contrib/teamcity/build-configurations.py build-ubsan

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on May 28 2020, 20:35
FabienCommitted on Oct 20 2020, 17:56
FabienPushed on Oct 20 2020, 17:56
Reviewer
Restricted Project
Differential Revision
D7993: test: Remove duplicate NodeContext hacks
Parents
rABC2c58f52e8e28: refactor: Remove g_rpc_node global
Branches
Unknown
Tags
Unknown