Skip to content

Commit 1a95697

Browse files
test: adapt AssumeUTXO fixtures after txindex removal
1 parent dce4c12 commit 1a95697

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/test/util/setup_common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
#include <evo/specialtx.h>
7070
#include <evo/specialtxman.h>
7171
#include <flat-database.h>
72+
#include <governance/governance.h>
7273
#include <llmq/context.h>
7374
#include <llmq/signing.h>
7475
#include <masternode/meta.h>
@@ -431,6 +432,11 @@ TestingSetup::~TestingSetup()
431432
m_node.connman->Stop();
432433
}
433434

435+
// govman holds a reference to chain_helper->superblocks, so it must be reset
436+
// before DashChainstateSetupClose() destroys chain_helper (matches PrepareShutdown
437+
// ordering in init.cpp). Keep this defensive for fixtures that construct govman.
438+
m_node.govman.reset();
439+
434440
// DashChainstateSetup() is called by LoadChainstate() internally but
435441
// winding them down is our responsibility
436442
DashChainstateSetupClose(m_node);

src/test/validation_chainstatemanager_tests.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <rpc/blockchain.h>
1111
#include <sync.h>
1212
#include <test/util/chainstate.h>
13-
#include <test/util/index.h>
1413
#include <test/util/random.h>
1514
#include <test/util/setup_common.h>
1615
#include <timedata.h>
@@ -759,9 +758,6 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_evodb_snapshot_only_flush_restart, Sna
759758

760759
ChainstateManager& restarted = this->SimulateNodeRestart(/*flush_chainstates=*/false);
761760
this->LoadVerifyActivateChainstate();
762-
g_txindex = std::make_unique<TxIndex>(1 << 20, /*memory=*/true);
763-
BOOST_REQUIRE(g_txindex->Start(restarted.ActiveChainstate()));
764-
IndexWaitSynced(*g_txindex);
765761

766762
BOOST_CHECK(m_node.evodb->VerifyBestBlock(EvoDbIdentity::SNAPSHOT, snapshot_marker));
767763
BOOST_CHECK(m_node.evodb->VerifyBestBlock(EvoDbIdentity::NORMAL, normal_marker));
@@ -808,9 +804,6 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_init_missing_evodb_marker, Sn
808804
WITH_LOCK(::cs_main, restarted.ResetChainstates());
809805
fs::remove_all(gArgs.GetDataDirNet() / "chainstate_snapshot");
810806
this->LoadVerifyActivateChainstate();
811-
g_txindex = std::make_unique<TxIndex>(1 << 20, /*memory=*/true);
812-
BOOST_REQUIRE(g_txindex->Start(restarted.ActiveChainstate()));
813-
IndexWaitSynced(*g_txindex);
814807
}
815808

816809
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)