Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | struct AvalancheTestingSetup : public TestChain100Setup { | ||||
CConnmanTest *m_connman; | CConnmanTest *m_connman; | ||||
AvalancheTestingSetup() : TestChain100Setup(), config(GetConfig()) { | AvalancheTestingSetup() : TestChain100Setup(), config(GetConfig()) { | ||||
// Deterministic randomness for tests. | // Deterministic randomness for tests. | ||||
auto connman = std::make_unique<CConnmanTest>(config, 0x1337, 0x1337); | auto connman = std::make_unique<CConnmanTest>(config, 0x1337, 0x1337); | ||||
m_connman = connman.get(); | m_connman = connman.get(); | ||||
m_node.connman = std::move(connman); | m_node.connman = std::move(connman); | ||||
m_node.peer_logic = std::make_unique<PeerLogicValidation>( | m_node.peer_logic = std::make_unique<PeerLogicValidation>( | ||||
m_connman, m_node.banman.get(), *m_node.scheduler); | m_connman, m_node.banman.get()); | ||||
} | } | ||||
~AvalancheTestingSetup() { m_connman->ClearNodes(); } | ~AvalancheTestingSetup() { m_connman->ClearNodes(); } | ||||
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); | ||||
▲ Show 20 Lines • Show All 843 Lines • Show Last 20 Lines |