Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed May 31, 2023
1 parent 253093a commit 9af831d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/app/Clawback_test.cpp
Expand Up @@ -339,6 +339,27 @@ class Clawback_test : public beast::unit_test::suite
testcase("Permission");
using namespace test::jtx;

// Clawing back from an non-existent account returns error
{
Env env(*this, features);

Account alice{"alice"};
Account bob{"bob"};

// bob's account is not funded and does not exist
env.fund(XRP(1000), alice);
env.close();

// alice sets asfAllowClawback
env(fset(alice, asfAllowClawback));
env.close();
env.require(flags(alice, asfAllowClawback));

// bob, the token holder, does not exist
env(claw(alice, bob["USD"](5)), ter(terNO_ACCOUNT));
env.close();
}

// Test that trustline cannot be clawed by someone who is
// not the issuer of the currency
{
Expand Down

0 comments on commit 9af831d

Please sign in to comment.