test: add parameterized constructor for msg_sendcmpct() #19781

pull theStack wants to merge 1 commits into bitcoin:master from theStack:20200823-test-extend-msg_sendcmpct_ctor changing 2 files +10 −27
  1. theStack commented at 0:38 am on August 23, 2020: member
    While working on the test for #19776 I noticed that creating a sendcmpct message is quite cumbersome – due to the lack of a parameterized constructor, one needs to create an empty (that is, initialized with default values) object and then set the two fields one by one. This PR replaces the default constructor with a parameterized constructor and uses it in the test p2p_compactblocks.py, reducing LOC. No need to pollute the namespace with temporary throw-away message objects anymore.
  2. test: add parameterized constructor for msg_sendcmpct() 638441928a
  3. fanquake added the label Tests on Aug 23, 2020
  4. practicalswift commented at 5:41 am on August 23, 2020: contributor
    Concept ACK: DRY and -17 LOC :)
  5. epson121 commented at 4:46 pm on September 10, 2020: none
    Code review ACK 638441928a446726ce3a7fb20433a5478e7585bb
  6. guggero commented at 1:50 pm on September 17, 2020: contributor

    Code review ACK 638441928a446726ce3a7fb20433a5478e7585bb.

    This creates slightly more new msg_sendcmpct objects instead of reusing the same one. But in this test context that should not matter at all since it’s still a small number of objects.

  7. fanquake requested review from MarcoFalke on Sep 19, 2020
  8. MarcoFalke merged this on Sep 20, 2020
  9. MarcoFalke closed this on Sep 20, 2020

  10. sidhujag referenced this in commit 0753f966dc on Sep 21, 2020
  11. theStack deleted the branch on Dec 1, 2020
  12. Fabcien referenced this in commit e13ecc8c66 on Oct 12, 2021
  13. 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: 2024-07-05 19:13 UTC

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