Merge branch 'develop' into ximinez/lending-XLS-66

This commit is contained in:
Ed Hennis
2025-07-10 12:30:06 -04:00
committed by GitHub
17 changed files with 100 additions and 28 deletions

View File

@@ -17,18 +17,8 @@
*/
//==============================================================================
#include <test/jtx/AMM.h>
#include <test/jtx.h>
#include <test/jtx/AMMTest.h>
#include <test/jtx/Account.h>
#include <test/jtx/Env.h>
#include <test/jtx/amount.h>
#include <test/jtx/credentials.h>
#include <test/jtx/fee.h>
#include <test/jtx/flags.h>
#include <test/jtx/mpt.h>
#include <test/jtx/permissioned_domains.h>
#include <test/jtx/utility.h>
#include <test/jtx/vault.h>
#include <xrpld/ledger/View.h>

View File

@@ -98,8 +98,7 @@ struct Buffer_test : beast::unit_test::suite
x = b0;
BEAST_EXPECT(x == b0);
BEAST_EXPECT(sane(x));
#if defined(__clang__) && (!defined(__APPLE__) && (__clang_major__ >= 7)) || \
(defined(__APPLE__) && (__apple_build_version__ >= 10010043))
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif
@@ -111,8 +110,7 @@ struct Buffer_test : beast::unit_test::suite
BEAST_EXPECT(y == b3);
BEAST_EXPECT(sane(y));
#if defined(__clang__) && (!defined(__APPLE__) && (__clang_major__ >= 7)) || \
(defined(__APPLE__) && (__apple_build_version__ >= 10010043))
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
}

View File

@@ -22,6 +22,7 @@
// Convenience header that includes everything
#include <test/jtx/AMM.h>
#include <test/jtx/Account.h>
#include <test/jtx/Env.h>
#include <test/jtx/Env_ss.h>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <test/jtx/mpt.h>
#include <test/jtx.h>
#include <xrpl/protocol/jss.h>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <test/jtx/permissioned_dex.h>
#include <test/jtx.h>
#include <xrpl/beast/unit_test/suite.h>
#include <xrpl/protocol/jss.h>

View File

@@ -17,7 +17,7 @@
*/
//==============================================================================
#include <test/jtx/permissioned_domains.h>
#include <test/jtx.h>
namespace ripple {
namespace test {

View File

@@ -20,7 +20,8 @@
#ifndef RIPPLE_TEST_JTX_MPT_H_INCLUDED
#define RIPPLE_TEST_JTX_MPT_H_INCLUDED
#include <test/jtx.h>
#include <test/jtx/Account.h>
#include <test/jtx/Env.h>
#include <test/jtx/ter.h>
#include <test/jtx/txflags.h>

View File

@@ -19,7 +19,9 @@
#pragma once
#include <test/jtx.h>
#include <test/jtx/Account.h>
#include <test/jtx/Env.h>
namespace ripple {
namespace test {
namespace jtx {

View File

@@ -20,7 +20,8 @@
#ifndef RIPPLE_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED
#define RIPPLE_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED
#include <test/jtx.h>
#include <test/jtx/Account.h>
#include <test/jtx/Env.h>
#include <test/jtx/deposit.h>
namespace ripple {

View File

@@ -675,6 +675,30 @@ public:
BEAST_EXPECT(
!getAccountFlag(allowTrustLineClawbackFlag.first, bob));
}
static constexpr std::pair<std::string_view, std::uint32_t>
allowTrustLineLockingFlag{
"allowTrustLineLocking", asfAllowTrustLineLocking};
if (features[featureTokenEscrow])
{
auto const f1 =
getAccountFlag(allowTrustLineLockingFlag.first, bob);
BEAST_EXPECT(f1.has_value());
BEAST_EXPECT(!f1.value());
// Set allowTrustLineLocking
env(fset(bob, allowTrustLineLockingFlag.second));
env.close();
auto const f2 =
getAccountFlag(allowTrustLineLockingFlag.first, bob);
BEAST_EXPECT(f2.has_value());
BEAST_EXPECT(f2.value());
}
else
{
BEAST_EXPECT(!getAccountFlag(allowTrustLineLockingFlag.first, bob));
}
}
void
@@ -691,6 +715,9 @@ public:
testAccountFlags(allFeatures - featureDisallowIncoming);
testAccountFlags(
allFeatures - featureDisallowIncoming - featureClawback);
testAccountFlags(
allFeatures - featureDisallowIncoming - featureClawback -
featureTokenEscrow);
}
};

View File

@@ -108,6 +108,10 @@ doAccountInfo(RPC::JsonContext& context)
allowTrustLineClawbackFlag{
"allowTrustLineClawback", lsfAllowTrustLineClawback};
static constexpr std::pair<std::string_view, LedgerSpecificFlags>
allowTrustLineLockingFlag{
"allowTrustLineLocking", lsfAllowTrustLineLocking};
auto const sleAccepted = ledger->read(keylet::account(accountID));
if (sleAccepted)
{
@@ -140,6 +144,10 @@ doAccountInfo(RPC::JsonContext& context)
acctFlags[allowTrustLineClawbackFlag.first.data()] =
sleAccepted->isFlag(allowTrustLineClawbackFlag.second);
if (ledger->rules().enabled(featureTokenEscrow))
acctFlags[allowTrustLineLockingFlag.first.data()] =
sleAccepted->isFlag(allowTrustLineLockingFlag.second);
result[jss::account_flags] = std::move(acctFlags);
// The document[https://xrpl.org/account_info.html#account_info] states