Changeset View
Changeset View
Standalone View
Standalone View
src/test/transaction_tests.cpp
Show First 20 Lines • Show All 794 Lines • ▼ Show 20 Lines | for (size_t inputs : sizes) { | ||||
CMutableTransaction mtx; | CMutableTransaction mtx; | ||||
mtx.vin.resize(inputs); | mtx.vin.resize(inputs); | ||||
mtx.vout.resize(outputs); | mtx.vout.resize(outputs); | ||||
CTransaction tx(mtx); | CTransaction tx(mtx); | ||||
auto txBillableSize = tx.GetBillableSize(); | auto txBillableSize = tx.GetBillableSize(); | ||||
auto txSize = tx.GetTotalSize(); | auto txSize = tx.GetTotalSize(); | ||||
BOOST_CHECK(txBillableSize > 0); | BOOST_CHECK(txBillableSize > 0); | ||||
if (inputs > outputs) { | if (inputs > outputs) { | ||||
BOOST_CHECK(txBillableSize <= txSize); | BOOST_CHECK(txBillableSize < txSize); | ||||
} else { | } else { | ||||
BOOST_CHECK(txBillableSize >= txSize); | BOOST_CHECK(txBillableSize >= txSize); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_SUITE_END() | BOOST_AUTO_TEST_SUITE_END() |