Cleanups after #25284:
- ser_action namespacing - #25284 (review)
- make reference implicit - #25284 (review)
- function notation - #25284 (comment)
Cleanups after #25284:
-BEGIN VERIFY SCRIPT-
sed -i 's/WithParams(\(CAddress::V[12]_[A-Z]*\) *, */\1(/g' $(git grep -l 'WithParams' src/)
sed -i 's/WithParams(\(CNetAddr::V[12]\) *, */\1(/g' $(git grep -l 'WithParams' src/)
sed -i 's@\(CNetAddr::V1.CService{}.*\) //@\1 //@' src/test/util/net.cpp
-END VERIFY SCRIPT-
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | MarcoFalke, TheCharlatan |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
1049 struct ActionUnserialize {
1050- constexpr bool ForRead() const { return true; }
1051-};
1052+ static constexpr bool ForRead() { return true; }
1053
1054+ template<typename Stream, typename... Args>
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
either way)
I think the last commit is incomplete? For example, the following removal compiles fine for me locally on top of this pull and master:
0diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp
1index 036355b5f1..37b670662f 100644
2--- a/src/test/net_tests.cpp
3+++ b/src/test/net_tests.cpp
4@@ -331,7 +331,7 @@ BOOST_AUTO_TEST_CASE(cnetaddr_serialize_v1)
5 DataStream s{};
6 const auto ser_params{CAddress::V1_NETWORK};
7
8- s << WithParams(ser_params, addr);
9+ s << ser_params( addr);
10 BOOST_CHECK_EQUAL(HexStr(s), "00000000000000000000000000000000");
11 s.clear();
12
I think it may be good to try to nuke WithParams
completely. This would also address the outstanding feedback:
lgtm ACK fb6a2ab63e310d8b600352ef41aab6dafccfbff0 💨
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: lgtm ACK fb6a2ab63e310d8b600352ef41aab6dafccfbff0 💨
3ywac3bAMrnfFHQLulX4zEWpRkiedwedVsrfX38Q39iL2lYR4s+D+pEv/I+9r777WVdScxjp7uMSq+J08QgcZDg==
I think the last commit is incomplete? For example, the following removal compiles fine for me locally on top of this pull and master:
- s « WithParams(ser_params, addr);
- s « ser_params( addr);
I only changed the ones that had constexpr
parameters – it’s pretty clear what V1_DISK(info)
means, but if you generalise it to anything(info)
it’s a bit less clear that it’s just applying serialization parameters – a function call could well be doing just about anything after all. Leaving it as WithParams(...)
makes it clear that it’s just applying serialization params.
Not sure that’s necessarily ideal, but that’s what I was thinking, fwiw.
s << ser_params(addr);
and it is shorter and consistent with the s << V1(addr);
stuff. So I’ll use it in new code, and potentially do the scripted-diff at some point, but no strong opinion.
ACK fb6a2ab63e310d8b600352ef41aab6dafccfbff0
I personally don’t see a risk in s « ser_params(addr); and it is shorter and consistent with the s « V1(addr); stuff.
Also would have preferred s << ser_params(addr);
.
Also would have preferred
s << ser_params(addr);
. @TheCharlatan You might want to review #28503