-
Notifications
You must be signed in to change notification settings - Fork 37.5k
refactor: Replace HexStr(o.begin(), o.end()) with HexStr(o) #19373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup.
almost-ACK 282df90 modulo when building the fuzzers
test/fuzz/decode_tx.cpp:17:39: error: no matching constructor for initialization of 'std::string' (aka 'basic_string<char>')
const std::string tx_hex = HexStr(std::string{buffer});
^ ~~~~~~~~
HexStr can be called with anything that bas `begin()` and `end()` functions, so clean up the redundant calls.
Thanks! |
ACK bd93e32
diff --git a/src/test/fuzz/decode_tx.cpp b/src/test/fuzz/decode_tx.cpp
@@ -14,7 +14,7 @@
void test_one_input(const std::vector<uint8_t>& buffer)
{
- const std::string tx_hex = HexStr(std::string{buffer});
+ const std::string tx_hex = HexStr(buffer); recalcitrant fuzzer is back in action
|
ACK bd93e32 When running all of the fuzz tests, Looking forward to eventually being able to build the fuzz tests at the same time as everything else :) |
@troygiorshev maybe |
I ran review ACK bd93e32 🔌 Show signature and timestampSignature:
Timestamp of file with hash |
Summary: ``` HexStr can be called with anything that bas begin() and end() functions, so clean up the redundant calls. (context: I tried to convert HexStr to use span, but this turns out to be somewhat more involved than I thought, because of the limitation to pre-c++17 Span lacking iterator-based constructor) . This commit is a first step which stands on its own though) ``` Backport of core [[bitcoin/bitcoin#19373 | PR19373]]. Test Plan: ninja all check-all ninja bitcoin-fuzzers ./test/fuzz/test_runner.py <path_to_corpus> Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Differential Revision: https://reviews.bitcoinabc.org/D9122
Using GNU sed `sed -i --regexp-extended -e 's/HexStr\(([^(]+)\.begin\(\), *([^(]+)\.end\(\)\)/HexStr(\1)/g' $(git grep -l HexStr)` Taken from comment bitcoin#19373 (comment) on bitcoin#19373
Merge bitcoin#19660, bitcoin#19373, bitcoin#19841, bitcoin#13862, bitcoin#13866, bitcoin#17280, bitcoin#17682 and partial bitcoin#19326, bitcoin#14978: Auxiliary Backports
HexStr can be called with anything that bas
begin()
andend()
functions, so clean up the redundant calls.(context: I tried to convert
HexStr
to use span, but this turns out to be somewhat more involved than I thought, because of the limitation to pre-c++17 Span lacking iterator-based constructor) . This commit is a first step which stands on its own though)