0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-06 14:19:59 -05:00

Merge bitcoin/bitcoin#25024: test: Split MempoolAncestryTests into two

fa2102e239 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 fa2102e239

Tree-SHA512: 6669f50f8d5944fed55ecc88aa1bd139bddf6a40e3c2e8f88c3cc7e70cf6d4650c0dd652c7f304813893827c3930d626268655cd9b3f17ff9c9a1a02f0359714
This commit is contained in:
fanquake 2022-04-29 12:24:28 +01:00
commit 246db98897
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -747,6 +747,15 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
pool.GetTransactionAncestry(ty6->GetHash(), ancestors, descendants);
BOOST_CHECK_EQUAL(ancestors, 9ULL);
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") */
//
@ -759,7 +768,6 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
tb = make_tx(/*output_values=*/{5 * COIN, 3 * COIN}, /*inputs=*/ {ta});
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});
pool.clear();
pool.addUnchecked(entry.Fee(10000LL).FromTx(ta));
pool.addUnchecked(entry.Fee(10000LL).FromTx(tb));
pool.addUnchecked(entry.Fee(10000LL).FromTx(tc));