diff --git a/src/libxrpl/tx/transactors/check/CheckCancel.cpp b/src/libxrpl/tx/transactors/check/CheckCancel.cpp index ed60817224..f4602f98c6 100644 --- a/src/libxrpl/tx/transactors/check/CheckCancel.cpp +++ b/src/libxrpl/tx/transactors/check/CheckCancel.cpp @@ -1,10 +1,12 @@ #include #include +#include #include #include #include #include +#include #include #include #include @@ -19,6 +21,9 @@ namespace xrpl { NotTEC CheckCancel::preflight(PreflightContext const& ctx) { + if (ctx.rules.enabled(fixCleanup3_3_0) && ctx.tx[sfCheckID] == beast::kZero) + return temMALFORMED; + return tesSUCCESS; } diff --git a/src/libxrpl/tx/transactors/check/CheckCash.cpp b/src/libxrpl/tx/transactors/check/CheckCash.cpp index 4e810d94cf..a8c989f4df 100644 --- a/src/libxrpl/tx/transactors/check/CheckCash.cpp +++ b/src/libxrpl/tx/transactors/check/CheckCash.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -51,6 +52,9 @@ CheckCash::checkExtraFeatures(xrpl::PreflightContext const& ctx) NotTEC CheckCash::preflight(PreflightContext const& ctx) { + if (ctx.rules.enabled(fixCleanup3_3_0) && ctx.tx[sfCheckID] == beast::kZero) + return temMALFORMED; + // Exactly one of Amount or DeliverMin must be present. auto const optAmount = ctx.tx[~sfAmount]; auto const optDeliverMin = ctx.tx[~sfDeliverMin]; diff --git a/src/test/app/Check_test.cpp b/src/test/app/Check_test.cpp index b19a9f6894..840c06bd84 100644 --- a/src/test/app/Check_test.cpp +++ b/src/test/app/Check_test.cpp @@ -1257,6 +1257,13 @@ class Check_test : public beast::unit_test::Suite env.close(); } + // Can't run pre-amendment behavior due to assertion failure. + if (features[fixCleanup3_3_0]) + { + env(check::cash(bob, uint256{}, usd(20)), Ter(temMALFORMED)); + env.close(); + } + // alice creates her checks ahead of time. uint256 const chkIdU{getCheckIndex(alice, env.seq(alice))}; env(check::create(alice, bob, usd(20))); @@ -1704,6 +1711,13 @@ class Check_test : public beast::unit_test::Suite // Non-existent check. env(check::cancel(bob, getCheckIndex(alice, env.seq(alice))), Ter(tecNO_ENTRY)); env.close(); + + // Can't run pre-amendment behavior due to assertion failure. + if (features[fixCleanup3_3_0]) + { + env(check::cancel(bob, uint256{}), Ter(temMALFORMED)); + env.close(); + } } void