This commit is contained in:
Mayukha Vadari
2026-07-01 13:44:53 -04:00
parent eb6503a2c6
commit bf73446528
16 changed files with 22 additions and 32 deletions

View File

@@ -204,8 +204,7 @@ SponsorshipSet::doApply()
auto const maxFee = ctx_.tx[~sfMaxFee];
auto const remainingOwnerCount = ctx_.tx[~sfRemainingOwnerCount];
auto applyViewContext = ctx_.getApplyViewContext();
auto reserveSponsorAccSle = getTxReserveSponsor(applyViewContext);
auto reserveSponsorAccSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!reserveSponsorAccSle)
return reserveSponsorAccSle.error(); // LCOV_EXCL_LINE

View File

@@ -322,8 +322,7 @@ SignerListSet::replaceSignerList()
// We check the reserve against the starting balance because we want to
// allow dipping into the reserve to pay fees. This behavior is consistent
// with TicketCreate.
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE
if (auto const ret = checkInsufficientReserve(

View File

@@ -195,8 +195,7 @@ CheckCreate::doApply()
// A check counts against the reserve of the issuing account, but we
// check the starting balance because we want to allow dipping into the
// reserve to pay fees.
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE
if (auto const ret = checkInsufficientReserve(

View File

@@ -95,8 +95,7 @@ DelegateSet::doApply()
if (permissions.empty())
return tecINTERNAL; // LCOV_EXCL_LINE
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE
if (auto const ret = checkInsufficientReserve(

View File

@@ -178,11 +178,10 @@ EscrowCancel::doApply()
auto const issuer = amount.getIssuer();
bool const createAsset = account == accountID_;
auto applyViewContext = ctx_.getApplyViewContext();
if (auto const ret = std::visit(
[&]<typename T>(T const&) {
return escrowUnlockApplyHelper<T>(
applyViewContext,
ctx_.getApplyViewContext(),
kParityRate,
ctx_.view().rules().enabled(fixCleanup3_2_0) ? sle : slep,
preFeeBalance_,

View File

@@ -437,8 +437,7 @@ EscrowCreate::doApply()
STAmount const amount{ctx_.tx[sfAmount]};
auto const balance = sle->getFieldAmount(sfBalance).xrp();
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE
// First check: whoever is on the hook for the new owner increment

View File

@@ -362,11 +362,10 @@ EscrowFinish::doApply()
: kParityRate;
auto const issuer = amount.getIssuer();
bool const createAsset = destID == accountID_;
auto applyViewContext = ctx_.getApplyViewContext();
if (auto const ret = std::visit(
[&]<typename T>(T const&) {
return escrowUnlockApplyHelper<T>(
applyViewContext,
ctx_.getApplyViewContext(),
lockedRate,
sled,
preFeeBalance_,

View File

@@ -198,9 +198,14 @@ LoanBrokerCoverWithdraw::doApply()
associateAsset(*broker, vaultAsset);
auto applyViewContext = ctx_.getApplyViewContext();
return doWithdraw(
applyViewContext, accountID_, dstAcct, brokerPseudoID, preFeeBalance_, amount, j_);
ctx_.getApplyViewContext(),
accountID_,
dstAcct,
brokerPseudoID,
preFeeBalance_,
amount,
j_);
}
void

View File

@@ -159,8 +159,7 @@ LoanBrokerDelete::doApply()
return ter;
}
auto applyViewContext = ctx_.getApplyViewContext();
if (auto ter = removeEmptyHolding(applyViewContext, brokerPseudoID, vaultAsset, j_))
if (auto ter = removeEmptyHolding(ctx_.getApplyViewContext(), brokerPseudoID, vaultAsset, j_))
return ter;
auto brokerPseudoSLE = view().peek(keylet::account(brokerPseudoID));

View File

@@ -248,9 +248,8 @@ LoanBrokerSet::doApply()
auto& pseudo = *maybePseudo;
auto pseudoId = pseudo->at(sfAccount);
auto applyViewContext = ctx_.getApplyViewContext();
if (auto ter = addEmptyHolding(
applyViewContext, pseudoId, preFeeBalance_, sleVault->at(sfAsset), j_))
ctx_.getApplyViewContext(), pseudoId, preFeeBalance_, sleVault->at(sfAsset), j_))
return ter;
// Initialize data fields:

View File

@@ -624,9 +624,8 @@ LoanPay::doApply()
if (brokerPayee == accountID_)
{
// The broker may have deleted their holding. Recreate it if needed
auto applyViewContext = ctx_.getApplyViewContext();
if (auto const ter = addEmptyHolding(
applyViewContext,
ctx_.getApplyViewContext(),
brokerPayee,
brokerPayeeSle->at(sfBalance).value().xrp(),
asset,

View File

@@ -90,8 +90,7 @@ PaymentChannelFund::doApply()
{
// Check reserve and funds availability
auto const balance = (*sle)[sfBalance];
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE
if (auto const ret =

View File

@@ -143,9 +143,8 @@ TER
MPTokenAuthorize::doApply()
{
auto const& tx = ctx_.tx;
auto applyViewContext = ctx_.getApplyViewContext();
return authorizeMPToken(
applyViewContext,
ctx_.getApplyViewContext(),
preFeeBalance_,
tx[sfMPTokenIssuanceID],
accountID_,

View File

@@ -197,9 +197,8 @@ TER
MPTokenIssuanceCreate::doApply()
{
auto const& tx = ctx_.tx;
auto applyViewContext = ctx_.getApplyViewContext();
auto const result = create(
applyViewContext,
ctx_.getApplyViewContext(),
j_,
{
.priorBalance = preFeeBalance_,

View File

@@ -328,8 +328,7 @@ TrustSet::doApply()
// well. A person with no intention of using the gateway
// could use the extra XRP for their own purposes.
auto applyViewContext = ctx_.getApplyViewContext();
auto const sponsorSle = getTxReserveSponsor(applyViewContext);
auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext());
if (!sponsorSle)
return sponsorSle.error(); // LCOV_EXCL_LINE

View File

@@ -399,9 +399,8 @@ VaultClawback::doApply()
// Keep MPToken if holder is the vault owner.
if (holder != vault->at(sfOwner))
{
auto applyViewContext = ctx_.getApplyViewContext();
if (auto const ter =
removeEmptyHolding(applyViewContext, holder, sharesDestroyed.asset(), j_);
removeEmptyHolding(ctx_.getApplyViewContext(), holder, sharesDestroyed.asset(), j_);
isTesSuccess(ter))
{
JLOG(j_.debug()) //