txq test fixes

This commit is contained in:
Richard Holland
2023-09-29 13:11:12 +00:00
parent 9841c8da72
commit 985c8d7dce
3 changed files with 35 additions and 15 deletions

View File

@@ -1468,13 +1468,31 @@ public:
std::cout << "hankSeq+1= " << hankSeq + 1 << "\n";
}
std::cout << "alice: " << strHex(alice.id()) << "\n";
std::cout << "bob: " << strHex(bob.id()) << "\n";
std::cout << "charlie: " << strHex(charlie.id()) << "\n";
std::cout << "daria: " << strHex(daria.id()) << "\n";
std::cout << "elmo: " << strHex(elmo.id()) << "\n";
std::cout << "fred: " << strHex(fred.id()) << "\n";
std::cout << "gwen: " << strHex(gwen.id()) << "\n";
std::cout << "hank: " << strHex(hank.id()) << "\n";
std::cout << "alice: " << alice.human() << "\n";
std::cout << "bob: " << bob.human() << "\n";
std::cout << "charlie: " << charlie.human() << "\n";
std::cout << "daria: " << daria.human() << "\n";
std::cout << "elmo: " << elmo.human() << "\n";
std::cout << "fred: " << fred.human() << "\n";
std::cout << "gwen: " << gwen.human() << "\n";
std::cout << "hank: " << hank.human() << "\n";
BEAST_EXPECTS(
aliceSeq + 1 == env.seq(alice),
"alice: "s + std::to_string(aliceSeq) + ", " +
std::to_string(env.seq(alice)));
BEAST_EXPECTS(
bobSeq + 1 == env.seq(bob),
bobSeq == env.seq(bob),
"bob: "s + std::to_string(bobSeq) + ", " +
std::to_string(env.seq(bob)));
BEAST_EXPECTS(
@@ -1486,7 +1504,7 @@ public:
"daria: "s + std::to_string(dariaSeq) + ", " +
std::to_string(env.seq(daria)));
BEAST_EXPECTS(
elmoSeq == env.seq(elmo),
elmoSeq + 1 == env.seq(elmo),
"elmo: "s + std::to_string(elmoSeq) + ", " +
std::to_string(env.seq(elmo)));
BEAST_EXPECTS(
@@ -1505,10 +1523,10 @@ public:
// Which sequences get incremented may change if TxQ ordering is
// changed
++aliceSeq;
++bobSeq;
//++bobSeq;
// ++(++charlieSeq);
++dariaSeq;
//++elmoSeq;
++elmoSeq;
++fredSeq;
++gwenSeq;
++hankSeq;

View File

@@ -38,7 +38,7 @@ public:
std::cout << lc_result[jss::ledger_hash] << "\n";
BEAST_EXPECT(
lc_result[jss::ledger_hash] ==
"CCC3B3E88CCAC17F1BE6B4A648A55999411F19E3FE55EB721960EB0DF28EDDA5");
"2E6983FE0D18F04568199D75E8E69503E747A24CE8814CF1FAD638CF6DF8FBDC");
BEAST_EXPECT(lc_result[jss::ledger_index] == 2);
env.close();

View File

@@ -1635,10 +1635,13 @@ public:
env.fund(XRP(10000), "alice");
env.close();
std::cout << to_string(env.closed()->info().hash) << "\n";
env.fund(XRP(10000), "bob");
env.close();
std::cout << to_string(env.closed()->info().hash) << "\n";
env.fund(XRP(10000), "jim");
env.close();
std::cout << to_string(env.closed()->info().hash) << "\n";
env.fund(XRP(10000), "jill");
{
@@ -1703,8 +1706,7 @@ public:
// access via the ledger_hash field
Json::Value jvParams;
jvParams[jss::ledger_hash] =
"E86DE7F3D7A4D9CE17EF7C8BA08A8F4D"
"8F643B9552F0D895A31CDA78F541DE4E";
"D39C52DE7CBF561ECA875A6D636B7C9095408DE1FAF4EC4AAF3FDD8AB3A1EA55";
auto jrr = env.rpc(
"json",
"ledger",
@@ -1925,7 +1927,7 @@ public:
if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2))
{
const std::string txid1 = [&]() {
auto const& txj = jrr[jss::queue_data][1u];
auto const& txj = jrr[jss::queue_data][0u];
BEAST_EXPECT(txj[jss::account] == alice.human());
BEAST_EXPECT(txj[jss::fee_level] == "256");
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
@@ -1937,7 +1939,7 @@ public:
return tx[jss::hash].asString();
}();
auto const& txj = jrr[jss::queue_data][0u];
auto const& txj = jrr[jss::queue_data][1u];
BEAST_EXPECT(txj[jss::account] == alice.human());
BEAST_EXPECT(txj[jss::fee_level] == "256");
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
@@ -1950,7 +1952,7 @@ public:
uint256 tx0, tx1;
BEAST_EXPECT(tx0.parseHex(txid0));
BEAST_EXPECT(tx1.parseHex(txid1));
BEAST_EXPECT((tx0 ^ parentHash) < (tx1 ^ parentHash));
BEAST_EXPECT((tx1 ^ parentHash) < (tx0 ^ parentHash));
return txid0;
}
return std::string{};
@@ -1965,14 +1967,14 @@ public:
{
auto const& parentHash = env.current()->info().parentHash;
auto const txid1 = [&]() {
auto const& txj = jrr[jss::queue_data][1u];
auto const& txj = jrr[jss::queue_data][0u];
BEAST_EXPECT(txj[jss::account] == alice.human());
BEAST_EXPECT(txj[jss::fee_level] == "256");
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
BEAST_EXPECT(txj.isMember(jss::tx));
return txj[jss::tx].asString();
}();
auto const& txj = jrr[jss::queue_data][0u];
auto const& txj = jrr[jss::queue_data][1u];
BEAST_EXPECT(txj[jss::account] == alice.human());
BEAST_EXPECT(txj[jss::fee_level] == "256");
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
@@ -1983,7 +1985,7 @@ public:
uint256 tx0, tx1;
BEAST_EXPECT(tx0.parseHex(txid0));
BEAST_EXPECT(tx1.parseHex(txid1));
BEAST_EXPECT((tx0 ^ parentHash) < (tx1 ^ parentHash));
BEAST_EXPECT((tx1 ^ parentHash) < (tx0 ^ parentHash));
}
env.close();
@@ -1994,7 +1996,7 @@ public:
jrr = env.rpc("json", "ledger", to_string(jv))[jss::result];
if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2))
{
auto const& txj = jrr[jss::queue_data][0u];
auto const& txj = jrr[jss::queue_data][1u];
BEAST_EXPECT(txj[jss::account] == alice.human());
BEAST_EXPECT(txj[jss::fee_level] == "256");
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
@@ -2003,7 +2005,7 @@ public:
BEAST_EXPECT(txj.isMember(jss::tx));
BEAST_EXPECT(txj[jss::tx].isMember(jss::tx_blob));
auto const& txj2 = jrr[jss::queue_data][1u];
auto const& txj2 = jrr[jss::queue_data][0u];
BEAST_EXPECT(txj2[jss::account] == alice.human());
BEAST_EXPECT(txj2[jss::fee_level] == "256");
BEAST_EXPECT(txj2["preflight_result"] == "tesSUCCESS");