mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 07:10:53 +00:00
Gate the changes with the amendment
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -32,6 +32,24 @@ public:
|
||||
|
||||
TER
|
||||
doApply() override;
|
||||
|
||||
static constexpr auto disabledTxTypes = std::to_array<TxType>({
|
||||
ttVAULT_CREATE,
|
||||
ttVAULT_SET,
|
||||
ttVAULT_DELETE,
|
||||
ttVAULT_DEPOSIT,
|
||||
ttVAULT_WITHDRAW,
|
||||
ttVAULT_CLAWBACK,
|
||||
ttLOAN_BROKER_SET,
|
||||
ttLOAN_BROKER_DELETE,
|
||||
ttLOAN_BROKER_COVER_DEPOSIT,
|
||||
ttLOAN_BROKER_COVER_WITHDRAW,
|
||||
ttLOAN_BROKER_COVER_CLAWBACK,
|
||||
ttLOAN_SET,
|
||||
ttLOAN_DELETE,
|
||||
ttLOAN_MANAGE,
|
||||
ttLOAN_PAY,
|
||||
});
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -258,7 +258,8 @@ Batch::preflight(PreflightContext const& ctx)
|
||||
return temINVALID;
|
||||
}
|
||||
|
||||
if (std::any_of(
|
||||
if (!ctx.rules.enabled(fixLendingProtocolV1_1) &&
|
||||
std::any_of(
|
||||
disabledTxTypes.begin(), disabledTxTypes.end(), [txType](auto const& disabled) {
|
||||
return txType == disabled;
|
||||
}))
|
||||
|
||||
@@ -2600,16 +2600,18 @@ class Batch_test : public beast::unit_test::suite
|
||||
{
|
||||
testcase("loan");
|
||||
|
||||
bool const lendingBatchEnabled = !std::any_of(
|
||||
Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) {
|
||||
return disabled == ttLOAN_BROKER_SET;
|
||||
});
|
||||
|
||||
using namespace test::jtx;
|
||||
|
||||
test::jtx::Env env{
|
||||
*this, features | featureSingleAssetVault | featureLendingProtocol | featureMPTokensV1};
|
||||
|
||||
bool const lendingBatchEnabled =
|
||||
!std::any_of(
|
||||
Batch::disabledTxTypes.begin(),
|
||||
Batch::disabledTxTypes.end(),
|
||||
[](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }) ||
|
||||
env.enabled(fixLendingProtocolV1_1);
|
||||
|
||||
Account const issuer{"issuer"};
|
||||
// For simplicity, lender will be the sole actor for the vault &
|
||||
// brokers.
|
||||
|
||||
@@ -2174,15 +2174,17 @@ protected:
|
||||
// From FIND-001
|
||||
testcase << "Batch Bypass Counterparty";
|
||||
|
||||
bool const lendingBatchEnabled = !std::any_of(
|
||||
Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) {
|
||||
return disabled == ttLOAN_BROKER_SET;
|
||||
});
|
||||
|
||||
using namespace jtx;
|
||||
using namespace std::chrono_literals;
|
||||
Env env(*this, all);
|
||||
|
||||
bool const lendingBatchEnabled =
|
||||
!std::any_of(
|
||||
Batch::disabledTxTypes.begin(),
|
||||
Batch::disabledTxTypes.end(),
|
||||
[](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }) ||
|
||||
env.enabled(fixLendingProtocolV1_1);
|
||||
|
||||
Account const lender{"lender"};
|
||||
Account const borrower{"borrower"};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user