Fix Replace assert with XRPL_ASSERT (#5312)

This commit is contained in:
Bronek Kozicki
2025-02-25 16:43:26 +00:00
committed by GitHub
parent 9745718467
commit 37d06bcce8
3 changed files with 14 additions and 6 deletions

View File

@@ -226,7 +226,10 @@ public:
toBase58(TokenType::NodePublic, votes.first);
if (!votes.second.timeout)
{
assert(votes.second.upVotes.empty());
XRPL_ASSERT(
votes.second.upVotes.empty(),
"ripple::TrustedVotes::recordVotes : received no "
"upvotes");
JLOG(j.debug())
<< "recordVotes: Have not received any "
"amendment votes from "
@@ -242,7 +245,10 @@ public:
}
else if (votes.second.timeout != newTimeout)
{
assert(votes.second.timeout < newTimeout);
XRPL_ASSERT(
votes.second.timeout < newTimeout,
"ripple::TrustedVotes::recordVotes : votes not "
"expired");
using namespace std::chrono;
auto const age = duration_cast<minutes>(
newTimeout - *votes.second.timeout);
@@ -262,9 +268,10 @@ public:
int available = 0;
for (auto& validatorVotes : recordedVotes_)
{
assert(
XRPL_ASSERT(
validatorVotes.second.timeout ||
validatorVotes.second.upVotes.empty());
validatorVotes.second.upVotes.empty(),
"ripple::TrustedVotes::getVotes : valid votes");
if (validatorVotes.second.timeout)
++available;
for (uint256 const& amendment : validatorVotes.second.upVotes)

View File

@@ -1245,7 +1245,7 @@ PeerImp::handleTransaction(
{
XRPL_ASSERT(
eraseTxQueue != batch,
("ripple::PeerImp::handleTransaction correct function params"));
("ripple::PeerImp::handleTransaction : valid inputs"));
if (tracking_.load() == Tracking::diverged)
return;

View File

@@ -154,7 +154,8 @@ private:
update(Resource::Charge f, std::string const& add)
{
XRPL_ASSERT(
f >= fee, "ripple::PeerImp::ChargeWithContext fee increases");
f >= fee,
"ripple::PeerImp::ChargeWithContext::update : fee increases");
fee = f;
if (!context.empty())
{