mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Merge branch 'ripple/wamr' into ripple/wamr-host-functions
This commit is contained in:
6
.github/workflows/on-trigger.yml
vendored
6
.github/workflows/on-trigger.yml
vendored
@@ -9,9 +9,9 @@ name: Trigger
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- release
|
||||
- master
|
||||
- "develop"
|
||||
- "release*"
|
||||
- "master"
|
||||
paths:
|
||||
# These paths are unique to `on-trigger.yml`.
|
||||
- ".github/workflows/reusable-check-missing-commits.yml"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"rocksdb/10.0.1#85537f46e538974d67da0c3977de48ac%1756234304.347",
|
||||
"re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
|
||||
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
|
||||
"openssl/3.6.0#89e8af1d4a21afcac0557079d23d8890%1759746682.365",
|
||||
"openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1759746684.671",
|
||||
"nudb/2.0.9#c62cfd501e57055a7e0d8ee3d5e5427d%1756234237.107",
|
||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
|
||||
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
|
||||
|
||||
@@ -28,7 +28,7 @@ class Xrpl(ConanFile):
|
||||
'grpc/1.50.1',
|
||||
'libarchive/3.8.1',
|
||||
'nudb/2.0.9',
|
||||
'openssl/3.6.0',
|
||||
'openssl/3.5.4',
|
||||
'soci/4.0.3',
|
||||
'zlib/1.3.1',
|
||||
'wamr/2.4.1',
|
||||
|
||||
@@ -77,19 +77,23 @@ deleteSLE(
|
||||
AccountID const& account, SField const& node, bool isOwner) -> TER {
|
||||
auto const sleAccount = view.peek(keylet::account(account));
|
||||
if (!sleAccount)
|
||||
{ // LCOV_EXCL_START
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Internal error: can't retrieve Owner account.";
|
||||
return tecINTERNAL;
|
||||
} // LCOV_EXCL_STOP
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Remove object from owner directory
|
||||
std::uint64_t const page = sleCredential->getFieldU64(node);
|
||||
if (!view.dirRemove(
|
||||
keylet::ownerDir(account), page, sleCredential->key(), false))
|
||||
{ // LCOV_EXCL_START
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Unable to delete Credential from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
} // LCOV_EXCL_STOP
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
if (isOwner)
|
||||
adjustOwnerCount(view, sleAccount, -1, j);
|
||||
|
||||
@@ -1292,7 +1292,7 @@ authorizeMPToken(
|
||||
{
|
||||
auto const sleAcct = view.peek(keylet::account(account));
|
||||
if (!sleAcct)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// If the account that submitted the tx is a holder
|
||||
// Note: `account_` is holder's account
|
||||
@@ -1357,17 +1357,17 @@ authorizeMPToken(
|
||||
|
||||
auto const sleMptIssuance = view.read(keylet::mptIssuance(mptIssuanceID));
|
||||
if (!sleMptIssuance)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// If the account that submitted this tx is the issuer of the MPT
|
||||
// Note: `account_` is issuer's account
|
||||
// `holderID` is holder's account
|
||||
if (account != (*sleMptIssuance)[sfIssuer])
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const sleMpt = view.peek(keylet::mptoken(mptIssuanceID, *holderID));
|
||||
if (!sleMpt)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const flagsIn = sleMpt->getFieldU32(sfFlags);
|
||||
std::uint32_t flagsOut = flagsIn;
|
||||
@@ -1424,7 +1424,7 @@ trustCreate(
|
||||
describeOwnerDir(uLowAccountID));
|
||||
|
||||
if (!lowNode)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
auto highNode = view.dirInsert(
|
||||
keylet::ownerDir(uHighAccountID),
|
||||
@@ -1432,14 +1432,14 @@ trustCreate(
|
||||
describeOwnerDir(uHighAccountID));
|
||||
|
||||
if (!highNode)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
bool const bSetDst = saLimit.getIssuer() == uDstAccountID;
|
||||
bool const bSetHigh = bSrcHigh ^ bSetDst;
|
||||
|
||||
XRPL_ASSERT(sleAccount, "ripple::trustCreate : non-null SLE");
|
||||
if (!sleAccount)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
XRPL_ASSERT(
|
||||
sleAccount->getAccountID(sfAccount) ==
|
||||
@@ -1518,10 +1518,12 @@ removeEmptyHolding(
|
||||
{
|
||||
auto const sle = view.read(keylet::account(accountID));
|
||||
if (!sle)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const balance = sle->getFieldAmount(sfBalance);
|
||||
if (balance.xrp() != 0)
|
||||
return tecHAS_OBLIGATIONS;
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
@@ -1539,7 +1541,8 @@ removeEmptyHolding(
|
||||
auto sleLowAccount =
|
||||
view.peek(keylet::account(line->at(sfLowLimit)->getIssuer()));
|
||||
if (!sleLowAccount)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
adjustOwnerCount(view, sleLowAccount, -1, journal);
|
||||
// It's not really necessary to clear the reserve flag, since the line
|
||||
// is about to be deleted, but this will make the metadata reflect an
|
||||
@@ -1553,7 +1556,8 @@ removeEmptyHolding(
|
||||
auto sleHighAccount =
|
||||
view.peek(keylet::account(line->at(sfHighLimit)->getIssuer()));
|
||||
if (!sleHighAccount)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
adjustOwnerCount(view, sleHighAccount, -1, journal);
|
||||
// It's not really necessary to clear the reserve flag, since the line
|
||||
// is about to be deleted, but this will make the metadata reflect an
|
||||
@@ -1613,7 +1617,7 @@ trustDelete(
|
||||
sleRippleState->key(),
|
||||
false))
|
||||
{
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
JLOG(j.trace()) << "trustDelete: Deleting ripple line: high";
|
||||
@@ -1624,7 +1628,7 @@ trustDelete(
|
||||
sleRippleState->key(),
|
||||
false))
|
||||
{
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
JLOG(j.trace()) << "trustDelete: Deleting ripple line: state";
|
||||
@@ -1650,7 +1654,7 @@ offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j)
|
||||
offerIndex,
|
||||
false))
|
||||
{
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
if (!view.dirRemove(
|
||||
@@ -1659,7 +1663,7 @@ offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j)
|
||||
offerIndex,
|
||||
false))
|
||||
{
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
if (sle->isFieldPresent(sfAdditionalBooks))
|
||||
@@ -1823,7 +1827,7 @@ rippleCreditIOU(
|
||||
|
||||
auto const sleAccount = view.peek(keylet::account(uReceiverID));
|
||||
if (!sleAccount)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
bool const noRipple = (sleAccount->getFlags() & lsfDefaultRipple) == 0;
|
||||
|
||||
@@ -1913,14 +1917,16 @@ accountSendIOU(
|
||||
{
|
||||
if (saAmount < beast::zero || saAmount.holds<MPTIssue>())
|
||||
{
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
XRPL_ASSERT(
|
||||
saAmount >= beast::zero && !saAmount.holds<MPTIssue>(),
|
||||
"ripple::accountSendIOU : minimum amount and not MPT");
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
/* If we aren't sending anything or if the sender is the same as the
|
||||
@@ -1977,8 +1983,10 @@ accountSendIOU(
|
||||
{
|
||||
// VFALCO Its laborious to have to mutate the
|
||||
// TER based on params everywhere
|
||||
// LCOV_EXCL_START
|
||||
terResult = view.open() ? TER{telFAILED_PROCESSING}
|
||||
: TER{tecFAILED_PROCESSING};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2065,7 +2073,7 @@ rippleCreditMPT(
|
||||
view.update(sleIssuance);
|
||||
}
|
||||
else
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2325,7 +2333,7 @@ issueIOU(
|
||||
|
||||
auto const receiverAccount = view.peek(keylet::account(account));
|
||||
if (!receiverAccount)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
bool noRipple = (receiverAccount->getFlags() & lsfDefaultRipple) == 0;
|
||||
|
||||
@@ -2413,11 +2421,13 @@ redeemIOU(
|
||||
// In order to hold an IOU, a trust line *MUST* exist to track the
|
||||
// balance. If it doesn't, then something is very wrong. Don't try
|
||||
// to continue.
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "redeemIOU: " << to_string(account)
|
||||
<< " attempts to redeem " << amount.getFullText()
|
||||
<< " but no trust line exists!";
|
||||
|
||||
return tefINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
TER
|
||||
@@ -2437,7 +2447,7 @@ transferXRP(
|
||||
SLE::pointer const sender = view.peek(keylet::account(from));
|
||||
SLE::pointer const receiver = view.peek(keylet::account(to));
|
||||
if (!sender || !receiver)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
JLOG(j.trace()) << "transferXRP: " << to_string(from) << " -> "
|
||||
<< to_string(to) << ") : " << amount.getFullText();
|
||||
@@ -2447,8 +2457,10 @@ transferXRP(
|
||||
// VFALCO Its unfortunate we have to keep
|
||||
// mutating these TER everywhere
|
||||
// FIXME: this logic should be moved to callers maybe?
|
||||
// LCOV_EXCL_START
|
||||
return view.open() ? TER{telFAILED_PROCESSING}
|
||||
: TER{tecFAILED_PROCESSING};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Decrement XRP balance.
|
||||
@@ -2729,11 +2741,13 @@ cleanupOnAccountDelete(
|
||||
if (!sleItem)
|
||||
{
|
||||
// Directory node has an invalid index. Bail out.
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal())
|
||||
<< "DeleteAccount: Directory node in ledger " << view.seq()
|
||||
<< " has index to object that is missing: "
|
||||
<< to_string(dirEntry);
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
LedgerEntryType const nodeType{safe_cast<LedgerEntryType>(
|
||||
@@ -2766,9 +2780,11 @@ cleanupOnAccountDelete(
|
||||
"ripple::cleanupOnAccountDelete : minimum dir entries");
|
||||
if (uDirEntry == 0)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.error())
|
||||
<< "DeleteAccount iterator re-validation failed.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
if (skipEntry == SkipEntry::No)
|
||||
uDirEntry--;
|
||||
@@ -2788,7 +2804,7 @@ deleteAMMTrustLine(
|
||||
beast::Journal j)
|
||||
{
|
||||
if (!sleState || sleState->getType() != ltRIPPLE_STATE)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const& [low, high] = std::minmax(
|
||||
sleState->getFieldAmount(sfLowLimit).getIssuer(),
|
||||
@@ -2796,13 +2812,14 @@ deleteAMMTrustLine(
|
||||
auto sleLow = view.peek(keylet::account(low));
|
||||
auto sleHigh = view.peek(keylet::account(high));
|
||||
if (!sleLow || !sleHigh)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
bool const ammLow = sleLow->isFieldPresent(sfAMMID);
|
||||
bool const ammHigh = sleHigh->isFieldPresent(sfAMMID);
|
||||
|
||||
// can't both be AMM
|
||||
if (ammLow && ammHigh)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// at least one must be
|
||||
if (!ammLow && !ammHigh)
|
||||
@@ -2822,7 +2839,7 @@ deleteAMMTrustLine(
|
||||
|
||||
auto const uFlags = !ammLow ? lsfLowReserve : lsfHighReserve;
|
||||
if (!(sleState->getFlags() & uFlags))
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
adjustOwnerCount(view, !ammLow ? sleLow : sleHigh, -1, j);
|
||||
|
||||
|
||||
@@ -3728,6 +3728,9 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
|
||||
|
||||
if (databaseType == DatabaseType::None)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
UNREACHABLE(
|
||||
"ripple::NetworkOPsImp::addAccountHistoryJob : no database");
|
||||
JLOG(m_journal.error())
|
||||
<< "AccountHistory job for account "
|
||||
<< toBase58(subInfo.index_->accountId_) << " no database";
|
||||
@@ -3737,6 +3740,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
|
||||
unsubAccountHistory(sptr, subInfo.index_->accountId_, false);
|
||||
}
|
||||
return;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
app_.getJobQueue().addJob(
|
||||
@@ -3836,7 +3840,7 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
|
||||
// LCOV_EXCL_START
|
||||
default: {
|
||||
UNREACHABLE(
|
||||
"ripple::NetworkOPsImp::addAccountHistoryJob::"
|
||||
"ripple::NetworkOPsImp::addAccountHistoryJob : "
|
||||
"getMoreTxns : invalid database type");
|
||||
return {};
|
||||
}
|
||||
@@ -3901,11 +3905,16 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
|
||||
getMoreTxns(startLedgerSeq, lastLedgerSeq, marker);
|
||||
if (!dbResult)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
UNREACHABLE(
|
||||
"ripple::NetworkOPsImp::addAccountHistoryJob : "
|
||||
"getMoreTxns failed");
|
||||
JLOG(m_journal.debug())
|
||||
<< "AccountHistory job for account "
|
||||
<< toBase58(accountId) << " getMoreTxns failed.";
|
||||
send(rpcError(rpcINTERNAL), true);
|
||||
return;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const& txns = dbResult->first;
|
||||
@@ -3928,22 +3937,32 @@ NetworkOPsImp::addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
|
||||
tx->getLedger());
|
||||
if (!curTxLedger)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
UNREACHABLE(
|
||||
"ripple::NetworkOPsImp::addAccountHistoryJob : "
|
||||
"getLedgerBySeq failed");
|
||||
JLOG(m_journal.debug())
|
||||
<< "AccountHistory job for account "
|
||||
<< toBase58(accountId) << " no ledger.";
|
||||
send(rpcError(rpcINTERNAL), true);
|
||||
return;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
std::shared_ptr<STTx const> stTxn =
|
||||
tx->getSTransaction();
|
||||
if (!stTxn)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
UNREACHABLE(
|
||||
"NetworkOPsImp::addAccountHistoryJob : "
|
||||
"getSTransaction failed");
|
||||
JLOG(m_journal.debug())
|
||||
<< "AccountHistory job for account "
|
||||
<< toBase58(accountId)
|
||||
<< " getSTransaction failed.";
|
||||
send(rpcError(rpcINTERNAL), true);
|
||||
return;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const mRef = std::ref(*meta);
|
||||
|
||||
@@ -247,10 +247,12 @@ applyBid(
|
||||
if (saBurn >= lptAMMBalance)
|
||||
{
|
||||
// This error case should never occur.
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx_.journal.fatal())
|
||||
<< "AMM Bid: LP Token burn exceeds AMM balance " << burn << " "
|
||||
<< lptAMMBalance;
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
auto res =
|
||||
redeemIOU(sb, account_, saBurn, lpTokens.issue(), ctx_.journal);
|
||||
|
||||
@@ -197,7 +197,7 @@ AMMCreate::preclaim(PreclaimContext const& ctx)
|
||||
return tesSUCCESS;
|
||||
if (auto const sle = ctx.view.read(keylet::account(issue.account));
|
||||
!sle)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
else if (sle->getFlags() & lsfAllowTrustLineClawback)
|
||||
return tecNO_PERMISSION;
|
||||
return tesSUCCESS;
|
||||
@@ -291,7 +291,7 @@ applyCreate(
|
||||
if (SLE::pointer sleRippleState =
|
||||
sb.peek(keylet::line(accountId, amount.issue()));
|
||||
!sleRippleState)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
else
|
||||
{
|
||||
auto const flags = sleRippleState->getFlags();
|
||||
|
||||
@@ -196,9 +196,11 @@ AMMWithdraw::preclaim(PreclaimContext const& ctx)
|
||||
if (amountBalance <= beast::zero || amount2Balance <= beast::zero ||
|
||||
lptAMMBalance < beast::zero)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.j.debug())
|
||||
<< "AMM Withdraw: reserves or tokens balance is zero.";
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const ammAccountID = ammSle->getAccountID(sfAccount);
|
||||
|
||||
@@ -93,8 +93,10 @@ CancelCheck::doApply()
|
||||
if (!view().dirRemove(
|
||||
keylet::ownerDir(dstId), page, sleCheck->key(), true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete check from destination.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
{
|
||||
@@ -102,8 +104,10 @@ CancelCheck::doApply()
|
||||
if (!view().dirRemove(
|
||||
keylet::ownerDir(srcId), page, sleCheck->key(), true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete check from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ CancelOffer::doApply()
|
||||
|
||||
auto const sle = view().read(keylet::account(account_));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (auto sleOffer = view().peek(keylet::offer(account_, offerSequence)))
|
||||
{
|
||||
|
||||
@@ -87,8 +87,10 @@ CashCheck::preclaim(PreclaimContext const& ctx)
|
||||
{
|
||||
// They wrote a check to themselves. This should be caught when
|
||||
// the check is created, but better late than never.
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.j.error()) << "Malformed transaction: Cashing check to self.";
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
{
|
||||
auto const sleSrc = ctx.view.read(keylet::account(srcId));
|
||||
@@ -245,17 +247,21 @@ CashCheck::doApply()
|
||||
auto sleCheck = psb.peek(keylet::check(ctx_.tx[sfCheckID]));
|
||||
if (!sleCheck)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Precheck did not verify check's existence.";
|
||||
return tecFAILED_PROCESSING;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
AccountID const srcId{sleCheck->getAccountID(sfAccount)};
|
||||
if (!psb.exists(keylet::account(srcId)) ||
|
||||
!psb.exists(keylet::account(account_)))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx_.journal.fatal())
|
||||
<< "Precheck did not verify source or destination's existence.";
|
||||
return tecFAILED_PROCESSING;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Preclaim already checked that source has at least the requested
|
||||
@@ -478,8 +484,10 @@ CashCheck::doApply()
|
||||
sleCheck->key(),
|
||||
true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete check from destination.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Remove check from check owner's directory.
|
||||
@@ -489,8 +497,10 @@ CashCheck::doApply()
|
||||
sleCheck->key(),
|
||||
true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete check from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// If we succeeded, update the check owner's reserve.
|
||||
|
||||
@@ -235,7 +235,7 @@ applyHelper<Issue>(ApplyContext& ctx)
|
||||
// Replace the `issuer` field with issuer's account
|
||||
clawAmount.setIssuer(issuer);
|
||||
if (holder == issuer)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Get the spendable balance. Must use `accountHolds`.
|
||||
STAmount const spendableAmount = accountHolds(
|
||||
|
||||
@@ -159,7 +159,7 @@ CreateCheck::doApply()
|
||||
{
|
||||
auto const sle = view().peek(keylet::account(account_));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// A check counts against the reserve of the issuing account, but we
|
||||
// check the starting balance because we want to allow dipping into the
|
||||
@@ -209,7 +209,7 @@ CreateCheck::doApply()
|
||||
<< (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
sleCheck->setFieldU64(sfDestinationNode, *page);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ CreateCheck::doApply()
|
||||
<< (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
sleCheck->setFieldU64(sfOwnerNode, *page);
|
||||
}
|
||||
|
||||
@@ -848,9 +848,11 @@ CreateOffer::applyGuts(Sandbox& sb, Sandbox& sbCancel)
|
||||
|
||||
if (!ownerNode)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.debug())
|
||||
<< "final result: failed to add offer to owner's directory";
|
||||
return {tecDIR_FULL, true};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Update owner count.
|
||||
@@ -894,8 +896,10 @@ CreateOffer::applyGuts(Sandbox& sb, Sandbox& sbCancel)
|
||||
|
||||
if (!bookNode)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.debug()) << "final result: failed to add offer to book";
|
||||
return {tecDIR_FULL, true};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto sleOffer = std::make_shared<SLE>(offer_index);
|
||||
|
||||
@@ -76,7 +76,7 @@ CreateTicket::doApply()
|
||||
{
|
||||
SLE::pointer const sleAccountRoot = view().peek(keylet::account(account_));
|
||||
if (!sleAccountRoot)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Each ticket counts against the reserve of the issuing account, but we
|
||||
// check the starting balance because we want to allow dipping into the
|
||||
@@ -102,7 +102,7 @@ CreateTicket::doApply()
|
||||
// increment the account root Sequence.
|
||||
if (std::uint32_t const txSeq = ctx_.tx[sfSequence];
|
||||
txSeq != 0 && txSeq != (firstTicketSeq - 1))
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
for (std::uint32_t i = 0; i < ticketCount; ++i)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ CreateTicket::doApply()
|
||||
<< ": " << (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
sleTicket->setFieldU64(sfOwnerNode, *page);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ CredentialCreate::doApply()
|
||||
|
||||
auto const sleCred = std::make_shared<SLE>(credentialKey);
|
||||
if (!sleCred)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const optExp = ctx_.tx[~sfExpiration];
|
||||
if (optExp)
|
||||
@@ -137,7 +137,7 @@ CredentialCreate::doApply()
|
||||
|
||||
auto const sleIssuer = view().peek(keylet::account(account_));
|
||||
if (!sleIssuer)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
{
|
||||
STAmount const reserve{view().fees().accountReserve(
|
||||
@@ -162,7 +162,7 @@ CredentialCreate::doApply()
|
||||
<< to_string(credentialKey.key) << ": "
|
||||
<< (page ? "success" : "failure");
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
sleCred->setFieldU64(sfIssuerNode, *page);
|
||||
|
||||
adjustOwnerCount(view(), sleIssuer, 1, j_);
|
||||
@@ -182,7 +182,7 @@ CredentialCreate::doApply()
|
||||
<< to_string(credentialKey.key) << ": "
|
||||
<< (page ? "success" : "failure");
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
sleCred->setFieldU64(sfSubjectNode, *page);
|
||||
view().update(view().peek(keylet::account(subject)));
|
||||
}
|
||||
@@ -258,7 +258,7 @@ CredentialDelete::doApply()
|
||||
auto const sleCred =
|
||||
view().peek(keylet::credential(subject, issuer, credType));
|
||||
if (!sleCred)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if ((subject != account_) && (issuer != account_) &&
|
||||
!checkExpired(sleCred, ctx_.view().info().parentCloseTime))
|
||||
@@ -342,7 +342,7 @@ CredentialAccept::doApply()
|
||||
auto const sleIssuer = view().peek(keylet::account(issuer));
|
||||
|
||||
if (!sleSubject || !sleIssuer)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
{
|
||||
STAmount const reserve{view().fees().accountReserve(
|
||||
|
||||
@@ -76,7 +76,7 @@ addSLE(
|
||||
{
|
||||
auto const sleAccount = ctx.view().peek(keylet::account(owner));
|
||||
if (!sleAccount)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Check reserve availability for new object creation
|
||||
{
|
||||
@@ -96,7 +96,7 @@ addSLE(
|
||||
auto page = ctx.view().dirInsert(
|
||||
keylet::ownerDir(owner), sle->key(), describeOwnerDir(owner));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*sle)[sfOwnerNode] = *page;
|
||||
}
|
||||
adjustOwnerCount(ctx.view(), sleAccount, 1, ctx.journal);
|
||||
@@ -189,13 +189,15 @@ DIDDelete::deleteSLE(
|
||||
if (!view.dirRemove(
|
||||
keylet::ownerDir(owner), (*sle)[sfOwnerNode], sle->key(), true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Unable to delete DID Token from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const sleOwner = view.peek(keylet::account(owner));
|
||||
if (!sleOwner)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
adjustOwnerCount(view, sleOwner, -1, j);
|
||||
view.update(sleOwner);
|
||||
|
||||
@@ -141,7 +141,7 @@ removeNFTokenOfferFromLedger(
|
||||
beast::Journal)
|
||||
{
|
||||
if (!nft::deleteTokenOffer(view, sleDel))
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
@@ -336,11 +336,13 @@ DeleteAccount::preclaim(PreclaimContext const& ctx)
|
||||
if (!sleItem)
|
||||
{
|
||||
// Directory node has an invalid index. Bail out.
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.j.fatal())
|
||||
<< "DeleteAccount: directory node in ledger " << ctx.view.seq()
|
||||
<< " has index to object that is missing: "
|
||||
<< to_string(dirEntry);
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
LedgerEntryType const nodeType{
|
||||
@@ -373,7 +375,7 @@ DeleteAccount::doApply()
|
||||
dst, "ripple::DeleteAccount::doApply : non-null destination account");
|
||||
|
||||
if (!src || !dst)
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
|
||||
if (ctx_.view().rules().enabled(featureDepositAuth) &&
|
||||
ctx_.tx.isFieldPresent(sfCredentialIDs))
|
||||
|
||||
@@ -138,7 +138,7 @@ DepositPreauth::preclaim(PreclaimContext const& ctx)
|
||||
return tecNO_ISSUER;
|
||||
auto [it, ins] = sorted.emplace(issuer, o[sfCredentialType]);
|
||||
if (!ins)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
// Verify that the Preauth entry they asked to add is not already
|
||||
@@ -198,7 +198,7 @@ DepositPreauth::doApply()
|
||||
<< (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
slePreauth->setFieldU64(sfOwnerNode, *page);
|
||||
|
||||
@@ -216,7 +216,7 @@ DepositPreauth::doApply()
|
||||
{
|
||||
auto const sleOwner = view().peek(keylet::account(account_));
|
||||
if (!sleOwner)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// A preauth counts against the reserve of the issuing account, but we
|
||||
// check the starting balance because we want to allow dipping into the
|
||||
@@ -246,7 +246,7 @@ DepositPreauth::doApply()
|
||||
Keylet const preauthKey = keylet::depositPreauth(account_, sortedTX);
|
||||
auto slePreauth = std::make_shared<SLE>(preauthKey);
|
||||
if (!slePreauth)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
slePreauth->setAccountID(sfAccount, account_);
|
||||
slePreauth->peekFieldArray(sfAuthorizeCredentials) =
|
||||
@@ -262,7 +262,7 @@ DepositPreauth::doApply()
|
||||
<< (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
slePreauth->setFieldU64(sfOwnerNode, *page);
|
||||
|
||||
@@ -299,14 +299,16 @@ DepositPreauth::removeFromLedger(
|
||||
std::uint64_t const page{(*slePreauth)[sfOwnerNode]};
|
||||
if (!view.dirRemove(keylet::ownerDir(account), page, preauthIndex, false))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Unable to delete DepositPreauth from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// If we succeeded, update the DepositPreauth owner's reserve.
|
||||
auto const sleOwner = view.peek(keylet::account(account));
|
||||
if (!sleOwner)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
adjustOwnerCount(view, sleOwner, -1, j);
|
||||
|
||||
|
||||
@@ -414,10 +414,8 @@ escrowLockApplyHelper<Issue>(
|
||||
beast::Journal journal)
|
||||
{
|
||||
// Defensive: Issuer cannot create an escrow
|
||||
// LCOV_EXCL_START
|
||||
if (issuer == sender)
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const ter = rippleCredit(
|
||||
view,
|
||||
@@ -441,10 +439,8 @@ escrowLockApplyHelper<MPTIssue>(
|
||||
beast::Journal journal)
|
||||
{
|
||||
// Defensive: Issuer cannot create an escrow
|
||||
// LCOV_EXCL_START
|
||||
if (issuer == sender)
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const ter = rippleLockEscrowMPT(view, sender, amount, journal);
|
||||
if (ter != tesSUCCESS)
|
||||
@@ -472,6 +468,9 @@ EscrowCreate::doApply()
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is old code that needs to stay to support replaying old ledgers,
|
||||
// but does not need to be covered by new tests.
|
||||
// LCOV_EXCL_START
|
||||
if (ctx_.tx[~sfCancelAfter])
|
||||
{
|
||||
auto const cancelAfter = ctx_.tx[sfCancelAfter];
|
||||
@@ -487,6 +486,7 @@ EscrowCreate::doApply()
|
||||
if (closeTime.time_since_epoch().count() >= finishAfter)
|
||||
return tecNO_PERMISSION;
|
||||
}
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const sle = ctx_.view().peek(keylet::account(account_));
|
||||
@@ -514,12 +514,12 @@ EscrowCreate::doApply()
|
||||
auto const sled =
|
||||
ctx_.view().read(keylet::account(ctx_.tx[sfDestination]));
|
||||
if (!sled)
|
||||
return tecNO_DST;
|
||||
return tecNO_DST; // LCOV_EXCL_LINE
|
||||
if (((*sled)[sfFlags] & lsfRequireDestTag) &&
|
||||
!ctx_.tx[~sfDestinationTag])
|
||||
return tecDST_TAG_NEEDED;
|
||||
|
||||
// Obeying the lsfDissalowXRP flag was a bug. Piggyback on
|
||||
// Obeying the lsfDisallowXRP flag was a bug. Piggyback on
|
||||
// featureDepositAuth to remove the bug.
|
||||
if (!ctx_.view().rules().enabled(featureDepositAuth) &&
|
||||
((*sled)[sfFlags] & lsfDisallowXRP))
|
||||
@@ -601,7 +601,9 @@ EscrowCreate::doApply()
|
||||
},
|
||||
amount.asset().value());
|
||||
!isTesSuccess(ret))
|
||||
{
|
||||
return ret; // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
|
||||
// increment owner count
|
||||
@@ -837,10 +839,8 @@ escrowUnlockApplyHelper<Issue>(
|
||||
bool const receiverIssuer = issuer == receiver;
|
||||
bool const issuerHigh = issuer > receiver;
|
||||
|
||||
// LCOV_EXCL_START
|
||||
if (senderIssuer)
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (receiverIssuer)
|
||||
return tesSUCCESS;
|
||||
@@ -1057,6 +1057,9 @@ EscrowFinish::doApply()
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is old code that needs to stay to support replaying old ledgers,
|
||||
// but does not need to be covered by new tests.
|
||||
// LCOV_EXCL_START
|
||||
// Too soon?
|
||||
if ((*slep)[~sfFinishAfter] &&
|
||||
ctx_.view().info().parentCloseTime.time_since_epoch().count() <=
|
||||
@@ -1068,6 +1071,7 @@ EscrowFinish::doApply()
|
||||
ctx_.view().info().parentCloseTime.time_since_epoch().count() <=
|
||||
(*slep)[sfCancelAfter])
|
||||
return tecNO_PERMISSION;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Check cryptocondition fulfillment
|
||||
@@ -1082,6 +1086,7 @@ EscrowFinish::doApply()
|
||||
// simply re-run the check.
|
||||
if (cb && !any(flags & (SF_CF_INVALID | SF_CF_VALID)))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
auto const fb = ctx_.tx[~sfFulfillment];
|
||||
|
||||
if (!fb)
|
||||
@@ -1093,6 +1098,7 @@ EscrowFinish::doApply()
|
||||
flags = SF_CF_INVALID;
|
||||
|
||||
ctx_.app.getHashRouter().setFlags(id, flags);
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// If the check failed, then simply return an error
|
||||
@@ -1139,8 +1145,10 @@ EscrowFinish::doApply()
|
||||
if (!ctx_.view().dirRemove(
|
||||
keylet::ownerDir(account), page, k.key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1150,8 +1158,10 @@ EscrowFinish::doApply()
|
||||
if (!ctx_.view().dirRemove(
|
||||
keylet::ownerDir(destID), *optPage, k.key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from recipient.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1193,8 +1203,10 @@ EscrowFinish::doApply()
|
||||
if (!ctx_.view().dirRemove(
|
||||
keylet::ownerDir(issuer), *optPage, k.key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from recipient.";
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1338,11 +1350,15 @@ EscrowCancel::doApply()
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is old code that needs to stay to support replaying old ledgers,
|
||||
// but does not need to be covered by new tests.
|
||||
// LCOV_EXCL_START
|
||||
// Too soon?
|
||||
if (!(*slep)[~sfCancelAfter] ||
|
||||
ctx_.view().info().parentCloseTime.time_since_epoch().count() <=
|
||||
(*slep)[sfCancelAfter])
|
||||
return tecNO_PERMISSION;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
AccountID const account = (*slep)[sfAccount];
|
||||
@@ -1353,8 +1369,10 @@ EscrowCancel::doApply()
|
||||
if (!ctx_.view().dirRemove(
|
||||
keylet::ownerDir(account), page, k.key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1367,8 +1385,10 @@ EscrowCancel::doApply()
|
||||
k.key,
|
||||
true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from recipient.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1409,8 +1429,10 @@ EscrowCancel::doApply()
|
||||
if (!ctx_.view().dirRemove(
|
||||
keylet::ownerDir(issuer), *optPage, k.key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete Escrow from recipient.";
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ LedgerStateFix::preclaim(PreclaimContext const& ctx)
|
||||
}
|
||||
|
||||
// preflight is supposed to verify that only valid FixTypes get to preclaim.
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
TER
|
||||
@@ -83,7 +83,7 @@ LedgerStateFix::doApply()
|
||||
}
|
||||
|
||||
// preflight is supposed to verify that only valid FixTypes get to doApply.
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -75,7 +75,7 @@ MPTokenAuthorize::preclaim(PreclaimContext const& ctx)
|
||||
auto const sleMptIssuance = ctx.view.read(
|
||||
keylet::mptIssuance(ctx.tx[sfMPTokenIssuanceID]));
|
||||
if (!sleMptIssuance)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
return tecHAS_OBLIGATIONS;
|
||||
}
|
||||
|
||||
@@ -66,11 +66,11 @@ MPTokenIssuanceDestroy::doApply()
|
||||
auto const mpt =
|
||||
view().peek(keylet::mptIssuance(ctx_.tx[sfMPTokenIssuanceID]));
|
||||
if (account_ != mpt->getAccountID(sfIssuer))
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (!view().dirRemove(
|
||||
keylet::ownerDir(account_), (*mpt)[sfOwnerNode], mpt->key(), false))
|
||||
return tefBAD_LEDGER;
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
|
||||
view().erase(mpt);
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ MPTokenIssuanceSet::doApply()
|
||||
sle = view().peek(keylet::mptIssuance(mptIssuanceID));
|
||||
|
||||
if (!sle)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const flagsIn = sle->getFieldU32(sfFlags);
|
||||
std::uint32_t flagsOut = flagsIn;
|
||||
|
||||
@@ -356,7 +356,7 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx)
|
||||
auto const& offer = bo ? bo : so;
|
||||
if (!offer)
|
||||
// Purely defensive, should be caught in preflight.
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const& tokenID = offer->at(sfNFTokenID);
|
||||
auto const& amount = offer->at(sfAmount);
|
||||
@@ -428,7 +428,7 @@ NFTokenAcceptOffer::transferNFToken(
|
||||
auto tokenAndPage = nft::findTokenAndPage(view(), seller, nftokenID);
|
||||
|
||||
if (!tokenAndPage)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (auto const ret = nft::removeToken(
|
||||
view(), seller, nftokenID, std::move(tokenAndPage->page));
|
||||
@@ -437,7 +437,7 @@ NFTokenAcceptOffer::transferNFToken(
|
||||
|
||||
auto const sleBuyer = view().read(keylet::account(buyer));
|
||||
if (!sleBuyer)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const buyerOwnerCountBefore =
|
||||
sleBuyer->getFieldU32(sfOwnerCount);
|
||||
@@ -523,16 +523,20 @@ NFTokenAcceptOffer::doApply()
|
||||
|
||||
if (bo && !nft::deleteTokenOffer(view(), bo))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete buy offer '"
|
||||
<< to_string(bo->key()) << "': ignoring";
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
if (so && !nft::deleteTokenOffer(view(), so))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete sell offer '"
|
||||
<< to_string(so->key()) << "': ignoring";
|
||||
return tecINTERNAL;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Bridging two different offers
|
||||
@@ -603,7 +607,7 @@ NFTokenAcceptOffer::doApply()
|
||||
if (so)
|
||||
return acceptOffer(so);
|
||||
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
@@ -101,9 +101,11 @@ NFTokenCancelOffer::doApply()
|
||||
if (auto offer = view().peek(keylet::nftoffer(id));
|
||||
offer && !nft::deleteTokenOffer(view(), offer))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal()) << "Unable to delete token offer " << id
|
||||
<< " (ledger " << view().seq() << ")";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ NFTokenMint::doApply()
|
||||
|
||||
if (nfTokenTemplate == nullptr)
|
||||
// Should never happen.
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const nftokenID = createNFTokenID(
|
||||
extractNFTokenFlagsFromTxFlags(ctx_.tx.getFlags()),
|
||||
|
||||
@@ -1046,7 +1046,7 @@ tokenOfferCreateApply(
|
||||
keylet::ownerDir(acctID), offerID, describeOwnerDir(acctID));
|
||||
|
||||
if (!ownerNode)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
bool const isSellOffer = txFlags & tfSellNFToken;
|
||||
|
||||
@@ -1063,7 +1063,7 @@ tokenOfferCreateApply(
|
||||
});
|
||||
|
||||
if (!offerNode)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t sleFlags = 0;
|
||||
|
||||
|
||||
@@ -126,9 +126,11 @@ closeChannel(
|
||||
auto const page = (*slep)[sfOwnerNode];
|
||||
if (!view.dirRemove(keylet::ownerDir(src), page, key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal())
|
||||
<< "Could not remove paychan from src owner directory";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,16 +141,18 @@ closeChannel(
|
||||
auto const dst = (*slep)[sfDestination];
|
||||
if (!view.dirRemove(keylet::ownerDir(dst), *page, key, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal())
|
||||
<< "Could not remove paychan from dst owner directory";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer amount back to owner, decrement owner count
|
||||
auto const sle = view.peek(keylet::account(src));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
XRPL_ASSERT(
|
||||
(*slep)[sfAmount] >= (*slep)[sfBalance],
|
||||
@@ -257,7 +261,7 @@ PayChanCreate::doApply()
|
||||
auto const account = ctx_.tx[sfAccount];
|
||||
auto const sle = ctx_.view().peek(keylet::account(account));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (ctx_.view().rules().enabled(fixPayChanCancelAfter))
|
||||
{
|
||||
@@ -301,7 +305,7 @@ PayChanCreate::doApply()
|
||||
payChanKeylet,
|
||||
describeOwnerDir(account));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*slep)[sfOwnerNode] = *page;
|
||||
}
|
||||
|
||||
@@ -311,7 +315,7 @@ PayChanCreate::doApply()
|
||||
auto const page = ctx_.view().dirInsert(
|
||||
keylet::ownerDir(dst), payChanKeylet, describeOwnerDir(dst));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*slep)[sfDestinationNode] = *page;
|
||||
}
|
||||
|
||||
@@ -389,7 +393,7 @@ PayChanFund::doApply()
|
||||
|
||||
auto const sle = ctx_.view().peek(keylet::account(txAccount));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
{
|
||||
// Check reserve and funds availability
|
||||
|
||||
@@ -632,7 +632,7 @@ Payment::doApply()
|
||||
|
||||
auto const sleSrc = view().peek(keylet::account(account_));
|
||||
if (!sleSrc)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// ownerCount is the number of entries in this ledger for this
|
||||
// account that require a reserve.
|
||||
|
||||
@@ -66,9 +66,11 @@ PermissionedDomainDelete::doApply()
|
||||
|
||||
if (!view().dirRemove(keylet::ownerDir(account_), page, slePd->key(), true))
|
||||
{
|
||||
JLOG(j_.fatal()) // LCOV_EXCL_LINE
|
||||
<< "Unable to delete permissioned domain directory entry."; // LCOV_EXCL_LINE
|
||||
return tefBAD_LEDGER; // LCOV_EXCL_LINE
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j_.fatal())
|
||||
<< "Unable to delete permissioned domain directory entry.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto const ownerSle = view().peek(keylet::account(account_));
|
||||
|
||||
@@ -311,7 +311,7 @@ SetAccount::doApply()
|
||||
{
|
||||
auto const sle = view().peek(keylet::account(account_));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const uFlagsIn = sle->getFieldU32(sfFlags);
|
||||
std::uint32_t uFlagsOut = uFlagsIn;
|
||||
|
||||
@@ -66,7 +66,7 @@ SetRegularKey::doApply()
|
||||
{
|
||||
auto const sle = view().peek(keylet::account(account_));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (!minimumFee(ctx_.app, ctx_.baseFee, view().fees(), view().flags()))
|
||||
sle->setFlag(lsfPasswordSpent);
|
||||
|
||||
@@ -226,8 +226,10 @@ removeSignersFromLedger(
|
||||
|
||||
if (!view.dirRemove(ownerDirKeylet, hint, signerListKeylet.key, false))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Unable to delete SignerList from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
adjustOwnerCount(
|
||||
@@ -349,7 +351,7 @@ SetSignerList::replaceSignerList()
|
||||
|
||||
auto const sle = view().peek(accountKeylet);
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Compute new reserve. Verify the account has funds to meet the reserve.
|
||||
std::uint32_t const oldOwnerCount{(*sle)[sfOwnerCount]};
|
||||
@@ -387,7 +389,7 @@ SetSignerList::replaceSignerList()
|
||||
<< ": " << (page ? "success" : "failure");
|
||||
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
|
||||
signerList->setFieldU64(sfOwnerNode, *page);
|
||||
|
||||
@@ -405,7 +407,7 @@ SetSignerList::destroySignerList()
|
||||
// is enabled or there is a regular key.
|
||||
SLE::pointer ledgerEntry = view().peek(accountKeylet);
|
||||
if (!ledgerEntry)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if ((ledgerEntry->isFlag(lsfDisableMaster)) &&
|
||||
(!ledgerEntry->isFieldPresent(sfRegularKey)))
|
||||
|
||||
@@ -377,7 +377,7 @@ SetTrust::doApply()
|
||||
|
||||
auto const sle = view().peek(keylet::account(account_));
|
||||
if (!sle)
|
||||
return tefINTERNAL;
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const uOwnerCount = sle->getFieldU32(sfOwnerCount);
|
||||
|
||||
|
||||
@@ -571,15 +571,19 @@ Transactor::ticketDelete(
|
||||
SLE::pointer const sleTicket = view.peek(keylet::ticket(ticketIndex));
|
||||
if (!sleTicket)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Ticket disappeared from ledger.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
std::uint64_t const page{(*sleTicket)[sfOwnerNode]};
|
||||
if (!view.dirRemove(keylet::ownerDir(account), page, ticketIndex, true))
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Unable to delete Ticket from owner.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Update the account root's TicketCount. If the ticket count drops to
|
||||
@@ -587,8 +591,10 @@ Transactor::ticketDelete(
|
||||
auto sleAccount = view.peek(keylet::account(account));
|
||||
if (!sleAccount)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "Could not find Ticket owner account root.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
if (auto ticketCount = (*sleAccount)[~sfTicketCount])
|
||||
@@ -600,8 +606,10 @@ Transactor::ticketDelete(
|
||||
}
|
||||
else
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
JLOG(j.fatal()) << "TicketCount field missing from account root.";
|
||||
return tefBAD_LEDGER;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
// Update the Ticket owner's reserve.
|
||||
|
||||
@@ -444,7 +444,7 @@ transferHelper(
|
||||
auto const sleSrc = psb.peek(keylet::account(src));
|
||||
XRPL_ASSERT(sleSrc, "ripple::transferHelper : non-null source account");
|
||||
if (!sleSrc)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
{
|
||||
auto const ownerCount = sleSrc->getFieldU32(sfOwnerCount);
|
||||
@@ -714,7 +714,7 @@ finalizeClaimHelper(
|
||||
}
|
||||
|
||||
if (distributed > rewardPool)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
return tesSUCCESS;
|
||||
}();
|
||||
@@ -1152,7 +1152,7 @@ applyCreateAccountAttestations(
|
||||
// subsequent claim ids
|
||||
auto const sleBridge = psb.peek(bridgeK);
|
||||
if (!sleBridge)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
(*sleBridge)[sfXChainAccountClaimCount] = attBegin->createCount;
|
||||
psb.update(sleBridge);
|
||||
}
|
||||
@@ -1172,12 +1172,12 @@ applyCreateAccountAttestations(
|
||||
claimIDKeylet,
|
||||
describeOwnerDir(doorAccount));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*createdSleClaimID)[sfOwnerNode] = *page;
|
||||
|
||||
auto const sleDoor = psb.peek(doorK);
|
||||
if (!sleDoor)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
// Reserve was already checked
|
||||
adjustOwnerCount(psb, sleDoor, 1, j);
|
||||
@@ -1242,8 +1242,9 @@ TER
|
||||
attestationPreclaim(PreclaimContext const& ctx)
|
||||
{
|
||||
auto const att = toClaim<TAttestation>(ctx.tx);
|
||||
// checked in preflight
|
||||
if (!att)
|
||||
return tecINTERNAL; // checked in preflight
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
STXChainBridge const bridgeSpec = ctx.tx[sfXChainBridge];
|
||||
auto const sleBridge = readBridge(ctx.view, bridgeSpec);
|
||||
@@ -1274,7 +1275,7 @@ attestationDoApply(ApplyContext& ctx)
|
||||
auto const att = toClaim<TAttestation>(ctx.tx);
|
||||
if (!att)
|
||||
// Should already be checked in preflight
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
STXChainBridge const bridgeSpec = ctx.tx[sfXChainBridge];
|
||||
|
||||
@@ -1505,7 +1506,7 @@ XChainCreateBridge::doApply()
|
||||
|
||||
auto const sleAcct = ctx_.view().peek(keylet::account(account));
|
||||
if (!sleAcct)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
STXChainBridge::ChainType const chainType =
|
||||
STXChainBridge::srcChain(account == bridgeSpec.lockingChainDoor());
|
||||
@@ -1527,7 +1528,7 @@ XChainCreateBridge::doApply()
|
||||
auto const page = ctx_.view().dirInsert(
|
||||
keylet::ownerDir(account), bridgeKeylet, describeOwnerDir(account));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*sleBridge)[sfOwnerNode] = *page;
|
||||
}
|
||||
|
||||
@@ -1620,7 +1621,7 @@ BridgeModify::doApply()
|
||||
|
||||
auto const sleAcct = ctx_.view().peek(keylet::account(account));
|
||||
if (!sleAcct)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
STXChainBridge::ChainType const chainType =
|
||||
STXChainBridge::srcChain(account == bridgeSpec.lockingChainDoor());
|
||||
@@ -1628,7 +1629,7 @@ BridgeModify::doApply()
|
||||
auto const sleBridge =
|
||||
ctx_.view().peek(keylet::bridge(bridgeSpec, chainType));
|
||||
if (!sleBridge)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
if (reward)
|
||||
(*sleBridge)[sfSignatureReward] = *reward;
|
||||
@@ -1691,7 +1692,7 @@ XChainClaim::preclaim(PreclaimContext const& ctx)
|
||||
else if (thisDoor == bridgeSpec.issuingChainDoor())
|
||||
isLockingChain = false;
|
||||
else
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1715,7 +1716,7 @@ XChainClaim::preclaim(PreclaimContext const& ctx)
|
||||
// Should have been caught when creating the bridge
|
||||
// Detect here so `otherChainAmount` doesn't switch from IOU -> XRP
|
||||
// and the numeric issues that need to be addressed with that.
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
auto const otherChainAmount = [&]() -> STAmount {
|
||||
@@ -1921,7 +1922,7 @@ XChainCommit::preclaim(PreclaimContext const& ctx)
|
||||
else if (thisDoor == bridgeSpec.issuingChainDoor())
|
||||
isLockingChain = false;
|
||||
else
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
if (isLockingChain)
|
||||
@@ -1948,11 +1949,11 @@ XChainCommit::doApply()
|
||||
auto const bridgeSpec = ctx_.tx[sfXChainBridge];
|
||||
|
||||
if (!psb.read(keylet::account(account)))
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const sleBridge = readBridge(psb, bridgeSpec);
|
||||
if (!sleBridge)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const dst = (*sleBridge)[sfAccount];
|
||||
|
||||
@@ -2040,21 +2041,27 @@ XChainCreateClaimID::doApply()
|
||||
|
||||
auto const sleAcct = ctx_.view().peek(keylet::account(account));
|
||||
if (!sleAcct)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const sleBridge = peekBridge(ctx_.view(), bridgeSpec);
|
||||
if (!sleBridge)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
std::uint32_t const claimID = (*sleBridge)[sfXChainClaimID] + 1;
|
||||
if (claimID == 0)
|
||||
return tecINTERNAL; // overflow
|
||||
{
|
||||
// overflow
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
(*sleBridge)[sfXChainClaimID] = claimID;
|
||||
|
||||
Keylet const claimIDKeylet = keylet::xChainClaimID(bridgeSpec, claimID);
|
||||
if (ctx_.view().exists(claimIDKeylet))
|
||||
return tecINTERNAL; // already checked out!?!
|
||||
{
|
||||
// already checked out!?!
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
auto const sleClaimID = std::make_shared<SLE>(claimIDKeylet);
|
||||
|
||||
@@ -2073,7 +2080,7 @@ XChainCreateClaimID::doApply()
|
||||
claimIDKeylet,
|
||||
describeOwnerDir(account));
|
||||
if (!page)
|
||||
return tecDIR_FULL;
|
||||
return tecDIR_FULL; // LCOV_EXCL_LINE
|
||||
(*sleClaimID)[sfOwnerNode] = *page;
|
||||
}
|
||||
|
||||
@@ -2191,7 +2198,7 @@ XChainCreateAccountCommit::preclaim(PreclaimContext const& ctx)
|
||||
else if (thisDoor == bridgeSpec.issuingChainDoor())
|
||||
srcChain = STXChainBridge::ChainType::issuing;
|
||||
else
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
STXChainBridge::ChainType const dstChain =
|
||||
STXChainBridge::otherChain(srcChain);
|
||||
@@ -2217,11 +2224,11 @@ XChainCreateAccountCommit::doApply()
|
||||
|
||||
auto const sle = psb.peek(keylet::account(account));
|
||||
if (!sle)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const sleBridge = peekBridge(psb, bridge);
|
||||
if (!sleBridge)
|
||||
return tecINTERNAL;
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
|
||||
auto const dst = (*sleBridge)[sfAccount];
|
||||
|
||||
|
||||
@@ -507,10 +507,12 @@ ServerHandler::processSession(
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
jr[jss::result] = RPC::make_error(rpcINTERNAL);
|
||||
JLOG(m_journal.error())
|
||||
<< "Exception while processing WS: " << ex.what() << "\n"
|
||||
<< "Input JSON: " << Json::Compact{Json::Value{jv}};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
is->getConsumer().charge(loadType);
|
||||
@@ -904,10 +906,12 @@ ServerHandler::processRequest(
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
result = RPC::make_error(rpcINTERNAL);
|
||||
JLOG(m_journal.error()) << "Internal error : " << ex.what()
|
||||
<< " when processing request: "
|
||||
<< Json::Compact{Json::Value{params}};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
@@ -94,9 +94,11 @@ doChannelAuthorize(RPC::JsonContext& context)
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
result = RPC::make_error(
|
||||
rpcINTERNAL,
|
||||
"Exception occurred during signing: " + std::string(ex.what()));
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ doRandom(RPC::JsonContext& context)
|
||||
}
|
||||
catch (std::exception const&)
|
||||
{
|
||||
return rpcError(rpcINTERNAL);
|
||||
return rpcError(rpcINTERNAL); // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user