Rename allowClawback flag to allowTrustLineClawback (#4617)

Reason for this change is here XRPLF/XRPL-Standards#119

We would want to be explicit that this flag is exclusively for trustline. For new token types(eg. CFT), they will not utilize this flag for clawback, instead, they will turn clawback on/off on the token-level, which is more versatile.
This commit is contained in:
Shawn Xie
2023-07-13 21:00:32 -04:00
committed by GitHub
parent cb09e61d2f
commit 5ba1f984df
9 changed files with 113 additions and 104 deletions

View File

@@ -609,25 +609,29 @@ public:
}
static constexpr std::pair<std::string_view, std::uint32_t>
allowClawbackFlag{"allowClawback", asfAllowClawback};
allowTrustLineClawbackFlag{
"allowTrustLineClawback", asfAllowTrustLineClawback};
if (features[featureClawback])
{
// must use bob's account because alice has noFreeze set
auto const f1 = getAccountFlag(allowClawbackFlag.first, bob);
auto const f1 =
getAccountFlag(allowTrustLineClawbackFlag.first, bob);
BEAST_EXPECT(f1.has_value());
BEAST_EXPECT(!f1.value());
// Set allowClawback
env(fset(bob, allowClawbackFlag.second));
// Set allowTrustLineClawback
env(fset(bob, allowTrustLineClawbackFlag.second));
env.close();
auto const f2 = getAccountFlag(allowClawbackFlag.first, bob);
auto const f2 =
getAccountFlag(allowTrustLineClawbackFlag.first, bob);
BEAST_EXPECT(f2.has_value());
BEAST_EXPECT(f2.value());
}
else
{
BEAST_EXPECT(!getAccountFlag(allowClawbackFlag.first, bob));
BEAST_EXPECT(
!getAccountFlag(allowTrustLineClawbackFlag.first, bob));
}
}

View File

@@ -93,10 +93,10 @@ public:
// and are tested elsewhere
continue;
}
if (flag == asfAllowClawback)
if (flag == asfAllowTrustLineClawback)
{
// The asfAllowClawback flag can't be cleared. It is tested
// elsewhere.
// The asfAllowTrustLineClawback flag can't be cleared. It
// is tested elsewhere.
continue;
}