Skip to content

Commit

Permalink
Add a test case that is true regardless of transaction ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
ximinez committed Feb 26, 2022
1 parent 72377e7 commit e367ac2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/app/TxQ_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,14 @@ class TxQ1_test : public beast::unit_test::suite
env.close();
checkMetrics(env, 3, 10, 6, 5, 256);

// This next test should remain unchanged regardless of
// transaction ordering
BEAST_EXPECT(
aliceSeq + bobSeq + charlieSeq + dariaSeq + elmoSeq + fredSeq +
gwenSeq + hankSeq + 6 ==
env.seq(alice) + env.seq(bob) + env.seq(charlie) + env.seq(daria) +
env.seq(elmo) + env.seq(fred) + env.seq(gwen) + env.seq(hank));
// These tests may change if TxQ ordering is changed
BEAST_EXPECT(aliceSeq + 1 == env.seq(alice));
BEAST_EXPECT(bobSeq + 1 == env.seq(bob));
BEAST_EXPECT(charlieSeq == env.seq(charlie));
Expand Down Expand Up @@ -1408,6 +1416,14 @@ class TxQ1_test : public beast::unit_test::suite
env.close();
checkMetrics(env, 4, 12, 7, 6, 256);

// This next test should remain unchanged regardless of
// transaction ordering
BEAST_EXPECT(
aliceSeq + bobSeq + charlieSeq + dariaSeq + elmoSeq + fredSeq +
gwenSeq + hankSeq + 7 ==
env.seq(alice) + env.seq(bob) + env.seq(charlie) + env.seq(daria) +
env.seq(elmo) + env.seq(fred) + env.seq(gwen) + env.seq(hank));
// These tests may change if TxQ ordering is changed
BEAST_EXPECT(fredSeq + 4 == env.seq(fred));
BEAST_EXPECT(gwenSeq + 1 == env.seq(gwen));
BEAST_EXPECT(hankSeq + 1 == env.seq(hank));
Expand Down

0 comments on commit e367ac2

Please sign in to comment.