Compare commits

..

7 Commits

Author SHA1 Message Date
Denis Angell
88a054a547 fix lock handling 2025-07-09 03:47:23 +02:00
Richard Holland
2f2ee17ae5 clang 2025-07-09 10:52:58 +10:00
RichardAH
d2f76185e0 Merge branch 'dev' into clawback 2025-07-09 10:46:54 +10:00
Denis Angell
16c7cd5e69 change tt number 2025-07-08 12:21:36 +02:00
Denis Angell
1002659103 fix feature.h 2025-07-08 11:01:14 +02:00
RichardAH
fe6a08bb24 Merge branch 'dev' into clawback 2025-07-08 18:15:01 +10:00
Denis Angell
0a30ef8b19 feature clawback 2025-07-08 08:04:03 +02:00
2 changed files with 22 additions and 127 deletions

View File

@@ -4147,8 +4147,7 @@ struct Escrow_test : public beast::unit_test::suite
env(trust(gw, USD(10'000), bob, tfSetFreeze | tfSetDeepFreeze));
env.close();
// bob cancel escrow succeeds despite deep frozen assets (unlocking
// return is allowed)
// bob cancel escrow fails because of deep frozen assets
env(escrow::cancel(bob, alice, seq1),
fee(baseFee),
ter(tesSUCCESS));
@@ -4658,4 +4657,4 @@ public:
BEAST_DEFINE_TESTSUITE(Escrow, app, ripple);
} // namespace test
} // namespace ripple
} // namespace ripple

View File

@@ -1932,135 +1932,31 @@ struct URIToken_test : public beast::unit_test::suite
env(pay(gw, bob, USD(1000)));
env.close();
{
// IOU bob(frozen) -> alice
// set freeze on bob trustline
env(trust(gw, USD(10000), bob, tfSetFreeze));
env.close();
// setup mint
std::string const uri(maxTokenURILength, '?');
auto const tid = uritoken::tokenid(alice, uri);
std::string const hexid{strHex(tid)};
env(uritoken::mint(alice, uri));
env(uritoken::sell(alice, hexid), uritoken::amt(USD(10)));
env.close();
// buy uritoken fails - frozen trustline
env(uritoken::buy(bob, hexid),
uritoken::amt(USD(10)),
ter(tecINSUFFICIENT_FUNDS));
env.close();
// clear freeze on bob trustline
env(trust(gw, USD(10000), bob, tfClearFreeze));
env.close();
// buy uri success
env(uritoken::buy(bob, hexid), uritoken::amt(USD(10)));
env.close();
}
{
// IOU alice -> bob(frozen)
// set freeze on bob trustline
env(trust(gw, USD(10000), bob, tfSetFreeze));
env.close();
// setup mint
std::string const uri(maxTokenURILength, '?');
auto const tid = uritoken::tokenid(bob, uri);
std::string const hexid{strHex(tid)};
env(uritoken::mint(bob, uri));
env(uritoken::sell(bob, hexid), uritoken::amt(USD(10)));
env.close();
// buy uritoken fails - frozen trustline
env(uritoken::buy(alice, hexid),
uritoken::amt(USD(10)),
ter(tecFROZEN));
env.close();
// clear freeze on bob trustline
env(trust(gw, USD(10000), bob, tfClearFreeze));
env.close();
// buy uri success
env(uritoken::buy(alice, hexid), uritoken::amt(USD(10)));
env.close();
}
}
// test DeepFreeze
{
// Env Setup
Env env{*this, features};
env.fund(XRP(1000), alice, bob, gw);
env.close();
env.trust(USD(100000), alice, bob);
env.close();
env(pay(gw, alice, USD(1000)));
env(pay(gw, bob, USD(1000)));
// set freeze on alice trustline
env(trust(gw, USD(10000), bob, tfSetFreeze));
env.close();
{
// set freeze on bob trustline
env(trust(gw, USD(10000), bob, tfSetFreeze | tfSetDeepFreeze));
env.close();
// setup mint
std::string const uri(maxTokenURILength, '?');
auto const tid = uritoken::tokenid(alice, uri);
std::string const hexid{strHex(tid)};
env(uritoken::mint(alice, uri));
env(uritoken::sell(alice, hexid), uritoken::amt(USD(10)));
env.close();
// IOU bob(frozen) -> alice
// setup mint
std::string const uri(maxTokenURILength, '?');
auto const tid = uritoken::tokenid(alice, uri);
std::string const hexid{strHex(tid)};
env(uritoken::mint(alice, uri));
env(uritoken::sell(alice, hexid), uritoken::amt(USD(10)));
env.close();
// buy uritoken fails - frozen trustline
env(uritoken::buy(bob, hexid),
uritoken::amt(USD(10)),
ter(tecINSUFFICIENT_FUNDS));
env.close();
// buy uritoken fails - frozen trustline
env(uritoken::buy(bob, hexid),
uritoken::amt(USD(10)),
ter(tecINSUFFICIENT_FUNDS));
env.close();
// clear freeze on alice trustline
env(trust(gw, USD(10000), bob, tfClearFreeze));
env.close();
// clear freeze on bob trustline
env(trust(
gw, USD(10000), bob, tfClearFreeze | tfClearDeepFreeze));
env.close();
// buy uri success
env(uritoken::buy(bob, hexid), uritoken::amt(USD(10)));
env.close();
}
{
// set freeze on bob trustline
env(trust(gw, USD(10000), bob, tfSetFreeze | tfSetDeepFreeze));
env.close();
// IOU alice -> bob(frozen)
// setup mint
std::string const uri(maxTokenURILength, '?');
auto const tid = uritoken::tokenid(bob, uri);
std::string const hexid{strHex(tid)};
env(uritoken::mint(bob, uri));
env(uritoken::sell(bob, hexid), uritoken::amt(USD(10)));
env.close();
// buy uritoken fails - frozen trustline
env(uritoken::buy(alice, hexid),
uritoken::amt(USD(10)),
ter(tecFROZEN));
env.close();
// clear freeze on bob trustline
env(trust(
gw, USD(10000), bob, tfClearFreeze | tfClearDeepFreeze));
env.close();
// buy uri success
env(uritoken::buy(alice, hexid), uritoken::amt(USD(10)));
env.close();
}
// buy uri success
env(uritoken::buy(bob, hexid), uritoken::amt(USD(10)));
env.close();
}
}