test: remove unused NodeClockContext default ctor#34871
Closed
w0xlt wants to merge 1 commit intobitcoin:masterfrom
Closed
test: remove unused NodeClockContext default ctor#34871w0xlt wants to merge 1 commit intobitcoin:masterfrom
NodeClockContext default ctor#34871w0xlt wants to merge 1 commit intobitcoin:masterfrom
Conversation
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.
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste |
Member
|
cc @maflcko |
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 #34858 |
Member
|
Closing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NodeClockContextwas 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.
NodeClockContext clock_ctx{ConsumeTime(fuzzed_data_provider)};The no-argument constructor is not used anywhere.