MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/processmessage_tests.cpp:93–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91BOOST_FIXTURE_TEST_SUITE(process_xthinblock_tests, XThinBlockSetup);
92
93BOOST_AUTO_TEST_CASE(xthinblock_ignore_invalid) {
94 XThinBlock xblock(TestBlock1(), CBloomFilter());;
95 xblock.txHashes.clear(); // <- makes block invalid
96
97 DummyWorker<XThinWorker> worker(tmgr, 42);
98 worker.addWork(xblock.header.GetHash());
99 CDataStream s = stream(xblock);
100 DummyXThinProcessor process(pfrom, worker, headerprocessor);
101 process(s, NullFinder(), MAX_BLOCK_SIZE, 1);
102
103 // Should reset the worker.
104 BOOST_CHECK(!worker.isWorking());
105
106 // ...and misbehave the client.
107 BOOST_CHECK_EQUAL(20, process.misbehaved);
108 BOOST_CHECK(!worker.buildStubCalled);
109 BOOST_CHECK_EQUAL("reject", pfrom.messages.at(0));
110}
111
112BOOST_AUTO_TEST_CASE(xthinblock_ignore_if_has_block_data) {
113 // Add block to mapBlockIndex (so we already have it)

Callers

nothing calls this directly

Calls 15

TestBlock1Function · 0.85
NullFinderClass · 0.85
GetDummyThinBlockMgFunction · 0.85
minTxSizeFunction · 0.85
isWorkingMethod · 0.80
isWorkingOnMethod · 0.80
resizeMethod · 0.80
CBloomFilterClass · 0.50
XThinBlockClass · 0.50
CFeeRateClass · 0.50
clearMethod · 0.45
addWorkMethod · 0.45

Tested by

no test coverage detected