Seems odd to have the assert in the deprecated function, but not in the other.
Fix this by adding it to the other, and by inlining the deprecated one.
Also, use chrono type for the global mocktime variable.
Seems odd to have the assert in the deprecated function, but not in the other.
Fix this by adding it to the other, and by inlining the deprecated one.
Also, use chrono type for the global mocktime variable.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | stickies-v, davidgumberg |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
Also, inline the deprecated alias to avoid having the two go out of sync
again in the future.
This avoids verbose casts in the lines where the symbol is used.
37-
38+void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
39 void SetMockTime(std::chrono::seconds mock_time_in)
40 {
41- nMockTime.store(mock_time_in.count(), std::memory_order_relaxed);
42+ Assert(mock_time_in >= 0s);
assert
?
33-{
34- Assert(nMockTimeIn >= 0);
35- nMockTime.store(nMockTimeIn, std::memory_order_relaxed);
36-}
37-
38+void SetMockTime(int64_t nMockTimeIn) { SetMockTime(std::chrono::seconds{nMockTimeIn}); }
nit:
0void SetMockTime(int64_t mock_time_in) { SetMockTime(std::chrono::seconds{mock_time_in}); }
crACK https://github.com/bitcoin/bitcoin/pull/29872/commits/fae0db555c12dca75fb09e5fa7bbabdf39b8c1df
SetMockTime(std::chrono::seconds mock_time_in
should have the Assert
added here, and inlining the deprecated function is an improvement.
nMockTime
->g_mock_time
more closely conforms to the project’s naming conventions
maflcko
DrahtBot
stickies-v
davidgumberg
Labels
Tests