diff --git a/include/xrpl/ledger/ApplyViewImpl.h b/include/xrpl/ledger/ApplyViewImpl.h index d93cdaeae8..74f2b92c03 100644 --- a/include/xrpl/ledger/ApplyViewImpl.h +++ b/include/xrpl/ledger/ApplyViewImpl.h @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/include/xrpl/ledger/detail/ApplyStateTable.h b/include/xrpl/ledger/detail/ApplyStateTable.h index e34cb60ab7..7cffb76d5e 100644 --- a/include/xrpl/ledger/detail/ApplyStateTable.h +++ b/include/xrpl/ledger/detail/ApplyStateTable.h @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/ledger/helpers/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h index 059a1f0d35..3bccc23426 100644 --- a/include/xrpl/ledger/helpers/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -23,6 +23,8 @@ #include #include +#include + namespace xrpl { template diff --git a/include/xrpl/tx/ApplyContext.h b/include/xrpl/tx/ApplyContext.h index deb2bb7207..9a5c3632f2 100644 --- a/include/xrpl/tx/ApplyContext.h +++ b/include/xrpl/tx/ApplyContext.h @@ -15,6 +15,7 @@ #include #include +#include #include #include #include diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index b1a21a44d4..57f3f63a89 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -1516,7 +1516,7 @@ Transactor::processPersistentChanges(TER result, XRPAmount fee) auto const type = after->getType(); if (typesToCollect.contains(type) && type == ltESCROW && after->isFieldPresent(sfData)) - modifiedObjects[type].push_back({index, after}); + modifiedObjects[type].emplace_back(index, after); } }); } diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp index b95245257a..ba1884d3d3 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp @@ -92,8 +92,10 @@ EscrowCreate::checkExtraFeatures(PreflightContext const& ctx) // Only require featureMPTokensV1 when the escrow amount is an MPT and // fixCleanup3_2_0 is active; XRP/IOU escrows are unaffected by this gate. if (ctx.rules.enabled(fixCleanup3_2_0) && ctx.tx[sfAmount].holds()) + { if (!ctx.rules.enabled(featureMPTokensV1)) return false; + } return (!ctx.tx.isFieldPresent(sfBytecode) && !ctx.tx.isFieldPresent(sfData)) || ctx.rules.enabled(featureSmartEscrow); diff --git a/src/test/app/EscrowSmart_test.cpp b/src/test/app/EscrowSmart_test.cpp index aa68cd2d03..e85cbb30b3 100644 --- a/src/test/app/EscrowSmart_test.cpp +++ b/src/test/app/EscrowSmart_test.cpp @@ -1073,7 +1073,8 @@ struct EscrowSmart_test : public beast::unit_test::Suite env(token::createOffer(carol, tokenId, XRP(100)), token::Owner(alice)); env(offer(alice, carol["GBP"](0.1), XRP(100))); env(paychan::create(alice, carol, XRP(1000), 100s, alice.pk())); - pdomain::Credentials const credentials{{alice, "first credential"}}; + pdomain::Credentials const credentials{ + {.issuer = alice, .credType = "first credential"}}; env(pdomain::setTx(alice, credentials)); env(signers(alice, 1, {{carol, 1}})); env(ticket::create(alice, 1)); @@ -1191,41 +1192,47 @@ struct EscrowSmart_test : public beast::unit_test::Suite std::vector const testCases = { // Code blob tests - {TestCase::BlobType::Code, - 99'950, - std::nullopt, - ExpectedStatus::Success}, // just under 100kb - {TestCase::BlobType::Code, - 99'955, - std::nullopt, - ExpectedStatus::Malformed}, // just over 100kb - {TestCase::BlobType::Code, 200'000, 10'000'000, ExpectedStatus::Success}, // ~200kb - {TestCase::BlobType::Code, - 490'000, - 10'000'000, - ExpectedStatus::Success}, // just under 1MB JSON - {TestCase::BlobType::Code, - 999'999, - 10'000'000, - ExpectedStatus::Crash}, // just over 1MB JSON + {.type = TestCase::BlobType::Code, + .size = 99'950, + .sizeLimit = std::nullopt, + .expected = ExpectedStatus::Success}, // just under 100kb + {.type = TestCase::BlobType::Code, + .size = 99'955, + .sizeLimit = std::nullopt, + .expected = ExpectedStatus::Malformed}, // just over 100kb + {.type = TestCase::BlobType::Code, + .size = 200'000, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Success}, // ~200kb + {.type = TestCase::BlobType::Code, + .size = 490'000, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Success}, // just under 1MB JSON + {.type = TestCase::BlobType::Code, + .size = 999'999, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Crash}, // just over 1MB JSON // Data blob tests - {TestCase::BlobType::Data, - 99'939, - std::nullopt, - ExpectedStatus::Success}, // just under 100kb - {TestCase::BlobType::Data, - 99'941, - std::nullopt, - ExpectedStatus::Malformed}, // just over 100kb - {TestCase::BlobType::Data, 200'000, 10'000'000, ExpectedStatus::Success}, // ~200kb - {TestCase::BlobType::Data, - 490'000, - 10'000'000, - ExpectedStatus::Success}, // just under 1MB JSON - {TestCase::BlobType::Data, - 999'950, - 10'000'000, - ExpectedStatus::Crash}, // just over 1MB JSON + {.type = TestCase::BlobType::Data, + .size = 99'939, + .sizeLimit = std::nullopt, + .expected = ExpectedStatus::Success}, // just under 100kb + {.type = TestCase::BlobType::Data, + .size = 99'941, + .sizeLimit = std::nullopt, + .expected = ExpectedStatus::Malformed}, // just over 100kb + {.type = TestCase::BlobType::Data, + .size = 200'000, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Success}, // ~200kb + {.type = TestCase::BlobType::Data, + .size = 490'000, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Success}, // just under 1MB JSON + {.type = TestCase::BlobType::Data, + .size = 999'950, + .sizeLimit = 10'000'000, + .expected = ExpectedStatus::Crash}, // just over 1MB JSON }; for (auto const& tc : testCases) diff --git a/src/test/jtx/escrow.h b/src/test/jtx/escrow.h index 26aef93d99..cbd8f81b90 100644 --- a/src/test/jtx/escrow.h +++ b/src/test/jtx/escrow.h @@ -2,8 +2,11 @@ #include #include +#include #include +#include +#include #include #include #include @@ -11,7 +14,9 @@ #include #include +#include #include +#include #include /** diff --git a/src/tests/libxrpl/helpers/TestServiceRegistry.h b/src/tests/libxrpl/helpers/TestServiceRegistry.h index ed70cc6f5b..db45580d1e 100644 --- a/src/tests/libxrpl/helpers/TestServiceRegistry.h +++ b/src/tests/libxrpl/helpers/TestServiceRegistry.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include