mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 18:45:55 +00:00
add uritoken delete test
This commit is contained in:
@@ -1307,7 +1307,6 @@ struct URIToken_test : public beast::unit_test::suite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: THIS TEST IS NOT COMPLETE
|
|
||||||
void
|
void
|
||||||
testAccountDelete(FeatureBitset features)
|
testAccountDelete(FeatureBitset features)
|
||||||
{
|
{
|
||||||
@@ -1367,8 +1366,8 @@ struct URIToken_test : public beast::unit_test::suite
|
|||||||
// alice has trustline + mint + sell
|
// alice has trustline + mint + sell
|
||||||
rmAccount(env, alice, bob, tecHAS_OBLIGATIONS);
|
rmAccount(env, alice, bob, tecHAS_OBLIGATIONS);
|
||||||
|
|
||||||
env(clear(alice, hexid));
|
// bob buys uri token
|
||||||
env(burn(alice, hexid));
|
env(buy(bob, hexid, USD(10)), ter(tesSUCCESS));
|
||||||
env.close();
|
env.close();
|
||||||
BEAST_EXPECT(!inOwnerDir(*env.current(), alice, tid));
|
BEAST_EXPECT(!inOwnerDir(*env.current(), alice, tid));
|
||||||
|
|
||||||
@@ -1376,25 +1375,22 @@ struct URIToken_test : public beast::unit_test::suite
|
|||||||
rmAccount(env, alice, bob, tecHAS_OBLIGATIONS);
|
rmAccount(env, alice, bob, tecHAS_OBLIGATIONS);
|
||||||
BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 1);
|
BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 1);
|
||||||
|
|
||||||
// drain pay all back and drain trustlin
|
// drain pay all back and drain trustline
|
||||||
env.trust(USD(0), alice);
|
env.trust(USD(0), alice);
|
||||||
env(pay(alice, gw, env.balance(alice, USD.issue())));
|
env(pay(alice, gw, env.balance(alice, USD.issue())));
|
||||||
BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0);
|
BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0);
|
||||||
|
|
||||||
// alice can delete account
|
// alice cant delete account - lsfURITokenIssuer
|
||||||
rmAccount(env, alice, bob);
|
rmAccount(env, alice, bob, tecHAS_OBLIGATIONS);
|
||||||
|
|
||||||
// buy should fail if the uri token was removed
|
// bob can mint same token with different tokenid
|
||||||
auto preBob = env.balance(bob, USD.issue());
|
|
||||||
env(buy(bob, hexid, USD(10)), ter(tecNO_ENTRY));
|
|
||||||
env.close();
|
|
||||||
BEAST_EXPECT(env.balance(bob, USD.issue()) == preBob);
|
|
||||||
|
|
||||||
// bob can mint same exact token because alice burned it
|
|
||||||
env(mint(bob, uri));
|
env(mint(bob, uri));
|
||||||
// need to use bobs account for tokenid
|
env.close();
|
||||||
auto const btid = tokenid(bob, uri);
|
auto const btid = tokenid(bob, uri);
|
||||||
BEAST_EXPECT(inOwnerDir(*env.current(), bob, btid));
|
BEAST_EXPECT(inOwnerDir(*env.current(), bob, btid));
|
||||||
|
|
||||||
|
// token ids are not the same
|
||||||
|
BEAST_EXPECT(btid != tid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user