diff --git a/src/ripple/app/tx/impl/MPTokenAuthorize.cpp b/src/ripple/app/tx/impl/MPTokenAuthorize.cpp index 86821266328..96d2c136ae7 100644 --- a/src/ripple/app/tx/impl/MPTokenAuthorize.cpp +++ b/src/ripple/app/tx/impl/MPTokenAuthorize.cpp @@ -87,7 +87,7 @@ MPTokenAuthorize::preclaim(PreclaimContext const& ctx) return tecOBJECT_NOT_FOUND; if (accountID == (*sleMptIssuance)[sfIssuer]) - return temMALFORMED; + return tecNO_PERMISSION; // if holder wants to use and create a mpt if (sleMpt) @@ -111,7 +111,7 @@ MPTokenAuthorize::preclaim(PreclaimContext const& ctx) // Note: `accountID` is issuer's account // `holderID` is holder's account if (accountID != (*sleMptIssuance)[sfIssuer]) - return temMALFORMED; + return tecNO_PERMISSION; // If tx is submitted by issuer, it only applies for MPT with // lsfMPTRequireAuth set diff --git a/src/ripple/protocol/Indexes.h b/src/ripple/protocol/Indexes.h index db3caf504ff..e4d2aa1a34d 100644 --- a/src/ripple/protocol/Indexes.h +++ b/src/ripple/protocol/Indexes.h @@ -312,12 +312,6 @@ mptoken(uint256 const& mptokenKey) Keylet mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept; - -Keylet -mpt_dir(uint192 const& id) noexcept; - -Keylet -mpt_dir(uint256 const& id) noexcept; } // namespace keylet // Everything below is deprecated and should be removed in favor of keylets: diff --git a/src/ripple/protocol/impl/Indexes.cpp b/src/ripple/protocol/impl/Indexes.cpp index 020f9c9bf27..a2c57c56d5d 100644 --- a/src/ripple/protocol/impl/Indexes.cpp +++ b/src/ripple/protocol/impl/Indexes.cpp @@ -74,7 +74,6 @@ enum class LedgerNameSpace : std::uint16_t { DID = 'I', MPTOKEN_ISSUANCE = '~', MPTOKEN = 't', - MPT_DIR = 'k', // No longer used or supported. Left here to reserve the space // to avoid accidental reuse. @@ -495,19 +494,6 @@ mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept return { ltMPTOKEN, indexHash(LedgerNameSpace::MPTOKEN, issuanceKey, holder)}; } - -Keylet -mpt_dir(uint192 const& id) noexcept -{ - return { - ltDIR_NODE, indexHash(LedgerNameSpace::MPT_DIR, mptIssuance(id).key)}; -} - -Keylet -mpt_dir(uint256 const& id) noexcept -{ - return {ltDIR_NODE, indexHash(LedgerNameSpace::MPT_DIR, id)}; -} } // namespace keylet } // namespace ripple diff --git a/src/test/app/MPToken_test.cpp b/src/test/app/MPToken_test.cpp index d2a1d1e5e55..ad814a1fd61 100644 --- a/src/test/app/MPToken_test.cpp +++ b/src/test/app/MPToken_test.cpp @@ -245,16 +245,10 @@ class MPToken_test : public beast::unit_test::suite // bob submits a tx with a holder field mptAlice.authorize( - {.account = &bob, .holder = &alice, .err = temMALFORMED}); - - mptAlice.authorize( - {.account = &bob, .holder = &bob, .err = temMALFORMED}); + {.account = &bob, .holder = &alice, .err = tecNO_PERMISSION}); // alice tries to hold onto her own token - mptAlice.authorize({.account = &alice, .err = temMALFORMED}); - - // alice tries to authorize herself - mptAlice.authorize({.holder = &alice, .err = temMALFORMED}); + mptAlice.authorize({.account = &alice, .err = tecNO_PERMISSION}); // the mpt does not enable allowlisting mptAlice.authorize({.holder = &bob, .err = tecNO_AUTH}); @@ -302,7 +296,7 @@ class MPToken_test : public beast::unit_test::suite mptAlice.create({.ownerCount = 1, .flags = tfMPTRequireAuth}); // alice submits a tx without specifying a holder's account - mptAlice.authorize({.err = temMALFORMED}); + mptAlice.authorize({.err = tecNO_PERMISSION}); // alice submits a tx to authorize a holder that hasn't created // a mptoken yet