diff --git a/src/ripple/app/tx/impl/NFTokenCreateOffer.cpp b/src/ripple/app/tx/impl/NFTokenCreateOffer.cpp index 6db31c69892..22eca2dffdd 100644 --- a/src/ripple/app/tx/impl/NFTokenCreateOffer.cpp +++ b/src/ripple/app/tx/impl/NFTokenCreateOffer.cpp @@ -193,7 +193,7 @@ NFTokenCreateOffer::preclaim(PreclaimContext const& ctx) // flag cannot be set unless amendment is enabled but // out of an abundance of caution check anyway - if (sleDst->getFlags() & lsfDisallowIncomingNFTOffer) + if (sleDst->getFlags() & lsfDisallowIncomingNFTokenOffer) return tecNO_PERMISSION; } } @@ -210,7 +210,7 @@ NFTokenCreateOffer::preclaim(PreclaimContext const& ctx) if (!sleOwner) return tecNO_TARGET; - if (sleOwner->getFlags() & lsfDisallowIncomingNFTOffer) + if (sleOwner->getFlags() & lsfDisallowIncomingNFTokenOffer) return tecNO_PERMISSION; } } diff --git a/src/ripple/app/tx/impl/SetAccount.cpp b/src/ripple/app/tx/impl/SetAccount.cpp index 5c7d4369a76..167644f45fb 100644 --- a/src/ripple/app/tx/impl/SetAccount.cpp +++ b/src/ripple/app/tx/impl/SetAccount.cpp @@ -541,10 +541,10 @@ SetAccount::doApply() // Set or clear flags for disallowing various incoming instruments if (ctx_.view().rules().enabled(featureDisallowIncoming)) { - if (uSetFlag == asfDisallowIncomingNFTOffer) - uFlagsOut |= lsfDisallowIncomingNFTOffer; - else if (uClearFlag == asfDisallowIncomingNFTOffer) - uFlagsOut &= ~lsfDisallowIncomingNFTOffer; + if (uSetFlag == asfDisallowIncomingNFTokenOffer) + uFlagsOut |= lsfDisallowIncomingNFTokenOffer; + else if (uClearFlag == asfDisallowIncomingNFTokenOffer) + uFlagsOut &= ~lsfDisallowIncomingNFTokenOffer; if (uSetFlag == asfDisallowIncomingCheck) uFlagsOut |= lsfDisallowIncomingCheck; diff --git a/src/ripple/protocol/LedgerFormats.h b/src/ripple/protocol/LedgerFormats.h index 45258a3d02b..8245f352c8e 100644 --- a/src/ripple/protocol/LedgerFormats.h +++ b/src/ripple/protocol/LedgerFormats.h @@ -235,7 +235,7 @@ enum LedgerSpecificFlags { /* // reserved for Hooks amendment lsfTshCollect = 0x02000000, // True, allow TSH collect-calls to acc hooks */ - lsfDisallowIncomingNFTOffer = + lsfDisallowIncomingNFTokenOffer = 0x04000000, // True, reject new incoming NFT offers lsfDisallowIncomingCheck = 0x08000000, // True, reject new checks diff --git a/src/ripple/protocol/TxFlags.h b/src/ripple/protocol/TxFlags.h index c4218219868..c0dd080f6f7 100644 --- a/src/ripple/protocol/TxFlags.h +++ b/src/ripple/protocol/TxFlags.h @@ -51,81 +51,83 @@ namespace ripple { @ingroup protocol */ +// Formatting equals sign aligned 4 spaces after longest prefix, except for +// wrapped lines // clang-format off // Universal Transaction flags: -constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000; -constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig; -constexpr std::uint32_t tfUniversalMask = ~tfUniversal; +constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000; +constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig; +constexpr std::uint32_t tfUniversalMask = ~tfUniversal; // AccountSet flags: -constexpr std::uint32_t tfRequireDestTag = 0x00010000; -constexpr std::uint32_t tfOptionalDestTag = 0x00020000; -constexpr std::uint32_t tfRequireAuth = 0x00040000; -constexpr std::uint32_t tfOptionalAuth = 0x00080000; -constexpr std::uint32_t tfDisallowXRP = 0x00100000; -constexpr std::uint32_t tfAllowXRP = 0x00200000; +constexpr std::uint32_t tfRequireDestTag = 0x00010000; +constexpr std::uint32_t tfOptionalDestTag = 0x00020000; +constexpr std::uint32_t tfRequireAuth = 0x00040000; +constexpr std::uint32_t tfOptionalAuth = 0x00080000; +constexpr std::uint32_t tfDisallowXRP = 0x00100000; +constexpr std::uint32_t tfAllowXRP = 0x00200000; constexpr std::uint32_t tfAccountSetMask = ~(tfUniversal | tfRequireDestTag | tfOptionalDestTag | tfRequireAuth | tfOptionalAuth | tfDisallowXRP | tfAllowXRP); // AccountSet SetFlag/ClearFlag values -constexpr std::uint32_t asfRequireDest = 1; -constexpr std::uint32_t asfRequireAuth = 2; -constexpr std::uint32_t asfDisallowXRP = 3; -constexpr std::uint32_t asfDisableMaster = 4; -constexpr std::uint32_t asfAccountTxnID = 5; -constexpr std::uint32_t asfNoFreeze = 6; -constexpr std::uint32_t asfGlobalFreeze = 7; -constexpr std::uint32_t asfDefaultRipple = 8; -constexpr std::uint32_t asfDepositAuth = 9; -constexpr std::uint32_t asfAuthorizedNFTokenMinter = 10; +constexpr std::uint32_t asfRequireDest = 1; +constexpr std::uint32_t asfRequireAuth = 2; +constexpr std::uint32_t asfDisallowXRP = 3; +constexpr std::uint32_t asfDisableMaster = 4; +constexpr std::uint32_t asfAccountTxnID = 5; +constexpr std::uint32_t asfNoFreeze = 6; +constexpr std::uint32_t asfGlobalFreeze = 7; +constexpr std::uint32_t asfDefaultRipple = 8; +constexpr std::uint32_t asfDepositAuth = 9; +constexpr std::uint32_t asfAuthorizedNFTokenMinter = 10; /* // reserved for Hooks amendment -constexpr std::uint32_t asfTshCollect = 11; +constexpr std::uint32_t asfTshCollect = 11; */ -constexpr std::uint32_t asfDisallowIncomingNFTOffer = 12; -constexpr std::uint32_t asfDisallowIncomingCheck = 13; -constexpr std::uint32_t asfDisallowIncomingPayChan = 14; -constexpr std::uint32_t asfDisallowIncomingTrustline = 15; +constexpr std::uint32_t asfDisallowIncomingNFTokenOffer = 12; +constexpr std::uint32_t asfDisallowIncomingCheck = 13; +constexpr std::uint32_t asfDisallowIncomingPayChan = 14; +constexpr std::uint32_t asfDisallowIncomingTrustline = 15; // OfferCreate flags: -constexpr std::uint32_t tfPassive = 0x00010000; -constexpr std::uint32_t tfImmediateOrCancel = 0x00020000; -constexpr std::uint32_t tfFillOrKill = 0x00040000; -constexpr std::uint32_t tfSell = 0x00080000; +constexpr std::uint32_t tfPassive = 0x00010000; +constexpr std::uint32_t tfImmediateOrCancel = 0x00020000; +constexpr std::uint32_t tfFillOrKill = 0x00040000; +constexpr std::uint32_t tfSell = 0x00080000; constexpr std::uint32_t tfOfferCreateMask = ~(tfUniversal | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell); // Payment flags: -constexpr std::uint32_t tfNoRippleDirect = 0x00010000; -constexpr std::uint32_t tfPartialPayment = 0x00020000; -constexpr std::uint32_t tfLimitQuality = 0x00040000; +constexpr std::uint32_t tfNoRippleDirect = 0x00010000; +constexpr std::uint32_t tfPartialPayment = 0x00020000; +constexpr std::uint32_t tfLimitQuality = 0x00040000; constexpr std::uint32_t tfPaymentMask = ~(tfUniversal | tfPartialPayment | tfLimitQuality | tfNoRippleDirect); // TrustSet flags: -constexpr std::uint32_t tfSetfAuth = 0x00010000; -constexpr std::uint32_t tfSetNoRipple = 0x00020000; -constexpr std::uint32_t tfClearNoRipple = 0x00040000; -constexpr std::uint32_t tfSetFreeze = 0x00100000; -constexpr std::uint32_t tfClearFreeze = 0x00200000; +constexpr std::uint32_t tfSetfAuth = 0x00010000; +constexpr std::uint32_t tfSetNoRipple = 0x00020000; +constexpr std::uint32_t tfClearNoRipple = 0x00040000; +constexpr std::uint32_t tfSetFreeze = 0x00100000; +constexpr std::uint32_t tfClearFreeze = 0x00200000; constexpr std::uint32_t tfTrustSetMask = ~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze | tfClearFreeze); // EnableAmendment flags: -constexpr std::uint32_t tfGotMajority = 0x00010000; -constexpr std::uint32_t tfLostMajority = 0x00020000; +constexpr std::uint32_t tfGotMajority = 0x00010000; +constexpr std::uint32_t tfLostMajority = 0x00020000; // PaymentChannelClaim flags: -constexpr std::uint32_t tfRenew = 0x00010000; -constexpr std::uint32_t tfClose = 0x00020000; +constexpr std::uint32_t tfRenew = 0x00010000; +constexpr std::uint32_t tfClose = 0x00020000; constexpr std::uint32_t tfPayChanClaimMask = ~(tfUniversal | tfRenew | tfClose); // NFTokenMint flags: -constexpr std::uint32_t const tfBurnable = 0x00000001; -constexpr std::uint32_t const tfOnlyXRP = 0x00000002; -constexpr std::uint32_t const tfTrustLine = 0x00000004; -constexpr std::uint32_t const tfTransferable = 0x00000008; +constexpr std::uint32_t const tfBurnable = 0x00000001; +constexpr std::uint32_t const tfOnlyXRP = 0x00000002; +constexpr std::uint32_t const tfTrustLine = 0x00000004; +constexpr std::uint32_t const tfTransferable = 0x00000008; // Prior to fixRemoveNFTokenAutoTrustLine, transfer of an NFToken between // accounts allowed a TrustLine to be added to the issuer of that token @@ -147,15 +149,15 @@ constexpr std::uint32_t const tfNFTokenMintMask = ~(tfUniversal | tfBurnable | tfOnlyXRP | tfTransferable); // NFTokenCreateOffer flags: -constexpr std::uint32_t const tfSellNFToken = 0x00000001; +constexpr std::uint32_t const tfSellNFToken = 0x00000001; constexpr std::uint32_t const tfNFTokenCreateOfferMask = ~(tfUniversal | tfSellNFToken); // NFTokenCancelOffer flags: -constexpr std::uint32_t const tfNFTokenCancelOfferMask = ~(tfUniversal); +constexpr std::uint32_t const tfNFTokenCancelOfferMask = ~(tfUniversal); // NFTokenAcceptOffer flags: -constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversal; +constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversal; // clang-format on diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 40202e07dce..150622c731c 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -3028,11 +3028,11 @@ class NFToken_test : public beast::unit_test::suite Env env{*this, features - disallowIncoming}; Account const alice{"alice"}; env.fund(XRP(10000), alice); - env(fset(alice, asfDisallowIncomingNFTOffer)); + env(fset(alice, asfDisallowIncomingNFTokenOffer)); env.close(); auto const sle = env.le(alice); uint32_t flags = sle->getFlags(); - BEAST_EXPECT(!(flags & lsfDisallowIncomingNFTOffer)); + BEAST_EXPECT(!(flags & lsfDisallowIncomingNFTokenOffer)); } Env env{*this, features | disallowIncoming}; @@ -3055,7 +3055,7 @@ class NFToken_test : public beast::unit_test::suite env.close(); // enable flag - env(fset(buyer, asfDisallowIncomingNFTOffer)); + env(fset(buyer, asfDisallowIncomingNFTokenOffer)); env.close(); // a sell offer from the minter to the buyer should be rejected @@ -3071,7 +3071,7 @@ class NFToken_test : public beast::unit_test::suite } // disable the flag - env(fclear(buyer, asfDisallowIncomingNFTOffer)); + env(fclear(buyer, asfDisallowIncomingNFTokenOffer)); env.close(); // create offer (allowed now) then cancel @@ -3098,13 +3098,13 @@ class NFToken_test : public beast::unit_test::suite txflags(tfSellNFToken)); env.close(); - env(fset(buyer, asfDisallowIncomingNFTOffer)); + env(fset(buyer, asfDisallowIncomingNFTokenOffer)); env.close(); env(token::cancelOffer(minter, {offerIndex})); env.close(); - env(fclear(buyer, asfDisallowIncomingNFTOffer)); + env(fclear(buyer, asfDisallowIncomingNFTokenOffer)); env.close(); } @@ -3125,7 +3125,7 @@ class NFToken_test : public beast::unit_test::suite // buyer now owns the token // enable flag again - env(fset(buyer, asfDisallowIncomingNFTOffer)); + env(fset(buyer, asfDisallowIncomingNFTokenOffer)); env.close(); // a random offer to buy the token diff --git a/src/test/rpc/AccountSet_test.cpp b/src/test/rpc/AccountSet_test.cpp index b3ca4c9f017..f935e0a846f 100644 --- a/src/test/rpc/AccountSet_test.cpp +++ b/src/test/rpc/AccountSet_test.cpp @@ -86,7 +86,7 @@ class AccountSet_test : public beast::unit_test::suite if (flag == asfDisallowIncomingCheck || flag == asfDisallowIncomingPayChan || - flag == asfDisallowIncomingNFTOffer || + flag == asfDisallowIncomingNFTokenOffer || flag == asfDisallowIncomingTrustline) { // These flags are part of the DisallowIncoming amendment