Skip to content

Commit 246db98

Browse files
committed
Merge bitcoin/bitcoin#25024: test: Split MempoolAncestryTests into two
fa2102e test: Split MempoolAncestryTests into two (MacroFake) Pull request description: The two tests don't share any state, so it seems clearer to put them in separate scopes. ACKs for top commit: jnewbery: Code review ACK fa2102e Tree-SHA512: 6669f50f8d5944fed55ecc88aa1bd139bddf6a40e3c2e8f88c3cc7e70cf6d4650c0dd652c7f304813893827c3930d626268655cd9b3f17ff9c9a1a02f0359714
2 parents 91ac12b + fa2102e commit 246db98

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/mempool_tests.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,15 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
747747
pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants);
748748
BOOST_CHECK_EQUAL(ancestors, 9ULL);
749749
BOOST_CHECK_EQUAL(descendants, 6ULL);
750+
}
751+
752+
BOOST_AUTO_TEST_CASE(MempoolAncestryTestsDiamond)
753+
{
754+
size_t ancestors, descendants;
755+
756+
CTxMemPool pool;
757+
LOCK2(::cs_main, pool.cs);
758+
TestMemPoolEntryHelper entry;
750759

751760
/* Ancestors represented more than once ("diamond") */
752761
//
@@ -759,7 +768,6 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
759768
tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta});
760769
tc = make_tx(/*output_values=*/{2 * COIN}, /*inputs=*/{tb}, /*input_indices=*/{1});
761770
td = make_tx(/*output_values=*/{6 * COIN}, /*inputs=*/{tb, tc}, /*input_indices=*/{0, 0});
762-
pool.clear();
763771
pool.addUnchecked(entry.Fee(10000LL).FromTx(ta));
764772
pool.addUnchecked(entry.Fee(10000LL).FromTx(tb));
765773
pool.addUnchecked(entry.Fee(10000LL).FromTx(tc));

0 commit comments

Comments
 (0)