[still WIP] make more progress

This commit is contained in:
Mayukha Vadari
2026-06-29 12:37:31 -04:00
parent 0eb721ee88
commit 5512a7bdcd
7 changed files with 63 additions and 51 deletions

View File

@@ -398,7 +398,7 @@ public:
emptyDirDelete(Keylet const& directory);
};
struct ReserveTxContext
struct ReserveContext
{
AccountID const accountID;
SLE::pointer accountSle;
@@ -411,7 +411,7 @@ struct ReserveTxContext
{
XRPL_ASSERT(
sponsorID.has_value() == !!sponsorSle,
"ReserveTxContext::isSponsored : sponsor existence matches sponsorSle existence");
"ReserveContext::isSponsored : sponsor existence matches sponsorSle existence");
return sponsorID.has_value();
}
@@ -421,8 +421,8 @@ struct ReserveTxContext
return !!sponsorshipSle;
}
static ReserveTxContext
make(ApplyView& view, STTx const& tx)
static ReserveContext
makeFromTx(ApplyView& view, STTx const& tx)
{
auto const account = tx[sfAccount];
auto const sponsor = tx[~sfSponsor];
@@ -435,13 +435,16 @@ struct ReserveTxContext
sponsor ? view.peek(keylet::sponsorship(*sponsor, account)) : nullptr,
};
}
static ReserveContext
makeFromObject(ApplyView& view, SLE::ref objectSle, SLE::pointer ownerSle);
};
struct ApplyViewContext
{
ApplyView& view;
STTx const& tx;
ReserveTxContext reserveContext;
ReserveContext reserveContext;
};
namespace directory {

View File

@@ -88,24 +88,11 @@ adjustOwnerCount(
void
adjustOwnerCountObj(
ApplyView& view,
SLE::ref accountSle,
ApplyViewContext& ctx,
SLE::ref objectSle,
std::int32_t amount,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()});
inline void
adjustOwnerCountObj(
ApplyView& view,
AccountID const& account,
SLE::ref objectSle,
std::int32_t amount,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
{
SLE::ref accountSle = view.peek(keylet::account(account));
adjustOwnerCountObj(view, accountSle, objectSle, amount, j);
}
/** Returns IOU issuer transfer fee as Rate. Rate specifies
* the fee as fractions of 1 billion. For example, 1% transfer rate
* is represented as 1,010,000,000.

View File

@@ -21,6 +21,6 @@ namespace xrpl {
*/
// [[nodiscard]] // nodiscard commented out so Flow, BookTip and others compile.
TER
offerDelete(ApplyView& view, SLE::ref sle, beast::Journal j);
offerDelete(ApplyViewContext& ctx, SLE::ref sle, beast::Journal j);
} // namespace xrpl