Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | AvalancheTestingSetup() | ||||
*m_node.scheduler, *m_node.chainman, *m_node.mempool, false); | *m_node.scheduler, *m_node.chainman, *m_node.mempool, false); | ||||
m_node.chain = interfaces::MakeChain(m_node, config.GetChainParams()); | m_node.chain = interfaces::MakeChain(m_node, config.GetChainParams()); | ||||
// Get the processor ready. | // Get the processor ready. | ||||
bilingual_str error; | bilingual_str error; | ||||
m_processor = Processor::MakeProcessor(*m_node.args, *m_node.chain, | m_processor = Processor::MakeProcessor(*m_node.args, *m_node.chain, | ||||
m_node.connman.get(), error); | m_node.connman.get(), error); | ||||
BOOST_CHECK(m_processor); | BOOST_CHECK(m_processor); | ||||
gArgs.ForceSetArg("-avaproofstakeutxoconfirmations", "0"); | |||||
} | } | ||||
~AvalancheTestingSetup() { | ~AvalancheTestingSetup() { | ||||
m_connman->ClearNodes(); | m_connman->ClearNodes(); | ||||
SyncWithValidationInterfaceQueue(); | SyncWithValidationInterfaceQueue(); | ||||
gArgs.ClearForcedArg("-avaproofstakeutxoconfirmations"); | |||||
} | } | ||||
CNode *ConnectNode(ServiceFlags nServices) { | CNode *ConnectNode(ServiceFlags nServices) { | ||||
static NodeId id = 0; | static NodeId id = 0; | ||||
CAddress addr(ip(GetRandInt(0xffffffff)), NODE_NONE); | CAddress addr(ip(GetRandInt(0xffffffff)), NODE_NONE); | ||||
auto node = | auto node = | ||||
new CNode(id++, ServiceFlags(NODE_NETWORK), INVALID_SOCKET, addr, | new CNode(id++, ServiceFlags(NODE_NETWORK), INVALID_SOCKET, addr, | ||||
▲ Show 20 Lines • Show All 1,324 Lines • Show Last 20 Lines |