Skip to content

Commit 3868c04

Browse files
authored
Switch from assert to XRPL_ASSERT (#5245)
1 parent 409c1d5 commit 3868c04

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/xrpld/app/tx/detail/PermissionedDomainDelete.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ PermissionedDomainDelete::preclaim(PreclaimContext const& ctx)
5454
if (!sleDomain)
5555
return tecNO_ENTRY;
5656

57-
assert(
58-
sleDomain->isFieldPresent(sfOwner) && ctx.tx.isFieldPresent(sfAccount));
57+
XRPL_ASSERT(
58+
sleDomain->isFieldPresent(sfOwner) && ctx.tx.isFieldPresent(sfAccount),
59+
"ripple::PermissionedDomainDelete::preclaim : required fields present");
5960
if (sleDomain->getAccountID(sfOwner) != ctx.tx.getAccountID(sfAccount))
6061
return tecNO_PERMISSION;
6162

@@ -66,7 +67,9 @@ PermissionedDomainDelete::preclaim(PreclaimContext const& ctx)
6667
TER
6768
PermissionedDomainDelete::doApply()
6869
{
69-
assert(ctx_.tx.isFieldPresent(sfDomainID));
70+
XRPL_ASSERT(
71+
ctx_.tx.isFieldPresent(sfDomainID),
72+
"ripple::PermissionedDomainDelete::doApply : required field present");
7073

7174
auto const slePd =
7275
view().peek({ltPERMISSIONED_DOMAIN, ctx_.tx.at(sfDomainID)});
@@ -80,7 +83,9 @@ PermissionedDomainDelete::doApply()
8083
}
8184

8285
auto const ownerSle = view().peek(keylet::account(account_));
83-
assert(ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0);
86+
XRPL_ASSERT(
87+
ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0,
88+
"ripple::PermissionedDomainDelete::doApply : nonzero owner count");
8489
adjustOwnerCount(view(), ownerSle, -1, ctx_.journal);
8590
view().erase(slePd);
8691

0 commit comments

Comments
 (0)