refactor: replace JSON LastLedgerSequence with last_ledger_seq (#5884)

This change replaces instances of JSON LastLedgerSequence with last_ledger_seq, which makes the tests a bit simpler and easier to read.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
Mayukha Vadari
2025-10-15 16:55:11 -04:00
committed by GitHub
parent 108f90586c
commit a422855ea7
3 changed files with 23 additions and 37 deletions

View File

@@ -37,10 +37,8 @@ struct Transaction_ordering_test : public beast::unit_test::suite
auto const aliceSequence = env.seq(alice);
auto const tx1 = env.jt(noop(alice), seq(aliceSequence));
auto const tx2 = env.jt(
noop(alice),
seq(aliceSequence + 1),
json(R"({"LastLedgerSequence":7})"));
auto const tx2 =
env.jt(noop(alice), seq(aliceSequence + 1), last_ledger_seq(7));
env(tx1);
env.close();
@@ -83,10 +81,8 @@ struct Transaction_ordering_test : public beast::unit_test::suite
auto const aliceSequence = env.seq(alice);
auto const tx1 = env.jt(noop(alice), seq(aliceSequence));
auto const tx2 = env.jt(
noop(alice),
seq(aliceSequence + 1),
json(R"({"LastLedgerSequence":7})"));
auto const tx2 =
env.jt(noop(alice), seq(aliceSequence + 1), last_ledger_seq(7));
env(tx2, ter(terPRE_SEQ));
BEAST_EXPECT(env.seq(alice) == aliceSequence);
@@ -131,9 +127,7 @@ struct Transaction_ordering_test : public beast::unit_test::suite
for (auto i = 0; i < 5; ++i)
{
tx.emplace_back(env.jt(
noop(alice),
seq(aliceSequence + i),
json(R"({"LastLedgerSequence":7})")));
noop(alice), seq(aliceSequence + i), last_ledger_seq(7)));
}
for (auto i = 1; i < 5; ++i)