Merge branch 'ripple/wasmi-host-functions' of https://github.com/XRPLF/rippled into ripple/se/fees

This commit is contained in:
Mayukha Vadari
2026-04-08 13:51:41 -04:00
223 changed files with 34897 additions and 4228 deletions

View File

@@ -3206,10 +3206,15 @@ NetworkOPsImp::transJson(
auto const amount = transaction->getFieldAmount(sfTakerGets);
// If the offer create is not self funded then add the owner balance
if (account != amount.issue().account)
if (account != amount.getIssuer())
{
auto const ownerFunds = accountFunds(
*ledger, account, amount, fhIGNORE_FREEZE, registry_.get().getJournal("View"));
*ledger,
account,
amount,
fhIGNORE_FREEZE,
ahIGNORE_AUTH,
registry_.get().getJournal("View"));
jvObj[jss::transaction][jss::owner_funds] = ownerFunds.getText();
}
}
@@ -4306,7 +4311,7 @@ NetworkOPsImp::getBookPage(
ReadView const& view = *lpLedger;
bool const bGlobalFreeze =
isGlobalFrozen(view, book.out.account) || isGlobalFrozen(view, book.in.account);
isGlobalFrozen(view, book.out.getIssuer()) || isGlobalFrozen(view, book.in.getIssuer());
bool bDone = false;
bool bDirectAdvance = true;
@@ -4316,7 +4321,7 @@ NetworkOPsImp::getBookPage(
unsigned int uBookEntry = 0;
STAmount saDirRate;
auto const rate = transferRate(view, book.out.account);
auto const rate = transferRate(view, book.out.getIssuer());
auto viewJ = registry_.get().getJournal("View");
while (!bDone && iLimit-- > 0)
@@ -4366,7 +4371,7 @@ NetworkOPsImp::getBookPage(
STAmount saOwnerFunds;
bool firstOwnerOffer(true);
if (book.out.account == uOfferOwnerID)
if (book.out.getIssuer() == uOfferOwnerID)
{
// If an offer is selling issuer's own IOUs, it is fully
// funded.
@@ -4395,9 +4400,9 @@ NetworkOPsImp::getBookPage(
saOwnerFunds = accountHolds(
view,
uOfferOwnerID,
book.out.currency,
book.out.account,
book.out,
fhZERO_IF_FROZEN,
ahZERO_IF_UNAUTHORIZED,
viewJ);
if (saOwnerFunds < beast::zero)
@@ -4417,9 +4422,9 @@ NetworkOPsImp::getBookPage(
if (rate != parityRate
// Have a transfer fee.
&& uTakerID != book.out.account
&& uTakerID != book.out.getIssuer()
// Not taking offers of own IOUs.
&& book.out.account != uOfferOwnerID)
&& book.out.getIssuer() != uOfferOwnerID)
// Offer owner not issuing ownfunds
{
// Need to charge a transfer fee to offer owner.
@@ -4440,7 +4445,7 @@ NetworkOPsImp::getBookPage(
saTakerGetsFunded.setJson(jvOffer[jss::taker_gets_funded]);
std::min(
saTakerPays, multiply(saTakerGetsFunded, saDirRate, saTakerPays.issue()))
saTakerPays, multiply(saTakerGetsFunded, saDirRate, saTakerPays.asset()))
.setJson(jvOffer[jss::taker_pays_funded]);
}
@@ -4584,7 +4589,7 @@ NetworkOPsImp::getBookPage(
// TODO(tom): The result of this expression is not used - what's
// going on here?
std::min(saTakerPays, multiply(saTakerGetsFunded, saDirRate, saTakerPays.issue()))
std::min(saTakerPays, multiply(saTakerGetsFunded, saDirRate, saTakerPays.asset()))
.setJson(jvOffer[jss::taker_pays_funded]);
}