address comment

This commit is contained in:
yinyiqian1
2026-07-15 19:55:29 -04:00
committed by Mayukha Vadari
parent 13d0a62725
commit 2eb873a590
5 changed files with 12 additions and 26 deletions

View File

@@ -356,7 +356,7 @@ inline constexpr FlagValue tfMPTPaymentMask = ~(tfUniversal | tfPartialPayment);
inline constexpr FlagValue tfTrustSetPermissionMask =
~(tfUniversal | tfSetfAuth | tfSetFreeze | tfClearFreeze);
// MPTokenIssuanceCreate MutableFlags:
// MPTokenIssuanceCreate ImmutableFlags:
// Indicating specific fields or flags may be changed after issuance.
inline constexpr FlagValue tifMPTCannotEnableCanLock = lsifMPTCannotEnableCanLock;
inline constexpr FlagValue tifMPTCannotEnableRequireAuth = lsifMPTCannotEnableRequireAuth;
@@ -368,7 +368,7 @@ inline constexpr FlagValue tifMPTCannotMutateMetadata = lsifMPTCannotMutateMetad
inline constexpr FlagValue tifMPTCannotMutateTransferFee = lsifMPTCannotMutateTransferFee;
inline constexpr FlagValue tifMPTCannotEnableCanHoldConfidentialBalance =
lsifMPTCannotEnableCanHoldConfidentialBalance;
inline constexpr FlagValue tmfMPTokenIssuanceCreateImmutableMask =
inline constexpr FlagValue tifMPTokenIssuanceCreateImmutableMask =
~(tifMPTCannotEnableCanLock | tifMPTCannotEnableRequireAuth | tifMPTCannotEnableCanEscrow |
tifMPTCannotEnableCanTrade | tifMPTCannotEnableCanTransfer | tifMPTCannotEnableCanClawback |
tifMPTCannotMutateMetadata | tifMPTCannotMutateTransferFee |

View File

@@ -68,7 +68,7 @@ MPTokenIssuanceCreate::preflight(PreflightContext const& ctx)
// specified.
if (auto const immutableFlags = ctx.tx[~sfImmutableFlags]; immutableFlags &&
((*immutableFlags == 0u) ||
((*immutableFlags & tmfMPTokenIssuanceCreateImmutableMask) != 0u)))
((*immutableFlags & tifMPTokenIssuanceCreateImmutableMask) != 0u)))
return temINVALID_FLAG;
if (auto const fee = ctx.tx[~sfTransferFee])

View File

@@ -965,11 +965,7 @@ class ConfidentialTransfer_test : public ConfidentialTransferTestBase
Account const alice("alice");
MPTTester mptAlice(env, alice, {.holders = {}});
mptAlice.create({
.ownerCount = 1,
.flags = tfMPTCanTransfer | tfMPTCanLock,
.immutableFlags = tifMPTCannotMutateTransferFee,
});
mptAlice.create({.ownerCount = 1, .flags = tfMPTCanTransfer | tfMPTCanLock});
mptAlice.set({
.account = alice,
@@ -986,12 +982,8 @@ class ConfidentialTransfer_test : public ConfidentialTransferTestBase
Account const alice("alice");
MPTTester mptAlice(env, alice, {.holders = {}});
mptAlice.create({
.transferFee = 100,
.ownerCount = 1,
.flags = tfMPTCanTransfer | tfMPTCanLock,
.immutableFlags = tifMPTCannotMutateTransferFee,
});
mptAlice.create(
{.transferFee = 100, .ownerCount = 1, .flags = tfMPTCanTransfer | tfMPTCanLock});
mptAlice.set({
.account = alice,
@@ -1007,11 +999,9 @@ class ConfidentialTransfer_test : public ConfidentialTransferTestBase
Account const alice("alice");
MPTTester mptAlice(env, alice, {.holders = {}});
mptAlice.create({
.ownerCount = 1,
.flags = tfMPTCanTransfer | tfMPTCanLock | tfMPTCanHoldConfidentialBalance,
.immutableFlags = tifMPTCannotMutateTransferFee,
});
mptAlice.create(
{.ownerCount = 1,
.flags = tfMPTCanTransfer | tfMPTCanLock | tfMPTCanHoldConfidentialBalance});
mptAlice.set({
.account = alice,

View File

@@ -3482,10 +3482,7 @@ class MPToken_test : public beast::unit_test::Suite
{
Env env{*this, features};
MPTTester mptAlice(env, alice, {.holders = {bob}});
mptAlice.create(
{.ownerCount = 1,
.immutableFlags = tifMPTCannotMutateMetadata | tifMPTCannotEnableCanLock |
tifMPTCannotMutateTransferFee});
mptAlice.create({.ownerCount = 1});
// Setting flags is not allowed when MutableFlags is present
mptAlice.set(
@@ -7673,7 +7670,7 @@ public:
// Test offer crossing
testOfferCrossing(all);
// // Test cross asset payment
// Test cross asset payment
testCrossAssetPayment(all);
// Test path finding

View File

@@ -2205,8 +2205,7 @@ class Vault_test : public beast::unit_test::Suite
Vault const vault{env};
MPTTester mptt{env, issuer, kMptInitNoFund};
mptt.create(
{.flags = tfMPTCanTransfer | tfMPTCanLock});
mptt.create({.flags = tfMPTCanTransfer | tfMPTCanLock});
PrettyAsset const asset = mptt.issuanceID();
mptt.authorize({.account = owner});
mptt.authorize({.account = alice});