refactor: test/bench: deduplicate SetupDummyInputs() #18173

pull theStack wants to merge 1 commits into bitcoin:master from theStack:20200218-refactor-dedup-SetupDummyInputs changing 4 files +50 −79
  1. theStack commented at 4:32 PM on February 18, 2020: member

    The only difference between SetupDummyInputs() in test/transaction_tests.cpp and the one in bench/ccoins_caching.cpp was the nValue amounts of the outputs, so we allow to pass those in an extra (fixed-size) array parameter.

  2. DrahtBot added the label Refactoring on Feb 18, 2020
  3. DrahtBot added the label Tests on Feb 18, 2020
  4. DrahtBot commented at 6:05 PM on February 19, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  5. fanquake requested review from MarcoFalke on Feb 24, 2020
  6. in src/test/util/transaction_utils.h:10 in f5bab9b553 outdated
       5 | @@ -6,6 +6,10 @@
       6 |  #define BITCOIN_TEST_UTIL_TRANSACTION_UTILS_H
       7 |  
       8 |  #include <primitives/transaction.h>
       9 | +#include <coins.h>
      10 | +#include <script/signingprovider.h>
    


    MarcoFalke commented at 5:15 PM on February 24, 2020:

    I don't think you need the includes in the header. Forward decls should be enough if passing in references.


    MarcoFalke commented at 7:52 PM on February 28, 2020:

    @theStack I am happy to merge either version. Just let me know if you plan to address this comment or not.


    theStack commented at 8:05 PM on February 28, 2020:

    @MarcoFalke: I'm working on it right now, should be ready in a bit.

  7. MarcoFalke approved
  8. MarcoFalke commented at 5:20 PM on February 24, 2020: member

    ACK f5bab9b553f74701e8684768366b0a4b477affb7 🌃

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK f5bab9b553f74701e8684768366b0a4b477affb7 🌃
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhlQwv/UqmNkcvoK7FIuIQxAGeGsZCoBFNkEHYwkSaaVd4DoAFWl1GuQq3EzSbh
    mkfAT0Q/ESd397olsguUVRvEiFQyW2S9xM2idSgAlbaTZWaNnRyy2A1nKhlhdM4o
    og8KdPuT64UWR/MJLooJL99MQW1g8HYaWMU24VD7wwC1Rm8dovjeT2BAEqzrmon1
    PJRqD1G6B9Zk/RH/9KFvTfNVXQQY/yqCG35sxX8FZ5WwtMPBQ3lD6rS12HKZp0+M
    dh3dRkSsMR+70ND4KJYLkbwZfK/HqrqLPANeQ21d4nzwFJZxNbl8VqPX99pHTc9H
    Rp5DTVb/tZ8p45Ta3y+ze8qNWpAmMcEzuLSN5JqQU1IMhv6GYiKbvWW4EXakHn1e
    WZn3zX+ZWFoYBxlzPVutmr4D1EOqLMPxFHZqvFk1ec3ZKK6MVJHSgs8t/JLYEYkz
    9Qy9TbQ5b4F30YpZ6ZRR6DVLstwOXeY0779UZvobCWWqBydCtoPWcGI4lyo/HWsO
    itTJT/f4
    =6G0n
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 2c356b0fe556b8585528fc2521e7c95ee140480206c9da47a9fa8cfb7cc1392b -

    </details>

  9. Empact commented at 7:51 PM on February 28, 2020: member

    Concept ACK, prefer forward decls as noted by Marco.

  10. refactor: test/bench: dedup SetupDummyInputs()
    The only difference between SetupDummyInputs() in test/transaction_tests.cpp
    and the one in bench/ccoins_caching.cpp was the nValue amounts of the outputs,
    so we allow to pass those in an extra (fixed-size) array parameter.
    7bf4ce4f64
  11. theStack force-pushed on Feb 28, 2020
  12. theStack commented at 8:11 PM on February 28, 2020: member

    @MarcoFalke @Empact: Thank you both for reviewing! I moved the includes for <coins.h> and <script/signingprovider.h> to the .cpp file now and just put the forward declarations for classes CCoinsViewCache and FillableSigningProvider into the header file (diff for this force-push: https://github.com/bitcoin/bitcoin/compare/f5bab9b553f74701e8684768366b0a4b477affb7..7bf4ce4f644bb7dac9b63172c656b5d599eedea3).

  13. MarcoFalke commented at 8:12 PM on February 28, 2020: member

    re-ACK 7bf4ce4f64, only change is schuffling includes 🚶

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    re-ACK 7bf4ce4f64, only change is schuffling includes 🚶
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhnVAv+I6uvzOgqk8VYcqsJg/P0dsqI3fmxj1Xel1cIqyXGuU5xOmoMRmg2fFLw
    OEViwNDo7TZnDZZIlZetJ654Hp+Xi0fCL4X0b6xrsyPD53IVz3fHxURdYQV9Tmni
    38ENiTDxq9DwEnYO7Ax2HzKLCo5wPxZ6l/W06wVQ9QWdpZ0cqVVwUssUa4sV2/S6
    iQqzZaLTmLSmuzy19TzOzkcjV+W/sTpNblc9FPLS2NFnSK9cLtyYiXXXoXdUHIEj
    wCyKwqFaWuMbbgCoiICaSu3vHu5DPyP+Yw1qI5dZebPH6UqZP+c84hWoqlyJg4HP
    CYyhe5uUes7J2wSQL8KDWMksV9GgShHt8Jnt3KmXEgecuIQtj4VE+F7sc7r8i8FC
    DfFSwEMQTC72kgaC+gvBSqAfTOBUydFJLpWZtnatO/PNWuMH1sb6nJOkKOLhQBLM
    fAiMxIcARfeUrzztlloN2a0BSGN+mdIv4k+1bzHGxFzGenQVxSgh1e4oD8ruC2y0
    zhZoLHAE
    =N1Iz
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash c5d83acfb7421a6efb5ff5f150d39f0e718bb3e44ba75e26adb012b51191747e -

    </details>

  14. MarcoFalke merged this on Feb 28, 2020
  15. MarcoFalke closed this on Feb 28, 2020

  16. theStack deleted the branch on Dec 1, 2020
  17. deadalnix referenced this in commit 29626634c9 on Jan 5, 2021
  18. DrahtBot locked this on Feb 15, 2022

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: 2026-04-14 21:14 UTC

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