test: remove unused NodeClockContext default ctor #34871

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:test-nodeclockcontext-avoid-system-time changing 1 files +0 −2
  1. w0xlt commented at 9:33 pm on March 19, 2026: contributor

    NodeClockContext was introduced in #34479 as a small RAII helper for tests and fuzz targets: it sets mock node time on construction and resets the global mock time on destruction. The motivation there was to make mock-time usage less error-prone and to avoid mock time leaking from one fuzz input to the next.

    All current in-tree uses of NodeClockContext pass an explicit time, e.g.

    0NodeClockContext clock_ctx{ConsumeTime(fuzzed_data_provider)};
    

    The no-argument constructor is not used anywhere.

  2. test: remove unused NodeClockContext default ctor
    The no-argument NodeClockContext constructor is unused in-tree. Unlike the explicit constructors, it derives its value from Now<NodeSeconds>(), which makes the helper less clear for deterministic test and fuzz usage.
    
    Drop the overload and keep NodeClockContext explicit: callers provide the mock time they want to scope and the helper continues to reset the global mock time on destruction.
    dbbeb501ca
  3. DrahtBot added the label Tests on Mar 19, 2026
  4. DrahtBot commented at 9:33 pm on March 19, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK maflcko

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. fanquake commented at 0:39 am on March 20, 2026: member
  6. maflcko commented at 6:33 am on March 20, 2026: member

    NACK

    Just because this happens to be unused on current master doesn’t mean it is useless.

    Removing it will introduce compile failures and silent conflicts with other pull requests that are using this, such as https://github.com/bitcoin/bitcoin/pull/34858

  7. fanquake commented at 6:40 am on March 20, 2026: member
    Closing for now.
  8. fanquake closed this on Mar 20, 2026


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-03-31 12:13 UTC

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