mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 01:06:48 +00:00
refactor: Add simple clang-tidy readability checks (#6556)
This change enables the following clang-tidy checks: - readability-avoid-nested-conditional-operator, - readability-avoid-return-with-void-value, - readability-braces-around-statements, - readability-const-return-type, - readability-container-contains, - readability-container-size-empty, - readability-else-after-return, - readability-make-member-function-const, - readability-redundant-casting, - readability-redundant-inline-specifier, - readability-redundant-member-init, - readability-redundant-string-init, - readability-reference-to-constructed-temporary, - readability-static-definition
This commit is contained in:
@@ -2142,14 +2142,22 @@ struct XChain_test : public beast::unit_test::suite, public jtx::XChainBridgeObj
|
||||
|
||||
TER const expectedTER = i < quorum ? tesSUCCESS : TER{tecXCHAIN_NO_CLAIM_ID};
|
||||
if (i + 1 == quorum)
|
||||
{
|
||||
scEnv.tx(att, ter(expectedTER)).close();
|
||||
}
|
||||
else
|
||||
{
|
||||
scEnv.tx(att, ter(expectedTER)).close();
|
||||
}
|
||||
|
||||
if (i + 1 < quorum)
|
||||
{
|
||||
BEAST_EXPECT(dstStartBalance == scEnv.env_.balance(dst));
|
||||
}
|
||||
else
|
||||
{
|
||||
BEAST_EXPECT(dstStartBalance + amt == scEnv.env_.balance(dst));
|
||||
}
|
||||
}
|
||||
BEAST_EXPECT(dstStartBalance + amt == scEnv.env_.balance(dst));
|
||||
}
|
||||
@@ -2336,9 +2344,13 @@ struct XChain_test : public beast::unit_test::suite, public jtx::XChainBridgeObj
|
||||
|
||||
scEnv.tx(att, ter(expectedTER)).close();
|
||||
if (i + 1 < xrp_b.quorum)
|
||||
{
|
||||
BEAST_EXPECT(!scEnv.env_.le(ua));
|
||||
}
|
||||
else
|
||||
{
|
||||
BEAST_EXPECT(scEnv.env_.le(ua));
|
||||
}
|
||||
}
|
||||
BEAST_EXPECT(scEnv.env_.le(ua));
|
||||
}
|
||||
@@ -3917,8 +3929,10 @@ private:
|
||||
verify() const
|
||||
{
|
||||
for (auto const& [acct, state] : accounts)
|
||||
{
|
||||
if (!state.verify(env, acct))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4297,9 +4311,14 @@ private:
|
||||
break;
|
||||
|
||||
case st_attesting:
|
||||
sm_state = attest(time, rnd)
|
||||
? (xfer.with_claim == WithClaim::yes ? st_attested : st_completed)
|
||||
: st_attesting;
|
||||
if (attest(time, rnd))
|
||||
{
|
||||
sm_state = xfer.with_claim == WithClaim::yes ? st_attested : st_completed;
|
||||
}
|
||||
else
|
||||
{
|
||||
sm_state = st_attesting;
|
||||
}
|
||||
break;
|
||||
|
||||
case st_attested:
|
||||
@@ -4366,9 +4385,13 @@ public:
|
||||
};
|
||||
auto& [t, sm] = *it;
|
||||
if (t <= time && std::visit(vis, sm) == st_completed)
|
||||
{
|
||||
it = sm_.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
// send attestations
|
||||
@@ -4408,8 +4431,10 @@ public:
|
||||
std::vector<Account> result;
|
||||
result.reserve(num_acct);
|
||||
for (int i = 0; i < num_acct; ++i)
|
||||
{
|
||||
result.emplace_back(
|
||||
"a"s + std::to_string(i), (i % 2) ? KeyType::ed25519 : KeyType::secp256k1);
|
||||
}
|
||||
result.emplace_back("doorXRPLocking");
|
||||
doorXRPLocking = result.back();
|
||||
result.emplace_back("doorUSDLocking");
|
||||
@@ -4458,8 +4483,10 @@ public:
|
||||
std::vector<Account> result;
|
||||
result.reserve(num_ua);
|
||||
for (int i = 0; i < num_ua; ++i)
|
||||
{
|
||||
result.emplace_back(
|
||||
"ua"s + std::to_string(i), (i % 2) ? KeyType::ed25519 : KeyType::secp256k1);
|
||||
}
|
||||
return result;
|
||||
}();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user