tests: silentpayments: deduplicate setup code #1972

pull ViniciusCestarii wants to merge 3 commits into bitcoin-core:master from ViniciusCestarii:deduplicate-sp-tests changing 1 files +40 −42
  1. ViniciusCestarii commented at 6:13 PM on October 21, 2026: contributor

    Deduplicates code in silent payments as suggested by @theStack at #1943#pullrequestreview-5578778611.

    • Turns output_tweak into a reusable constant.
    • Adds function labels_cache_set_neg_output_tweak for setting the cache for negated OUTPUT_TWEAK.
    • Adds function prevouts_summary_create_bob for creating secp256k1_silentpayments_prevouts_summary with bob's first address key.
  2. tests: silentpayments: deduplicate output tweak 9c6ece8bdd
  3. tests: silentpayments: deduplicate label cache setup 67916d9bbc
  4. tests: silentpayments: deduplicate prevouts summary setup 70f321c334
  5. theStack added the label tweak/refactor on Oct 23, 2026
  6. real-or-random requested review from Copilot on Nov 3, 2026
  7. ?
    copilot_work_started real-or-random
  8. Copilot commented at 9:46 AM on November 3, 2026: none

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues were identified for this test-only refactor consolidating shared data and setup helpers.

    No open issues 🎉

    <details> <summary><strong>What changed in this PR</strong></summary>

    This PR reduces repeated setup in the silent payments tests by sharing test data and helper functions. All changes are confined to test code.

    Changes:

    • Extract and document the shared OUTPUT_TWEAK value.
    • Add a helper for creating a prevouts summary with Bob’s first address key.
    • Add a helper for populating the label cache with the negated output tweak.
    File Description
    src/​modules/​silentpayments/​tests_impl.h Replace repeated setup with a shared tweak value and reusable helpers.

    </details>

    <sub>Review effort: Max</sub>


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-22 10:56 UTC