@@ -41,21 +41,33 @@ TEST_CASE("generalized tx set XDR validation", "[txset]")
41
41
SECTION (" no phases" )
42
42
{
43
43
auto txSet = TxSetXDRFrame::makeFromWire (xdrTxSet);
44
- REQUIRE (txSet->prepareForApply (*app) == nullptr );
44
+ REQUIRE (
45
+ txSet->prepareForApply (
46
+ *app,
47
+ app->getLedgerManager ().getLastClosedLedgerHeader ().header ) ==
48
+ nullptr );
45
49
}
46
50
SECTION (" one phase" )
47
51
{
48
52
auto txSet = TxSetXDRFrame::makeFromWire (xdrTxSet);
49
53
xdrTxSet.v1TxSet ().phases .emplace_back ();
50
- REQUIRE (txSet->prepareForApply (*app) == nullptr );
54
+ REQUIRE (
55
+ txSet->prepareForApply (
56
+ *app,
57
+ app->getLedgerManager ().getLastClosedLedgerHeader ().header ) ==
58
+ nullptr );
51
59
}
52
60
SECTION (" too many phases" )
53
61
{
54
62
xdrTxSet.v1TxSet ().phases .emplace_back ();
55
63
xdrTxSet.v1TxSet ().phases .emplace_back ();
56
64
xdrTxSet.v1TxSet ().phases .emplace_back ();
57
65
auto txSet = TxSetXDRFrame::makeFromWire (xdrTxSet);
58
- REQUIRE (txSet->prepareForApply (*app) == nullptr );
66
+ REQUIRE (
67
+ txSet->prepareForApply (
68
+ *app,
69
+ app->getLedgerManager ().getLastClosedLedgerHeader ().header ) ==
70
+ nullptr );
59
71
}
60
72
61
73
SECTION (" two phase scenarios" )
@@ -442,11 +454,17 @@ TEST_CASE("generalized tx set XDR validation", "[txset]")
442
454
bool valid = classicIsValid && sorobanIsValid;
443
455
if (valid)
444
456
{
445
- REQUIRE (txSet->prepareForApply (*app) != nullptr );
457
+ REQUIRE (txSet->prepareForApply (
458
+ *app, app->getLedgerManager ()
459
+ .getLastClosedLedgerHeader ()
460
+ .header ) != nullptr );
446
461
}
447
462
else
448
463
{
449
- REQUIRE (txSet->prepareForApply (*app) == nullptr );
464
+ REQUIRE (txSet->prepareForApply (
465
+ *app, app->getLedgerManager ()
466
+ .getLastClosedLedgerHeader ()
467
+ .header ) == nullptr );
450
468
}
451
469
}
452
470
}
@@ -502,7 +520,9 @@ testGeneralizedTxSetXDRConversion(ProtocolVersion protocolVersion)
502
520
auto checkXdrRoundtrip = [&](GeneralizedTransactionSet const & txSetXdr) {
503
521
auto txSetFrame = TxSetXDRFrame::makeFromWire (txSetXdr);
504
522
ApplicableTxSetFrameConstPtr applicableFrame =
505
- txSetFrame->prepareForApply (*app);
523
+ txSetFrame->prepareForApply (
524
+ *app,
525
+ app->getLedgerManager ().getLastClosedLedgerHeader ().header );
506
526
REQUIRE (applicableFrame->checkValid (*app, 0 , 0 ));
507
527
GeneralizedTransactionSet newXdr;
508
528
applicableFrame->toWireTxSetFrame ()->toXDR (newXdr);
0 commit comments