@@ -4415,6 +4415,52 @@ class Import_test : public beast::unit_test::suite
4415
4415
}
4416
4416
}
4417
4417
4418
+ void
4419
+ testUsingTickets (FeatureBitset features)
4420
+ {
4421
+ testcase (" using tickets" );
4422
+
4423
+ using namespace test ::jtx;
4424
+ using namespace std ::literals;
4425
+
4426
+ {
4427
+ test::jtx::Env env{*this , makeNetworkVLConfig (21337 , keys)};
4428
+ auto const feeDrops = env.current ()->fees ().base ;
4429
+
4430
+ // confirm total coins header
4431
+ auto const initCoins = env.current ()->info ().drops ;
4432
+ BEAST_EXPECT (initCoins == 100'000'000'000'000'000 );
4433
+
4434
+ // burn 10'000 xrp
4435
+ auto const master = Account (" masterpassphrase" );
4436
+ env (noop (master), fee (10'000'000'000 ), ter (tesSUCCESS));
4437
+ env.close ();
4438
+
4439
+ // confirm total coins header
4440
+ auto const burnCoins = env.current ()->info ().drops ;
4441
+ BEAST_EXPECT (burnCoins == initCoins - 10'000'000'000 );
4442
+
4443
+ auto const alice = Account (" alice" );
4444
+ env.fund (XRP (1000 ), alice);
4445
+ env.close ();
4446
+
4447
+ std::uint32_t aliceTicketSeq{env.seq (alice) + 1 };
4448
+ env (ticket::create (alice, 10 ));
4449
+ std::uint32_t const aliceSeq{env.seq (alice)};
4450
+ env.require (owners (alice, 10 ));
4451
+
4452
+ env (import (alice, loadXpop (ImportTCAccountSet::w_seed)),
4453
+ fee (feeDrops * 10 ),
4454
+ ticket::use (aliceTicketSeq++),
4455
+ ter (tesSUCCESS));
4456
+ env.close ();
4457
+
4458
+ env.require (tickets (alice, env.seq (alice) - aliceTicketSeq));
4459
+ BEAST_EXPECT (env.seq (alice) == aliceSeq);
4460
+ env.require (owners (alice, 9 ));
4461
+ }
4462
+ }
4463
+
4418
4464
void
4419
4465
testAccountIndex (FeatureBitset features)
4420
4466
{
@@ -5581,6 +5627,7 @@ class Import_test : public beast::unit_test::suite
5581
5627
testSetRegularKey (features);
5582
5628
testSetRegularKeyFlags (features);
5583
5629
testSignersListSet (features);
5630
+ testUsingTickets (features);
5584
5631
testAccountIndex (features);
5585
5632
testHookIssuer (features);
5586
5633
testImportSequence (features);
0 commit comments