Skip to content

Commit

Permalink
(fold) fix rview comments by @nbougalis
Browse files Browse the repository at this point in the history
  • Loading branch information
a-noni-mousse committed Dec 8, 2022
1 parent 40b1200 commit c2b2686
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/ripple/app/misc/impl/AmendmentTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ AmendmentTableImpl::doVoting(
auto vote = std::make_unique<AmendmentSet>(rules, valSet);

JLOG(j_.debug()) << "Received " << vote->trustedValidations()
<< " trusted validations. Tresholds are: "
<< " trusted validations. Thresholds are: "
<< vote->activationThreshold() << " and "
<< vote->deactivationThreshold();

Expand Down
28 changes: 4 additions & 24 deletions src/test/app/AmendmentTable_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,28 +523,6 @@ class AmendmentTable_test final : public beast::unit_test::suite
}
}

// void
// doRound(
// uint256 const& feat,
// AmendmentTable& table,
// weeks week,
// std::vector<std::pair<PublicKey, SecretKey>> const& validators,
// std::vector<std::pair<uint256, int>> const& votes,
// std::vector<uint256>& ourVotes,
// std::set<uint256>& enabled,
// majorityAmendments_t& majority)
// {
// doRound(
// {feat},
// table,
// week,
// validators,
// votes,
// ourVotes,
// enabled,
// majority);
// }

// No vote on unknown amendment
void
testNoOnUnknown(std::unordered_set<uint256, beast::uhash<>> const& features)
Expand Down Expand Up @@ -882,10 +860,12 @@ class AmendmentTable_test final : public beast::unit_test::suite
enabled,
majority);

// For 80% cut off is 4: (16 - 3) < 0.80 < 16 - 4
// For 65% cut off is 6: (16 - 5) < 0.65 < 16 - 6
int lim = features.contains(fixAmendmentFlapping) ? 6 : 4;

if (i < lim) // 16 - 3 = 13 => 13/16 = 0.8125 => > 80%
{ // 16 - 4 = 12 => 12/16 = 0.75 => < 80%
if (i < lim)
{
// We are voting yes, not enabled, majority
BEAST_EXPECT(!ourVotes.empty());
BEAST_EXPECT(enabled.empty());
Expand Down

0 comments on commit c2b2686

Please sign in to comment.