remove comments

This commit is contained in:
Denis Angell
2023-02-03 04:09:37 -05:00
committed by Richard Holland
parent 66105b6c68
commit 7d4b00cfcb

View File

@@ -63,16 +63,6 @@ inline URIOperation inferOperation(STTx const& tx)
(hasBurnableFlag ? 0b000000010U : 0) +
(blankFlags ? 0b000000001U : 0);
std::cout << "combination" << combination << "\n";
std::cout << "mint" << (0b110000001U == combination) << "\n";
std::cout << "mint" << (0b110000010U == combination) << "\n";
std::cout << "mint" << (0b010000001U == combination) << "\n";
std::cout << "mint" << (0b010000010U == combination) << "\n";
std::cout << "burn" << (0b001100000U == combination) << "\n";
std::cout << "buy" << (0b000110001U == combination) << "\n";
std::cout << "sell" << (0b000110100U == combination) << "\n";
std::cout << "sell" << (0b000111100U == combination) << "\n";
std::cout << "clear" << (0b000100001U == combination) << "\n";
switch (combination)
{
case 0b110000001U:
@@ -112,7 +102,7 @@ URIToken::preflight(PreflightContext const& ctx)
<< "documentation for how to specify Mint/Burn/Buy/Sell operations.";
return temMALFORMED;
}
JLOG(ctx.j.trace())
<< "URIToken txnid=" << ctx.tx.getTransactionID() << " inferred operation="
<< (op == URIOperation::Invalid ? "Invalid" :
@@ -291,7 +281,6 @@ URIToken::preclaim(PreclaimContext const& ctx)
default:
{
std::cout << "preclaim with URIOperation::Invalid\n " << "\n";
JLOG(ctx.j.warn())
<< "URIToken txid=" << ctx.tx.getTransactionID() << " preclaim with URIOperation::Invalid\n";
return tecINTERNAL;
@@ -332,16 +321,10 @@ URIToken::doApply()
sleU = view().peek(*kl);
if (!sleU)
{
std::cout << "no entry object" << "\n";
return tecNO_ENTRY;
}
if (sleU->getFieldU16(sfLedgerEntryType) != ltURI_TOKEN)
{
std::cout << "wrong uri token" << "\n";
return tecNO_ENTRY;
}
owner = (*sleU)[sfOwner];
issuer = (*sleU)[sfIssuer];
@@ -355,7 +338,6 @@ URIToken::doApply()
if (!sleOwner)
{
std::cout << "tecNO_ENTRY - no owner" << "\n";
JLOG(j.warn())
<< "Malformed transaction: owner of URIToken is not in the ledger.";
return tecNO_ENTRY;
@@ -468,7 +450,6 @@ URIToken::doApply()
else
{
// IOU sale
std::cout << "IOU SALE" << "\n";
STAmount availableFunds{accountFunds(
view(),
account_,
@@ -476,8 +457,6 @@ URIToken::doApply()
fhZERO_IF_FROZEN,
j)};
// std::cout << "PURCHASE AMT: " << purchaseAmount << "\n";
// std::cout << "AVAIL FUNDS: " << availableFunds << "\n";
if (purchaseAmount > availableFunds)
return tecINSUFFICIENT_FUNDS;
@@ -507,10 +486,7 @@ URIToken::doApply()
// remove from buyer
initBuyerBal = buyerLow ? ((*sleSrcLine)[sfBalance]) : -((*sleSrcLine)[sfBalance]);
// std::cout << "BUYER LOW: " << buyerLow << "\n";
// std::cout << "BUYER BAL: " << *initBuyerBal << "\n";
finBuyerBal = *initBuyerBal - purchaseAmount;
// std::cout << "FIN BUYER BAL: " << *finBuyerBal << "\n";
// compute amount to deliver
static Rate const parityRate(QUALITY_ONE);
@@ -520,25 +496,16 @@ URIToken::doApply()
? purchaseAmount
: multiplyRound(purchaseAmount, xferRate, purchaseAmount.issue(), true);
// std::cout << "SELLER LOW: " << sellerLow << "\n";
// std::cout << "DEST AMT: " << *dstAmt << "\n";
// if (!sellerLow)
// dstAmt->negate();
// std::cout << "TRUE DEST AMT: " << *dstAmt << "\n";
initSellerBal = !sleDstLine
? purchaseAmount.zeroed()
: sellerLow ? ((*sleDstLine)[sfBalance]) : -((*sleDstLine)[sfBalance]);
// std::cout << "INIT SELLER BAL: " << *initSellerBal << "\n";
finSellerBal = *initSellerBal + *dstAmt;
// std::cout << "FINAL SELLER BAL: " << *finSellerBal << "\n";
}
// sanity check balance mutations (xrp or iou, both are checked the same way now)
if (*finSellerBal < *initSellerBal)
{
std::cout << "finSellerBal" << *finSellerBal << "< initSellerBal" << *initSellerBal << "\n";
JLOG(j.warn())
<< "URIToken txid=" << ctx_.tx.getTransactionID() << " "
<< "finSellerBal < initSellerBal";
@@ -547,7 +514,6 @@ URIToken::doApply()
if (*finBuyerBal > *initBuyerBal)
{
std::cout << "finBuyerBal > initBuyerBal\n " << "\n";
JLOG(j.warn())
<< "URIToken txid=" << ctx_.tx.getTransactionID() << " "
<< "finBuyerBal > initBuyerBal";
@@ -556,7 +522,6 @@ URIToken::doApply()
if (*finBuyerBal < beast::zero)
{
std::cout << "finBuyerBal < 0\n " << "\n";
JLOG(j.warn())
<< "URIToken txid=" << ctx_.tx.getTransactionID() << " "
<< "finBuyerBal < 0";
@@ -565,7 +530,6 @@ URIToken::doApply()
if (*finSellerBal < beast::zero)
{
std::cout << "finSellerBal < 0\n " << "\n";
JLOG(j.warn())
<< "URIToken txid=" << ctx_.tx.getTransactionID() << " "
<< "finSellerBal < 0";
@@ -724,7 +688,6 @@ URIToken::doApply()
view().update(sleU);
view().update(sleOwner);
// std::cout << "BUY tecSUCCESS" << "\n";
return tesSUCCESS;
}
case URIOperation::Burn:
@@ -753,7 +716,6 @@ URIToken::doApply()
view().erase(sleU);
adjustOwnerCount(view(), sle, -1, j);
// std::cout << "BURN tecSUCCESS" << "\n";
return tesSUCCESS;
}
@@ -773,7 +735,6 @@ URIToken::doApply()
sleU->setFieldAmount(sfAmount, ctx_.tx[sfAmount]);
view().update(sleU);
// std::cout << "SELL tecSUCCESS" << "\n";
return tesSUCCESS;
}