Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Dec 18, 2024
1 parent d696011 commit b96883f
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 33 deletions.
8 changes: 4 additions & 4 deletions include/xrpl/protocol/AmountConversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace ripple {
inline STAmount
toSTAmount(IOUAmount const& iou, Asset const& iss)
{
ASSERT(iss.holds<Issue>(), "ripple::toSTAmount : is Issue");
XRPL_ASSERT(iss.holds<Issue>(), "ripple::toSTAmount : is Issue");
bool const isNeg = iou.signum() < 0;
std::uint64_t const umant = isNeg ? -iou.mantissa() : iou.mantissa();
return STAmount(iss, umant, iou.exponent(), isNeg, STAmount::unchecked());
Expand All @@ -55,7 +55,7 @@ toSTAmount(XRPAmount const& xrp)
inline STAmount
toSTAmount(XRPAmount const& xrp, Asset const& iss)
{
ASSERT(isXRP(iss), "ripple::toSTAmount : is XRP");
XRPL_ASSERT(isXRP(iss), "ripple::toSTAmount : is XRP");
return toSTAmount(xrp);
}

Expand All @@ -68,7 +68,7 @@ toSTAmount(MPTAmount const& mpt)
inline STAmount
toSTAmount(MPTAmount const& mpt, Asset const& iss)
{
ASSERT(iss.holds<MPTIssue>(), "ripple::toSTAmount : is MPT");
XRPL_ASSERT(iss.holds<MPTIssue>(), "ripple::toSTAmount : is MPT");
return STAmount(mpt, iss.get<MPTIssue>());
}

Expand Down Expand Up @@ -117,7 +117,7 @@ template <>
inline MPTAmount
toAmount<MPTAmount>(STAmount const& amt)
{
ASSERT(
XRPL_ASSERT(
amt.holds<MPTIssue>() && amt.mantissa() <= maxMPTokenAmount,
"ripple::toAmount<MPTAmount> : maximum mantissa");
bool const isNeg = amt.negative();
Expand Down
4 changes: 2 additions & 2 deletions src/libxrpl/protocol/STPathSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ STPathSet::STPathSet(SerialIter& sit, SField const& name) : STBase(name)
if (hasAccount)
account = sit.get160();

ASSERT(
XRPL_ASSERT(
!(hasCurrency && hasMPT),
"ripple::STPathSet::STPathSet : not has Currency and MPT");
if (hasCurrency)
Expand Down Expand Up @@ -195,7 +195,7 @@ STPath::getJson(JsonOptions) const
if (iType & STPathElement::typeAccount)
elem[jss::account] = to_string(it.getAccountID());

ASSERT(
XRPL_ASSERT(
!(iType & STPathElement::typeCurrency &&
iType & STPathElement::typeMPT),
"ripple::STPath::getJson : not type Currency and MPT");
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/app/misc/detail/MPTUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ isMPTAllowed(
auto const allMPTTx = ammTx || txType == ttOFFER_CREATE ||
txType == ttCHECK_CREATE || txType == ttCHECK_CASH ||
txType == ttPAYMENT;
ASSERT(allMPTTx || isDEX, "ripple::isMPTAllowed : all MPT tx or DEX");
XRPL_ASSERT(allMPTTx || isDEX, "ripple::isMPTAllowed : all MPT tx or DEX");

auto const issuanceKey = keylet::mptIssuance(issuanceID);
auto const issuanceSle = view.read(issuanceKey);
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/app/paths/detail/DirectStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ DirectStepI<TDerived>::validFwd(

auto const savCache = *cache_;

XRPL_ASSERT(!in.native, "ripple::DirectStepI::validFwd : input is not XRP");
XRPL_ASSERT(!in.native(), "ripple::DirectStepI::validFwd : input is not XRP");

auto const [maxSrcToDst, srcDebtDir] =
static_cast<TDerived const*>(this)->maxFlow(sb, cache_->srcToDst);
Expand Down
8 changes: 4 additions & 4 deletions src/xrpld/app/paths/detail/MPTEndpointStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ MPTEndpointStep<TDerived>::revImp(

auto const [srcQOut, dstQIn] =
qualities(sb, srcDebtDir, StrandDirection::reverse);
ASSERT(
XRPL_ASSERT(
static_cast<TDerived const*>(this)->verifyDstQualityIn(dstQIn),
"MPTEndpointStep<TDerived>::revImp : verify dst quaity in");

Expand Down Expand Up @@ -634,7 +634,7 @@ MPTEndpointStep<TDerived>::fwdImp(
boost::container::flat_set<uint256>& /*ofrsToRm*/,
MPTAmount const& in)
{
ASSERT(cache_, "MPTEndpointStep<TDerived>::fwdImp : valid cache");
XRPL_ASSERT(cache_, "MPTEndpointStep<TDerived>::fwdImp : valid cache");

auto const [maxSrcToDst, srcDebtDir] =
static_cast<TDerived const*>(this)->maxFlow(sb, cache_->srcToDst);
Expand Down Expand Up @@ -723,7 +723,7 @@ MPTEndpointStep<TDerived>::validFwd(

auto const savCache = *cache_;

ASSERT(
XRPL_ASSERT(
!in.native() && !in.isIOU(),
"MPTEndpoint<TDerived>::validFwd : not XRP or IOU");

Expand Down Expand Up @@ -789,7 +789,7 @@ MPTEndpointStep<TDerived>::qualitiesSrcIssues(
{
// Charge a transfer rate when issuing and previous step redeems

ASSERT(
XRPL_ASSERT(
static_cast<TDerived const*>(this)->verifyPrevStepDebtDirection(
prevStepDebtDirection),
"MPTEndpointStep<TDerived>::qualitiesSrcIssues : verify prev step debt "
Expand Down
3 changes: 1 addition & 2 deletions src/xrpld/app/tx/detail/AMMBid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ AMMBid::preflight(PreflightContext const& ctx)
return temINVALID_FLAG;
}

if (auto const res = invalidAMMAssetPair(
ctx.tx[sfAsset].get<Issue>(), ctx.tx[sfAsset2].get<Issue>()))
if (auto const res = invalidAMMAssetPair(ctx.tx[sfAsset], ctx.tx[sfAsset2]))
{
JLOG(ctx.j.debug()) << "AMM Bid: Invalid asset pair.";
return res;
Expand Down
6 changes: 3 additions & 3 deletions src/xrpld/app/tx/detail/AMMClawback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ AMMClawback::preflight(PreflightContext const& ctx)
return temMALFORMED;
}

if (clawAmount && clawAmount->get<Issue>() != asset)
if (clawAmount && clawAmount->issue() != asset)
{
JLOG(ctx.j.trace()) << "AMMClawback: Amount's issuer/currency subfield "
"does not match Asset field";
Expand All @@ -99,8 +99,8 @@ AMMClawback::preflight(PreflightContext const& ctx)
TER
AMMClawback::preclaim(PreclaimContext const& ctx)
{
auto const asset = ctx.tx[sfAsset].get<Issue>();
auto const asset2 = ctx.tx[sfAsset2].get<Issue>();
auto const asset = ctx.tx[sfAsset];
auto const asset2 = ctx.tx[sfAsset2];
auto const sleIssuer = ctx.view.read(keylet::account(ctx.tx[sfAccount]));
if (!sleIssuer)
return terNO_ACCOUNT; // LCOV_EXCL_LINE
Expand Down
4 changes: 2 additions & 2 deletions src/xrpld/app/tx/detail/AMMDelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ AMMDelete::doApply()
// as we go on processing transactions.
Sandbox sb(&ctx_.view());

auto const ter = deleteAMMAccount(
sb, ctx_.tx[sfAsset].get<Issue>(), ctx_.tx[sfAsset2].get<Issue>(), j_);
auto const ter =
deleteAMMAccount(sb, ctx_.tx[sfAsset], ctx_.tx[sfAsset2], j_);
if (ter == tesSUCCESS || ter == tecINCOMPLETE)
sb.apply(ctx_.rawView());

Expand Down
8 changes: 4 additions & 4 deletions src/xrpld/app/tx/detail/AMMDeposit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ AMMDeposit::preflight(PreflightContext const& ctx)
return temMALFORMED;
}

auto const asset = ctx.tx[sfAsset].get<Issue>();
auto const asset2 = ctx.tx[sfAsset2].get<Issue>();
auto const asset = ctx.tx[sfAsset];
auto const asset2 = ctx.tx[sfAsset2];
if (auto const res = invalidAMMAssetPair(asset, asset2))
{
JLOG(ctx.j.debug()) << "AMM Deposit: invalid asset pair.";
Expand Down Expand Up @@ -279,10 +279,10 @@ AMMDeposit::preclaim(PreclaimContext const& ctx)
return tesSUCCESS;
};

if (auto const ter = checkAsset(ctx.tx[sfAsset].get<Issue>()))
if (auto const ter = checkAsset(ctx.tx[sfAsset]))
return ter;

if (auto const ter = checkAsset(ctx.tx[sfAsset2].get<Issue>()))
if (auto const ter = checkAsset(ctx.tx[sfAsset2]))
return ter;
}

Expand Down
3 changes: 1 addition & 2 deletions src/xrpld/app/tx/detail/AMMVote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ AMMVote::preflight(PreflightContext const& ctx)
if (auto const ret = preflight1(ctx); !isTesSuccess(ret))
return ret;

if (auto const res = invalidAMMAssetPair(
ctx.tx[sfAsset].get<Issue>(), ctx.tx[sfAsset2].get<Issue>()))
if (auto const res = invalidAMMAssetPair(ctx.tx[sfAsset], ctx.tx[sfAsset2]))
{
JLOG(ctx.j.debug()) << "AMM Vote: invalid asset pair.";
return res;
Expand Down
11 changes: 3 additions & 8 deletions src/xrpld/app/tx/detail/AMMWithdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ AMMWithdraw::preflight(PreflightContext const& ctx)
return temMALFORMED;
}

auto const asset = ctx.tx[sfAsset].get<Issue>();
auto const asset2 = ctx.tx[sfAsset2].get<Issue>();
auto const asset = ctx.tx[sfAsset];
auto const asset2 = ctx.tx[sfAsset2];
if (auto const res = invalidAMMAssetPair(asset, asset2))
{
JLOG(ctx.j.debug()) << "AMM Withdraw: Invalid asset pair.";
Expand Down Expand Up @@ -441,12 +441,7 @@ AMMWithdraw::applyGuts(Sandbox& sb)
return {result, false};

auto const res = deleteAMMAccountIfEmpty(
sb,
ammSle,
newLPTokenBalance,
ctx_.tx[sfAsset].get<Issue>(),
ctx_.tx[sfAsset2].get<Issue>(),
j_);
sb, ammSle, newLPTokenBalance, ctx_.tx[sfAsset], ctx_.tx[sfAsset2], j_);
// LCOV_EXCL_START
if (!res.second)
return {res.first, false};
Expand Down

0 comments on commit b96883f

Please sign in to comment.