From 8cfffcf5d3c34f9b0477720067e737ccbf873156 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 2 Jul 2026 00:09:30 -0400 Subject: [PATCH] fix build --- include/xrpl/ledger/helpers/EscrowHelpers.h | 6 +++--- src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp | 2 +- .../payment_channel/PaymentChannelCreate.cpp | 13 ++++--------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/xrpl/ledger/helpers/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h index 00caa9b9e0..11805cd27e 100644 --- a/include/xrpl/ledger/helpers/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -193,7 +193,7 @@ escrowUnlockApplyHelper( !isTesSuccess(ret)) return ret; - if (auto const ter = createMPToken(view, mptID, receiver, sponsorSle, 0); + if (auto const ter = createMPToken(ctx.view, mptID, receiver, sponsorSle, 0); !isTesSuccess(ter)) { return ter; // LCOV_EXCL_LINE @@ -201,8 +201,8 @@ escrowUnlockApplyHelper( // update owner count. increaseOwnerCount( - view, ReserveContext::makeFromAccount(view, sleDest, sponsorSle), 1, journal); - auto mptSle = view.peek(mptKeylet); + ctx.view, ReserveContext::makeFromAccount(ctx.view, sleDest, sponsorSle), 1, journal); + auto mptSle = ctx.view.peek(mptKeylet); addSponsorToLedgerEntry(mptSle, sponsorSle); } diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp index 73301eb37e..80fad64683 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp @@ -460,7 +460,7 @@ EscrowCreate::doApply() // - sponsored: adj=0 — sponsor covers the new owner increment, // so the source only owes its base reserve. // - unsponsored: adj=1 — source owes base + the new increment. - std::int32_t const ownerCountAdj = *sponsorSle ? 0 : 1; + std::int32_t const ownerCountAdj = sponsorSle ? 0 : 1; if (auto const ret = checkInsufficientReserve( ctx_.getApplyViewContext(), sle, diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp index 2f2e8a32eb..19f9a67c7b 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp @@ -135,14 +135,11 @@ PaymentChannelCreate::doApply() return tecEXPIRED; } - auto const sponsorSle = getTxReserveSponsor(ctx_.getApplyViewContext()); - if (!sponsorSle) - return sponsorSle.error(); // LCOV_EXCL_LINE + auto const applyViewContext = ctx_.getApplyViewContext(); + auto const sponsorSle = applyViewContext.reserveContext.sponsorSle; if (ctx_.view().rules().enabled(featureSponsor)) { - auto const applyViewContext = ctx_.getApplyViewContext(); - auto const sponsorSle = applyViewContext.reserveContext.sponsorSle; // First check: whoever is on the hook for the new owner increment // can cover it. When sponsored this hits the sponsor branch and // validates the sponsor's reserve + remaining credit. When @@ -152,7 +149,7 @@ PaymentChannelCreate::doApply() ctx_.getApplyViewContext(), sle, preFeeBalance_, - *sponsorSle, + sponsorSle, {.ownerCountDelta = 1}, j_); !isTesSuccess(ret)) @@ -166,7 +163,7 @@ PaymentChannelCreate::doApply() // - sponsored: adj=0 — sponsor covers the new owner increment, // so the source only owes its base reserve. // - unsponsored: adj=1 — source owes base + the new increment. - std::int32_t const ownerCountAdj = *sponsorSle ? 0 : 1; + std::int32_t const ownerCountAdj = sponsorSle ? 0 : 1; if (auto const ret = checkInsufficientReserve( ctx_.getApplyViewContext(), sle, @@ -225,8 +222,6 @@ PaymentChannelCreate::doApply() // Deduct owner's balance, increment owner count (*sle)[sfBalance] = (*sle)[sfBalance] - ctx_.tx[sfAmount]; - auto const applyViewContext = ctx_.getApplyViewContext(); - auto const sponsorSle = applyViewContext.reserveContext.sponsorSle; increaseOwnerCount( ctx_.view(), ReserveContext::makeFromAccount(ctx_.view(), sle, sponsorSle),