test: Remove unused txmempool include from tests #26286

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2210-test-cleanup-🐼 changing 17 files +110 −69
  1. maflcko commented at 12:11 pm on October 10, 2022: member

    Seems odd to include this heavy header in all tests despite it only being used in a few tests.

    Can be reviewed with --color-moved=dimmed-zebra --ignore-all-space

  2. fanquake added the label Tests on Oct 10, 2022
  3. maflcko commented at 12:12 pm on October 10, 2022: member
    Follow-up to #26250
  4. fanquake commented at 12:22 pm on October 10, 2022: member

    Concept ACK - looks like some previously transitively included includes will need to be added:

    0test/util_tests.cpp: In member function ‘void util_tests::util_seed_insecure_rand::test_method()’:
    1test/util_tests.cpp:1441:33: error: ‘sqrt’ was not declared in this scope
    2 1441 |         int err = 30*10000./mod*sqrt((1./mod*(1-1./mod))/10000.);
    3      |                                 ^~~~
    4make[2]: *** [Makefile:18499: test/test_bitcoin-util_tests.o] Error 1
    
  5. hebasto commented at 12:27 pm on October 10, 2022: member
    Concept ACK.
  6. maflcko force-pushed on Oct 10, 2022
  7. maflcko commented at 1:47 pm on October 10, 2022: member

    I can reduce the fuzz compile time (user+kernel time) by 20% with a dirty txmempool.h. To reproduce:

    0( echo >> ./src/txmempool.h ) && /usr/bin/time --format '%U+%S (%e)' make -j $(nproc)
    
  8. DrahtBot commented at 4:34 pm on October 10, 2022: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #26153 (Reduce wasted pseudorandom bytes in ChaCha20 + various improvements by sipa)
    • #25977 (refactor: Replace std::optional<bilingual_str> with util::Result by ryanofsky)
    • #25974 (test, build: Separate read_json function into its own module by hebasto)
    • #25909 (wallet: coverage for receiving txes with same id but different witness data by furszy)
    • #25908 (p2p: remove adjusted time by fanquake)
    • #25361 (BIP324: Cipher suite by dhruv)
    • #25325 (Add pool based memory resource by martinus)
    • #25172 (refactor: use std:: prefix for std lib funcs by fanquake)
    • #25152 (refactor: Split util/system into exception, shell, and fs-specific files by Empact)
    • #23561 (BIP324: Handshake prerequisites by dhruv)
    • #10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. brunoerg commented at 8:50 pm on October 10, 2022: contributor
    Concept ACK
  10. maflcko commented at 9:14 am on October 11, 2022: member
    Does anyone know why msvc is unable to link this?
  11. fanquake commented at 2:05 am on October 12, 2022: member

    Does anyone know why msvc is unable to link this? @sipsorcery @hebasto any thoughts?

  12. hebasto commented at 9:50 am on October 12, 2022: member

    Does anyone know why msvc is unable to link this?

     0--- a/build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj
     1+++ b/build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj
     2@@ -54,6 +54,9 @@
     3     <ProjectReference Include="..\libbitcoin_zmq\libbitcoin_zmq.vcxproj">
     4       <Project>{792d487f-f14c-49fc-a9de-3fc150f31c3f}</Project>
     5     </ProjectReference>
     6+    <ProjectReference Include="..\libtest_util\libtest_util.vcxproj">
     7+      <Project>{1e065f03-3566-47d0-8fa9-daa72b084e7d}</Project>
     8+    </ProjectReference>
     9     <ProjectReference Include="..\libleveldb\libleveldb.vcxproj">
    10       <Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
    11     </ProjectReference>
    

    See https://cirrus-ci.com/task/6132886477733888.

  13. DrahtBot added the label Needs rebase on Oct 14, 2022
  14. test: Remove unused txmempool include from tests fad7f2239c
  15. maflcko force-pushed on Oct 18, 2022
  16. DrahtBot removed the label Needs rebase on Oct 18, 2022
  17. in src/test/util/txmempool.h:28 in fad7f2239c outdated
    23+    unsigned int sigOpCost;
    24+    LockPoints lp;
    25+
    26+    TestMemPoolEntryHelper() :
    27+        nFee(0), nTime(0), nHeight(1),
    28+        spendsCoinbase(false), sigOpCost(4) { }
    


    aureleoules commented at 1:26 pm on October 18, 2022:

    if you retouch

    0    CAmount nFee{0};
    1    int64_t nTime{0};
    2    unsigned int nHeight{1};
    3    bool spendsCoinbase{false};
    4    unsigned int sigOpCost{4};
    5    LockPoints lp;
    
  18. aureleoules commented at 2:55 pm on October 18, 2022: member
    ACK fad7f2239c74a4db31b3023f2bcaf1f0852453f8
  19. test: Use C++11 member initializers for TestMemPoolEntryHelper
    Co-authored-by: Aurèle Oulès <aurele@oules.com>
    1c48dae76f
  20. aureleoules approved
  21. aureleoules commented at 3:38 pm on October 18, 2022: member
    reACK 1c48dae76fc808bf7154aca976e7303364c56509 Thanks for the co-author.
  22. hebasto approved
  23. hebasto commented at 5:48 pm on October 18, 2022: member
    ACK 1c48dae76fc808bf7154aca976e7303364c56509, I have reviewed the code and it looks OK, I agree it can be merged.
  24. w0xlt approved
  25. maflcko merged this on Oct 19, 2022
  26. maflcko closed this on Oct 19, 2022

  27. maflcko deleted the branch on Oct 19, 2022
  28. sidhujag referenced this in commit 1b048eca0a on Oct 23, 2022
  29. bitcoin locked this on Oct 19, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-29 10:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me