mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-23 07:15:29 +01:00
test: Split MempoolAncestryTests into two
This commit is contained in:
parent
91a6736136
commit
fa2102e239
1 changed files with 9 additions and 1 deletions
|
@ -747,6 +747,15 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
|
||||||
pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants);
|
pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants);
|
||||||
BOOST_CHECK_EQUAL(ancestors, 9ULL);
|
BOOST_CHECK_EQUAL(ancestors, 9ULL);
|
||||||
BOOST_CHECK_EQUAL(descendants, 6ULL);
|
BOOST_CHECK_EQUAL(descendants, 6ULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(MempoolAncestryTestsDiamond)
|
||||||
|
{
|
||||||
|
size_t ancestors, descendants;
|
||||||
|
|
||||||
|
CTxMemPool pool;
|
||||||
|
LOCK2(::cs_main, pool.cs);
|
||||||
|
TestMemPoolEntryHelper entry;
|
||||||
|
|
||||||
/* Ancestors represented more than once ("diamond") */
|
/* Ancestors represented more than once ("diamond") */
|
||||||
//
|
//
|
||||||
|
@ -759,7 +768,6 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
|
||||||
tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta});
|
tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta});
|
||||||
tc = make_tx(/*output_values=*/{2 * COIN}, /*inputs=*/{tb}, /*input_indices=*/{1});
|
tc = make_tx(/*output_values=*/{2 * COIN}, /*inputs=*/{tb}, /*input_indices=*/{1});
|
||||||
td = make_tx(/*output_values=*/{6 * COIN}, /*inputs=*/{tb, tc}, /*input_indices=*/{0, 0});
|
td = make_tx(/*output_values=*/{6 * COIN}, /*inputs=*/{tb, tc}, /*input_indices=*/{0, 0});
|
||||||
pool.clear();
|
|
||||||
pool.addUnchecked(entry.Fee(10000LL).FromTx(ta));
|
pool.addUnchecked(entry.Fee(10000LL).FromTx(ta));
|
||||||
pool.addUnchecked(entry.Fee(10000LL).FromTx(tb));
|
pool.addUnchecked(entry.Fee(10000LL).FromTx(tb));
|
||||||
pool.addUnchecked(entry.Fee(10000LL).FromTx(tc));
|
pool.addUnchecked(entry.Fee(10000LL).FromTx(tc));
|
||||||
|
|
Loading…
Add table
Reference in a new issue