Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show First 20 Lines • Show All 758 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(BlockAssembler_construction) { | ||||
CheckBlockMaxSize(config, DEFAULT_MAX_BLOCK_SIZE - 999, | CheckBlockMaxSize(config, DEFAULT_MAX_BLOCK_SIZE - 999, | ||||
DEFAULT_MAX_BLOCK_SIZE - 1000); | DEFAULT_MAX_BLOCK_SIZE - 1000); | ||||
CheckBlockMaxSize(config, DEFAULT_MAX_BLOCK_SIZE, | CheckBlockMaxSize(config, DEFAULT_MAX_BLOCK_SIZE, | ||||
DEFAULT_MAX_BLOCK_SIZE - 1000); | DEFAULT_MAX_BLOCK_SIZE - 1000); | ||||
// If the parameter is not specified, we use | // If the parameter is not specified, we use | ||||
// DEFAULT_MAX_GENERATED_BLOCK_SIZE | // DEFAULT_MAX_GENERATED_BLOCK_SIZE | ||||
{ | { | ||||
gArgs.ClearArg("-blockmaxsize"); | gArgs.ClearForcedArg("-blockmaxsize"); | ||||
BlockAssembler ba(config, g_mempool); | BlockAssembler ba(config, g_mempool); | ||||
BOOST_CHECK_EQUAL(ba.GetMaxGeneratedBlockSize(), | BOOST_CHECK_EQUAL(ba.GetMaxGeneratedBlockSize(), | ||||
DEFAULT_MAX_GENERATED_BLOCK_SIZE); | DEFAULT_MAX_GENERATED_BLOCK_SIZE); | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(TestCBlockTemplateEntry) { | BOOST_AUTO_TEST_CASE(TestCBlockTemplateEntry) { | ||||
const CTransaction tx; | const CTransaction tx; | ||||
CTransactionRef txRef = MakeTransactionRef(tx); | CTransactionRef txRef = MakeTransactionRef(tx); | ||||
CBlockTemplateEntry txEntry(txRef, 1 * SATOSHI, 10); | CBlockTemplateEntry txEntry(txRef, 1 * SATOSHI, 10); | ||||
BOOST_CHECK_MESSAGE(txEntry.tx == txRef, "Transactions did not match"); | BOOST_CHECK_MESSAGE(txEntry.tx == txRef, "Transactions did not match"); | ||||
BOOST_CHECK_EQUAL(txEntry.fees, 1 * SATOSHI); | BOOST_CHECK_EQUAL(txEntry.fees, 1 * SATOSHI); | ||||
BOOST_CHECK_EQUAL(txEntry.sigOpCount, 10); | BOOST_CHECK_EQUAL(txEntry.sigOpCount, 10); | ||||
} | } | ||||
BOOST_AUTO_TEST_SUITE_END() | BOOST_AUTO_TEST_SUITE_END() |