mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
clang
This commit is contained in:
@@ -438,7 +438,8 @@ EscrowFinish::preflight(PreflightContext const& ctx)
|
||||
if (!ctx.tx.isFieldPresent(sfOfferSequence))
|
||||
return temMALFORMED;
|
||||
|
||||
if (ctx.tx.isFieldPresent(sfEscrowID) && ctx.tx.getFieldU32(sfOfferSequence) != 0)
|
||||
if (ctx.tx.isFieldPresent(sfEscrowID) &&
|
||||
ctx.tx.getFieldU32(sfOfferSequence) != 0)
|
||||
return temMALFORMED;
|
||||
}
|
||||
else
|
||||
@@ -720,7 +721,8 @@ EscrowCancel::preflight(PreflightContext const& ctx)
|
||||
if (!ctx.tx.isFieldPresent(sfOfferSequence))
|
||||
return temMALFORMED;
|
||||
|
||||
if (ctx.tx.isFieldPresent(sfEscrowID) && ctx.tx.getFieldU32(sfOfferSequence) != 0)
|
||||
if (ctx.tx.isFieldPresent(sfEscrowID) &&
|
||||
ctx.tx.getFieldU32(sfOfferSequence) != 0)
|
||||
return temMALFORMED;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -240,7 +240,7 @@ URIToken::preclaim(PreclaimContext const& ctx)
|
||||
if (purchaseAmount.native() && saleAmount->native())
|
||||
{
|
||||
// native transfer
|
||||
|
||||
|
||||
STAmount needed{ctx.view.fees().accountReserve(
|
||||
sle->getFieldU32(sfOwnerCount) + 1)};
|
||||
|
||||
@@ -267,16 +267,20 @@ URIToken::preclaim(PreclaimContext const& ctx)
|
||||
// iou transfer
|
||||
|
||||
STAmount availableFunds{accountFunds(
|
||||
ctx.view, acc, purchaseAmount, fhZERO_IF_FROZEN, ctx.j)};
|
||||
ctx.view,
|
||||
acc,
|
||||
purchaseAmount,
|
||||
fhZERO_IF_FROZEN,
|
||||
ctx.j)};
|
||||
|
||||
if (purchaseAmount > availableFunds)
|
||||
return tecINSUFFICIENT_FUNDS;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// old logic
|
||||
|
||||
|
||||
if (purchaseAmount.native() && saleAmount->native())
|
||||
{
|
||||
// if it's an xrp sale/purchase then no trustline needed
|
||||
@@ -288,12 +292,15 @@ URIToken::preclaim(PreclaimContext const& ctx)
|
||||
{
|
||||
// iou
|
||||
STAmount availableFunds{accountFunds(
|
||||
ctx.view, acc, purchaseAmount, fhZERO_IF_FROZEN, ctx.j)};
|
||||
ctx.view,
|
||||
acc,
|
||||
purchaseAmount,
|
||||
fhZERO_IF_FROZEN,
|
||||
ctx.j)};
|
||||
|
||||
if (purchaseAmount > availableFunds)
|
||||
return tecINSUFFICIENT_FUNDS;
|
||||
}
|
||||
|
||||
}
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
@@ -455,12 +455,8 @@ struct URIToken_test : public beast::unit_test::suite
|
||||
|
||||
// setup env
|
||||
Env env{
|
||||
*this,
|
||||
envconfig(),
|
||||
features,
|
||||
nullptr,
|
||||
beast::severities::kWarning
|
||||
//beast::severities::kTrace
|
||||
*this, envconfig(), features, nullptr, beast::severities::kWarning
|
||||
// beast::severities::kTrace
|
||||
};
|
||||
auto const alice = Account("alice");
|
||||
auto const bob = Account("bob");
|
||||
|
||||
Reference in New Issue
Block a user