diff --git a/src/ripple/app/tx/impl/CFTokenIssuanceDestroy.cpp b/src/ripple/app/tx/impl/CFTokenIssuanceDestroy.cpp index 0e9563b1499..942f829aea6 100644 --- a/src/ripple/app/tx/impl/CFTokenIssuanceDestroy.cpp +++ b/src/ripple/app/tx/impl/CFTokenIssuanceDestroy.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace ripple { @@ -30,9 +31,13 @@ CFTokenIssuanceDestroy::preflight(PreflightContext const& ctx) if (!ctx.rules.enabled(featureCFTokensV1)) return temDISABLED; + //check flags if (auto const ret = preflight1(ctx); !isTesSuccess(ret)) return ret; + if (ctx.tx.getFlags() & tfCFTokenIssuanceDestroyMask) + return temINVALID_FLAG; + return preflight2(ctx); } diff --git a/src/ripple/app/tx/impl/applySteps.cpp b/src/ripple/app/tx/impl/applySteps.cpp index 3aaf75b98fd..52dcead0b33 100644 --- a/src/ripple/app/tx/impl/applySteps.cpp +++ b/src/ripple/app/tx/impl/applySteps.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -162,7 +163,7 @@ with_txn_type(TxType txnType, F&& f) return f.template operator()(); case ttCFTOKEN_ISSUANCE_CREATE: return f.template operator()(); - case ttCFTOKEN_ISSUANCE_DESTORY: + case ttCFTOKEN_ISSUANCE_DESTROY: return f.template operator()(); default: throw UnknownTxnType(txnType); diff --git a/src/ripple/protocol/TxFlags.h b/src/ripple/protocol/TxFlags.h index dd94350a5f9..4702eb7c8d4 100644 --- a/src/ripple/protocol/TxFlags.h +++ b/src/ripple/protocol/TxFlags.h @@ -201,6 +201,8 @@ constexpr std::uint32_t tfBridgeModifyMask = ~(tfUniversal | tfClearAccountCreat constexpr std::uint32_t const tfCFTokenIssuanceCreateMask = ~(tfCFTCanLock | tfCFTRequireAuth | tfCFTCanEscrow | tfCFTCanTrade | tfCFTCanTransfer | tfCFTCanClawback | tfUniversal); +// CFTokenIssuanceDestroy flags: +constexpr std::uint32_t const tfCFTokenIssuanceDestroyMask = ~tfUniversal; // clang-format on } // namespace ripple diff --git a/src/test/app/CFToken_test.cpp b/src/test/app/CFToken_test.cpp index a117f34c398..55d2b91906e 100644 --- a/src/test/app/CFToken_test.cpp +++ b/src/test/app/CFToken_test.cpp @@ -80,12 +80,11 @@ class CFToken_test : public beast::unit_test::suite BEAST_EXPECT(env.ownerCount(master) == 0); + auto const id = keylet::cftIssuance(master.id(), env.seq(master)); env(cft::create(master)); env.close(); BEAST_EXPECT(env.ownerCount(master) == 1); - auto const id = keylet::cftIssuance(master.id(), env.seq(master)); - env(cft::destroy(master, ripple::to_string(id.key))); env.close(); BEAST_EXPECT(env.ownerCount(master) == 0);