Switch from assert to XRPL_ASSERT (#5245)

This commit is contained in:
Bronek Kozicki
2025-01-23 21:56:37 +00:00
committed by tequ
parent ce5c3c98c9
commit 33b5ed931c

View File

@@ -54,8 +54,9 @@ PermissionedDomainDelete::preclaim(PreclaimContext const& ctx)
if (!sleDomain)
return tecNO_ENTRY;
assert(
sleDomain->isFieldPresent(sfOwner) && ctx.tx.isFieldPresent(sfAccount));
XRPL_ASSERT(
sleDomain->isFieldPresent(sfOwner) && ctx.tx.isFieldPresent(sfAccount),
"ripple::PermissionedDomainDelete::preclaim : required fields present");
if (sleDomain->getAccountID(sfOwner) != ctx.tx.getAccountID(sfAccount))
return tecNO_PERMISSION;
@@ -66,7 +67,9 @@ PermissionedDomainDelete::preclaim(PreclaimContext const& ctx)
TER
PermissionedDomainDelete::doApply()
{
assert(ctx_.tx.isFieldPresent(sfDomainID));
XRPL_ASSERT(
ctx_.tx.isFieldPresent(sfDomainID),
"ripple::PermissionedDomainDelete::doApply : required field present");
auto const slePd =
view().peek({ltPERMISSIONED_DOMAIN, ctx_.tx.at(sfDomainID)});
@@ -80,7 +83,9 @@ PermissionedDomainDelete::doApply()
}
auto const ownerSle = view().peek(keylet::account(account_));
assert(ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0);
XRPL_ASSERT(
ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0,
"ripple::PermissionedDomainDelete::doApply : nonzero owner count");
adjustOwnerCount(view(), ownerSle, -1, ctx_.journal);
view().erase(slePd);