mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
PayChan and Escrow should ignore DisallowXRP (RIPD-1462)
This commit is contained in:
committed by
Nikolaos D. Bougalis
parent
259394029a
commit
cc0ce7163a
@@ -253,6 +253,35 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT((*sle)[sfDestinationTag] == 2);
|
||||
}
|
||||
|
||||
void
|
||||
testDisallowXRP()
|
||||
{
|
||||
testcase ("Disallow XRP");
|
||||
|
||||
using namespace jtx;
|
||||
using namespace std::chrono;
|
||||
|
||||
{
|
||||
// Respect the "asfDisallowXRP" account flag:
|
||||
Env env(*this, supported_amendments() - featureDepositAuth);
|
||||
|
||||
env.fund(XRP(5000), "bob", "george");
|
||||
env(fset("george", asfDisallowXRP));
|
||||
env(lockup("bob", "george", XRP(10), env.now() + 1s),
|
||||
ter (tecNO_TARGET));
|
||||
}
|
||||
{
|
||||
// Ignore the "asfDisallowXRP" account flag, which we should
|
||||
// have been doing before.
|
||||
Env env(*this);
|
||||
|
||||
env.fund(XRP(5000), "bob", "george");
|
||||
env(fset("george", asfDisallowXRP));
|
||||
env(lockup("bob", "george", XRP(10), env.now() + 1s));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
testFails()
|
||||
{
|
||||
@@ -331,11 +360,6 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
env.fund (accountReserve, "frank");
|
||||
env(lockup("frank", "bob", XRP(1), env.now() + 1s), ter (tecINSUFFICIENT_RESERVE));
|
||||
|
||||
// Respect the "asfDisallowXRP" account flag:
|
||||
env.fund (accountReserve + accountIncrement, "george");
|
||||
env(fset("george", asfDisallowXRP));
|
||||
env(lockup("bob", "george", XRP(10), env.now() + 1s), ter (tecNO_TARGET));
|
||||
|
||||
{ // Specify incorrect sequence number
|
||||
env.fund (XRP(5000), "hannah");
|
||||
auto const seq = env.seq("hannah");
|
||||
@@ -980,6 +1004,7 @@ struct Escrow_test : public beast::unit_test::suite
|
||||
{
|
||||
testEnablement();
|
||||
testTags();
|
||||
testDisallowXRP();
|
||||
testFails();
|
||||
testLockup();
|
||||
testEscrowConditions();
|
||||
|
||||
Reference in New Issue
Block a user