use_max_sig
should be false.
test: descriptor: fix test for MaxSatisfactionWeight
#31570
pull
brunoerg
wants to merge
1
commits into
bitcoin:master
from
brunoerg:2024-12-descriptor-fix-test
changing
1
files
+2 −1
-
brunoerg commented at 5:23 pm on December 26, 2024: contributorTo get the maximum size of a satisfaction for a descriptor with no max sig, the parameter
-
DrahtBot commented at 5:23 pm on December 26, 2024: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31570.
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
DrahtBot added the label Tests on Dec 26, 2024
-
tdb3 approved
-
tdb3 commented at 0:01 am on December 27, 2024: contributorACK 00ec80b24ec32ac695d947587dd0f860fc6f1efa lgtm
-
in src/test/descriptor_tests.cpp:164 in 00ec80b24e outdated
160@@ -161,7 +161,7 @@ void DoCheck(std::string prv, std::string pub, const std::string& norm_pub, int 161 // We must be able to estimate the max satisfaction size for any solvable descriptor top descriptor (but combo). 162 const bool is_nontop_or_nonsolvable{!parse_priv->IsSolvable() || !parse_priv->GetOutputType()}; 163 const auto max_sat_maxsig{parse_priv->MaxSatisfactionWeight(true)}; 164- const auto max_sat_nonmaxsig{parse_priv->MaxSatisfactionWeight(true)}; 165+ const auto max_sat_nonmaxsig{parse_priv->MaxSatisfactionWeight(false)};
furszy commented at 2:23 pm on December 27, 2024:Haven’t verified all the scenarios but maybe you could verify thatmax_sat_nonmaxsig < max_sat_maxsig
(or <= if that causes any complication).
brunoerg commented at 8:56 pm on December 27, 2024:Done.test: descriptor: fix test for `MaxSatisfactionWeight`
To get the maximum size of a satisfaction for a descriptor without considering the max sig, the parameter `use_max_sig` should be false.
brunoerg force-pushed on Dec 27, 2024brunoerg commented at 8:56 pm on December 27, 2024: contributorForce-pushed addressing #31570 (review)tdb3 approvedtdb3 commented at 5:22 pm on December 28, 2024: contributorre ACK b29d68f942e333d2cfdd6be8d49fe484e0d15e11in src/test/descriptor_tests.cpp:165 in b29d68f942
160@@ -161,7 +161,8 @@ void DoCheck(std::string prv, std::string pub, const std::string& norm_pub, int 161 // We must be able to estimate the max satisfaction size for any solvable descriptor top descriptor (but combo). 162 const bool is_nontop_or_nonsolvable{!parse_priv->IsSolvable() || !parse_priv->GetOutputType()}; 163 const auto max_sat_maxsig{parse_priv->MaxSatisfactionWeight(true)}; 164- const auto max_sat_nonmaxsig{parse_priv->MaxSatisfactionWeight(true)}; 165+ const auto max_sat_nonmaxsig{parse_priv->MaxSatisfactionWeight(false)}; 166+ BOOST_CHECK(max_sat_nonmaxsig <= max_sat_maxsig);
furszy commented at 2:38 pm on December 30, 2024:nit: could useBOOST_CHECK_LE
.furszy commented at 2:38 pm on December 30, 2024: memberutACK b29d68f942efjahr commented at 4:20 pm on December 30, 2024: contributorutACK b29d68f942e333d2cfdd6be8d49fe484e0d15e11
Nice catch!
achow101 commented at 7:27 pm on December 30, 2024: memberACK b29d68f942e333d2cfdd6be8d49fe484e0d15e11achow101 merged this on Dec 30, 2024achow101 closed this on Dec 30, 2024
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: 2025-01-21 06:12 UTC
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: 2025-01-21 06:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me