mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-30 23:45:48 +00:00
fix various broken TxQ tests, cleanup some todos
This commit is contained in:
@@ -750,7 +750,7 @@ PayChanClaim::doApply()
|
||||
// featureDepositAuth to remove the bug.
|
||||
bool const depositAuth{ctx_.view().rules().enabled(featureDepositAuth)};
|
||||
if (!depositAuth &&
|
||||
// RH TODO: does this condition need to be changed for IOU paychans?
|
||||
chanBalance.native() &&
|
||||
(txAccount == src && (sled->getFlags() & lsfDisallowXRP)))
|
||||
return tecNO_TARGET;
|
||||
|
||||
@@ -834,4 +834,4 @@ PayChanClaim::doApply()
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
} // namespace ripple
|
||||
|
||||
@@ -140,8 +140,8 @@ validateHookParams(SetHookCtx& ctx, STArray const& hookParams)
|
||||
return false;
|
||||
}
|
||||
|
||||
// RH TODO: rippled's template system already does most of these checks, run through and
|
||||
// remove redundant template checking.
|
||||
// RH NOTE: templating system already does most of these checks but if a change is made
|
||||
// in future then they are double checked here
|
||||
bool nameFound = false;
|
||||
for (auto const& paramElement : *hookParamObj)
|
||||
{
|
||||
|
||||
@@ -73,9 +73,14 @@ LedgerHandler::check()
|
||||
{
|
||||
// Until some sane way to get full ledgers has been implemented,
|
||||
// disallow retrieving all state nodes.
|
||||
// RH TODO: recomment this for prod
|
||||
// if (!isUnlimited(context_.role))
|
||||
// return rpcNO_PERMISSION;
|
||||
|
||||
uint32_t nodeNID = ctx.app.config().NETWORK_ID;
|
||||
if (nodeNID == 21337)
|
||||
{
|
||||
// RH NOTE: production network requires rpc permission to dump full ledger
|
||||
if (!isUnlimited(context_.role))
|
||||
return rpcNO_PERMISSION;
|
||||
}
|
||||
|
||||
if (context_.app.getFeeTrack().isLoadedLocal() &&
|
||||
!isUnlimited(context_.role))
|
||||
|
||||
@@ -1964,8 +1964,7 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
env.close();
|
||||
env(finish(carol, alice, seq1), fee(1500));
|
||||
env.close();
|
||||
BEAST_EXPECT(env.balance(bob).value() == USD(5100));
|
||||
|
||||
env.require(balance("bob", USD(5100)));
|
||||
env.close();
|
||||
|
||||
// Creating an escrow without a finish time and a condition is
|
||||
@@ -1980,7 +1979,8 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
condition(cb1),
|
||||
fulfillment(fb1),
|
||||
fee(1500));
|
||||
BEAST_EXPECT(env.balance(bob).value() == USD(5200));
|
||||
env.close();
|
||||
env.require(balance("bob", USD(5200)));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -2022,7 +2022,7 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
condition(cb1),
|
||||
fulfillment(fb1),
|
||||
fee(1500));
|
||||
BEAST_EXPECT(env.balance(bob).value() == USD(5100));
|
||||
env.require(balance("bob", USD(5100)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1444,7 +1444,7 @@ public:
|
||||
// These tests may change if TxQ ordering is changed
|
||||
using namespace std::string_literals;
|
||||
BEAST_EXPECTS(
|
||||
aliceSeq + 1 == env.seq(alice),
|
||||
aliceSeq == env.seq(alice),
|
||||
"alice: "s + std::to_string(aliceSeq) + ", " +
|
||||
std::to_string(env.seq(alice)));
|
||||
BEAST_EXPECTS(
|
||||
@@ -1456,7 +1456,7 @@ public:
|
||||
"charlie: "s + std::to_string(charlieSeq) + ", " +
|
||||
std::to_string(env.seq(charlie)));
|
||||
BEAST_EXPECTS(
|
||||
dariaSeq == env.seq(daria),
|
||||
dariaSeq + 1 == env.seq(daria),
|
||||
"daria: "s + std::to_string(dariaSeq) + ", " +
|
||||
std::to_string(env.seq(daria)));
|
||||
BEAST_EXPECTS(
|
||||
@@ -1468,24 +1468,24 @@ public:
|
||||
"fred: "s + std::to_string(fredSeq) + ", " +
|
||||
std::to_string(env.seq(fred)));
|
||||
BEAST_EXPECTS(
|
||||
gwenSeq + 1 == env.seq(gwen),
|
||||
gwenSeq == env.seq(gwen),
|
||||
"gwen: "s + std::to_string(gwenSeq) + ", " +
|
||||
std::to_string(env.seq(gwen)));
|
||||
BEAST_EXPECTS(
|
||||
hankSeq == env.seq(hank),
|
||||
hankSeq + 1 == env.seq(hank),
|
||||
"hank: "s + std::to_string(hankSeq) + ", " +
|
||||
std::to_string(env.seq(hank)));
|
||||
|
||||
// Which sequences get incremented may change if TxQ ordering is
|
||||
// changed
|
||||
++aliceSeq;
|
||||
//++aliceSeq;
|
||||
++bobSeq;
|
||||
++(++charlieSeq);
|
||||
// ++dariaSeq;
|
||||
++dariaSeq;
|
||||
++elmoSeq;
|
||||
// ++fredSeq;
|
||||
++gwenSeq;
|
||||
// ++hankSeq;
|
||||
// ++gwenSeq;
|
||||
++hankSeq;
|
||||
|
||||
auto getTxsQueued = [&]() {
|
||||
auto const txs = env.app().getTxQ().getTxs();
|
||||
|
||||
Reference in New Issue
Block a user