259 testcase(
"Validate authorize transaction");
261 using namespace test::jtx;
267 Env env{*
this, features - featureMPTokensV1};
268 MPTTester mptAlice(env, alice, {.holders = {bob}});
275 Env env{*
this, features};
276 MPTTester mptAlice(env, alice, {.holders = {bob}});
278 mptAlice.
create({.ownerCount = 1});
282 mptAlice.authorize({.account = bob, .flags = 0x00000002, .err =
temINVALID_FLAG});
284 mptAlice.authorize({.account = bob, .holder = bob, .err =
temMALFORMED});
286 mptAlice.authorize({.holder = alice, .err =
temMALFORMED});
292 Env env{*
this, features};
293 MPTTester mptAlice(env, alice, {.holders = {bob}});
294 auto const id =
makeMptID(env.seq(alice), alice);
304 Env env{*
this, features};
305 MPTTester mptAlice(env, alice, {.holders = {bob}});
307 mptAlice.
create({.ownerCount = 1});
310 mptAlice.authorize({.account = bob, .holder = alice, .err =
tecNO_PERMISSION});
316 mptAlice.authorize({.holder = bob, .err =
tecNO_AUTH});
319 mptAlice.authorize({.account = bob, .holderCount = 1});
322 mptAlice.authorize({.account = bob, .err =
tecDUPLICATE});
328 mptAlice.pay(alice, bob, 100);
335 mptAlice.pay(bob, alice, 100);
349 Env env{*
this, features};
350 MPTTester mptAlice(env, alice, {.holders = {bob}});
362 mptAlice.authorize({.holder = cindy, .err =
tecNO_DST});
365 mptAlice.authorize({.account = bob, .holderCount = 1});
374 mptAlice.authorize({.holder = bob});
379 mptAlice.authorize({.holder = bob});
382 mptAlice.authorize({.account = bob, .holderCount = 0, .flags =
tfMPTUnauthorize});
387 Env env{*
this, features};
388 auto const acctReserve = env.current()->fees().reserve;
389 auto const incReserve = env.current()->fees().increment;
393 MPTTester mptAlice1(env, alice, {.holders = {bob}, .xrpHolders = acctReserve + (incReserve - 1)});
396 MPTTester mptAlice2(env, alice, {.fund =
false});
399 MPTTester mptAlice3(env, alice, {.fund =
false});
400 mptAlice3.
create({.ownerCount = 3});
403 mptAlice1.authorize({.account = bob, .holderCount = 1});
406 mptAlice2.authorize({.account = bob, .holderCount = 2});
410 env(
pay(env.master, bob,
drops(incReserve + incReserve + incReserve)));
413 mptAlice3.authorize({.account = bob, .holderCount = 3});
760 using namespace test::jtx;
769 Env env{*
this, features - featureMPTokensV1};
773 env.fund(
XRP(1'000), alice);
774 env.fund(
XRP(1'000), bob);
782 Env env{*
this, features - featureMPTokensV1};
785 auto const USD = alice[
"USD"];
787 env.fund(
XRP(1'000), alice);
788 env.fund(
XRP(1'000), carol);
792 jv[jss::secret] = alice.
name();
793 jv[jss::tx_json] =
pay(alice, carol, mpt);
794 jv[jss::tx_json][jss::Fee] =
to_string(env.current()->fees().base);
795 auto const jrr = env.rpc(
"json",
"submit",
to_string(jv));
796 BEAST_EXPECT(jrr[jss::result][jss::engine_result] ==
"temDISABLED");
801 Env env{*
this, features};
803 MPTTester mptAlice(env, alice, {.holders = {bob}});
805 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
806 auto const MPT = mptAlice[
"MPT"];
808 mptAlice.authorize({.account = bob});
816 Env env{*
this, features};
820 MPTTester mptAlice(env, alice, {.holders = {carol}});
822 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
824 mptAlice.authorize({.account = carol});
828 auto const MPT = mptAlice[
"MPT"];
832 auto const USD = alice[
"USD"];
846 Env env{*
this, features};
850 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
852 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
853 auto const MPT = mptAlice[
"MPT"];
855 mptAlice.authorize({.account = carol});
858 payment[jss::secret] = alice.
name();
859 payment[jss::tx_json] =
pay(alice, carol,
MPT(100));
861 payment[jss::build_path] =
true;
862 auto jrr = env.rpc(
"json",
"submit",
to_string(payment));
863 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
864 BEAST_EXPECT(jrr[jss::result][jss::error_message] ==
"Field 'build_path' not allowed in this context.");
869 Env env{*
this, features};
871 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
873 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
874 auto const MPT = mptAlice[
"MPT"];
876 mptAlice.authorize({.account = bob});
877 mptAlice.authorize({.account = carol});
890 Env env{*
this, features};
892 MPTTester mptAlice(env, alice, {.holders = {bob}});
894 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
896 mptAlice.authorize({.account = bob});
905 Env env{*
this, features};
907 MPTTester mptAlice(env, alice, {.holders = {bob}});
909 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
911 mptAlice.authorize({.account = bob});
924 Env env{*
this, features};
926 MPTTester mptAlice(env, alice, {.holders = {bob}});
930 mptAlice.authorize({.account = bob});
938 Env env{*
this, features};
940 MPTTester mptAlice(env, alice, {.holders = {bob}});
945 mptAlice.authorize({.account = bob});
948 mptAlice.authorize({.account = alice, .holder = bob});
951 mptAlice.pay(alice, bob, 100);
954 mptAlice.authorize({.account = alice, .holder = bob, .flags =
tfMPTUnauthorize});
961 if (features[featureSingleAssetVault] && features[featurePermissionedDomains])
965 Env env{*
this, features};
967 Account const credIssuer1{
"credIssuer1"};
968 env.fund(
XRP(1000), credIssuer1, bob);
970 auto const domainId1 = [&]() {
991 .domainID = domainId1,
998 mptAlice.
pay(alice, bob, 100);
999 mptAlice.
set({.domainID = beast::zero});
1006 Env env{*
this, features};
1008 Account const credIssuer1{
"credIssuer1"};
1009 env.fund(
XRP(1000), credIssuer1, bob);
1011 auto const domainId1 = [&]() {
1032 .domainID = domainId1,
1039 mptAlice.
authorize({.account = alice, .holder = bob});
1042 mptAlice.
pay(alice, bob, 100);
1048 mptAlice.
pay(bob, alice, 10);
1050 mptAlice.
set({.domainID = beast::zero});
1058 Env env{*
this, features};
1061 Account const credIssuer1{
"credIssuer1"};
1064 Account const credIssuer2{
"credIssuer2"};
1065 env.fund(
XRP(1000), credIssuer1, credIssuer2, bob, carol);
1067 auto const domainId1 = [&]() {
1077 auto const domainId2 = [&]() {
1079 {.issuer = credIssuer1, .credType = credType}, {.issuer = credIssuer2, .credType = credType}};
1107 .domainID = domainId1,
1116 mptAlice.
pay(alice, bob, 50);
1127 mptAlice.
set({.domainID = domainId2});
1129 mptAlice.
pay(alice, carol, 10);
1134 mptAlice.
pay(bob, carol, 10);
1148 Env env(*
this, features);
1153 MPTTester mptAlice(env, alice, {.holders = {bob, cindy}});
1156 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1159 mptAlice.authorize({.account = bob});
1162 mptAlice.authorize({.account = cindy});
1165 mptAlice.pay(alice, bob, 100);
1172 mptAlice.pay(bob, alice, 10);
1177 Env env{*
this, features};
1179 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1195 Env env{*
this, features};
1197 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1201 mptAlice.authorize({.account = bob});
1202 mptAlice.authorize({.account = carol});
1204 mptAlice.pay(alice, bob, 100);
1215 Env env{*
this, features};
1217 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1221 mptAlice.authorize({.account = bob});
1222 mptAlice.authorize({.account = carol});
1224 mptAlice.pay(alice, bob, 100);
1225 mptAlice.pay(alice, carol, 100);
1228 mptAlice.set({.account = alice, .flags =
tfMPTLock});
1233 mptAlice.pay(alice, bob, 3);
1235 mptAlice.pay(bob, alice, 4);
1238 mptAlice.set({.account = alice, .flags =
tfMPTUnlock});
1240 mptAlice.set({.account = alice, .holder = bob, .flags =
tfMPTLock});
1245 mptAlice.pay(alice, bob, 7);
1247 mptAlice.pay(bob, alice, 8);
1252 Env env{*
this, features};
1254 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1260 mptAlice.authorize({.account = bob});
1261 mptAlice.authorize({.account = carol});
1264 mptAlice.pay(alice, bob, 2'000);
1267 mptAlice.pay(bob, alice, 1'000);
1268 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 1'000));
1278 auto const MPT = mptAlice[
"MPT"];
1287 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 780));
1288 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 200));
1294 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 690));
1295 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 282));
1300 Env env{*
this, features};
1302 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1307 mptAlice.authorize({.account = bob});
1308 mptAlice.authorize({.account = carol});
1309 mptAlice.pay(alice, bob, 1'000);
1311 auto const MPT = mptAlice[
"MPT"];
1318 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 100));
1321 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 199));
1326 Env env{*
this, features};
1328 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1333 mptAlice.authorize({.account = bob});
1334 mptAlice.authorize({.account = carol});
1335 mptAlice.pay(alice, bob, 1'000);
1337 auto const MPT = mptAlice[
"MPT"];
1340 env(
pay(bob, alice,
MPT(100)),
1351 Env env{*
this, features};
1353 MPTTester mptAlice(env, alice, {.holders = {bob}});
1357 mptAlice.authorize({.account = bob});
1360 mptAlice.pay(alice, bob, 100);
1369 Env env{*
this, features};
1371 MPTTester mptAlice(env, alice, {.holders = {bob}});
1373 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1375 mptAlice.authorize({.account = bob});
1387 Env env{*
this, features};
1388 env.fund(
XRP(1'000), alice, bob);
1391 jv[jss::secret] = alice.
name();
1392 jv[jss::tx_json] =
pay(alice, bob, mpt);
1394 auto const jrr = env.rpc(
"json",
"submit",
to_string(jv));
1395 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1401 Env env{*
this, features};
1403 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1406 {.maxAmt = 10'000, .transferFee = 100, .ownerCount = 1, .holderCount = 0, .flags =
tfMPTCanTransfer});
1407 auto const MPT = mptAlice[
"MPT"];
1409 mptAlice.authorize({.account = bob});
1410 mptAlice.authorize({.account = carol});
1413 mptAlice.pay(alice, bob, 10'000);
1418 auto const meta = env.meta()->getJson(
JsonOptions::none)[sfAffectedNodes.fieldName];
1421 meta[0u][sfModifiedNode.fieldName][sfFinalFields.fieldName][sfOutstandingAmount.fieldName] ==
"9990");
1423 BEAST_EXPECT(meta[1u][sfModifiedNode.fieldName][sfFinalFields.fieldName][sfMPTAmount.fieldName] ==
"9990");
1426 meta[2u][sfModifiedNode.fieldName][sfPreviousFields.fieldName][sfMPTAmount.fieldName] ==
"10000");
1427 BEAST_EXPECT(!meta[2u][sfModifiedNode.fieldName][sfFinalFields.fieldName].isMember(sfMPTAmount.fieldName));
1436 Env env{*
this, features};
1438 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1441 auto const MPT = mptAlice[
"MPT"];
1443 mptAlice.authorize({.account = bob});
1444 mptAlice.authorize({.account = carol});
1455 BEAST_EXPECT(mptAlice.checkMPTokenOutstandingAmount(0));
1460 Env env{*
this, features};
1462 MPTTester mptAlice(env, alice, {.holders = {bob}});
1464 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1466 mptAlice.authorize({.account = bob});
1469 mptAlice.destroy({.ownerCount = 0});
1478 Env env{*
this, features};
1480 env.fund(
XRP(1'000), alice, bob);
1489 Env env{*
this, features};
1491 MPTTester mptAlice(env, alice, {.holders = {bob}});
1493 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1496 mptAlice.destroy({.ownerCount = 0});
1506 Env env{*
this, features};
1511 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1515 mptAlice.authorize({.account = bob});
1516 mptAlice.authorize({.account = carol});
1518 mptAlice.pay(alice, bob, 100);
1521 mptAlice.pay(bob, carol, 100);
1526 Env env{*
this, features};
1528 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1532 mptAlice.authorize({.account = bob});
1533 mptAlice.authorize({.account = carol});
1536 mptAlice.pay(alice, bob, 100);
1539 mptAlice.pay(bob, alice, 100);
1542 mptAlice.pay(alice, bob, 100);
1543 mptAlice.pay(bob, carol, 50);
1695 testcase(
"MPT Issue Invalid in Transaction");
1696 using namespace test::jtx;
1705 for (
auto const& e : format.getSOTemplate())
1711 format.getName() != jss::SetFee)
1713 txWithAmounts.
insert(format.getName() + e.sField().fieldName);
1720 auto const USD = alice[
"USD"];
1723 STAmount mpt{issue, UINT64_C(100)};
1724 auto const jvb =
bridge(alice, USD, alice, USD);
1725 for (
auto const& feature : {features, features - featureMPTokensV1})
1727 Env env{*
this, feature};
1728 env.fund(
XRP(1'000), alice);
1729 env.fund(
XRP(1'000), carol);
1731 txWithAmounts.
erase(jv[jss::TransactionType].asString() + mptField);
1734 auto jtx = env.jt(jv);
1738 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidTransaction");
1742 jv1[jss::secret] = alice.
name();
1743 jv1[jss::tx_json] = jv;
1744 jrr = env.rpc(
"json",
"submit",
to_string(jv1));
1745 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1747 jrr = env.rpc(
"json",
"sign",
to_string(jv1));
1748 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1750 auto toSFieldRef = [](
SField const& field) {
return std::ref(field); };
1751 auto setMPTFields = [&](
SField const& field,
Json::Value& jv,
bool withAmount =
true) {
1753 jv[jss::Asset2] =
to_json(USD.issue());
1756 if (field == sfAsset)
1758 else if (field == sfAsset2)
1768 auto ammCreate = [&](
SField const& field) {
1770 jv[jss::TransactionType] = jss::AMMCreate;
1771 jv[jss::Account] = alice.
human();
1773 (field.fieldName == sfAmount.fieldName) ? mpt.getJson(
JsonOptions::none) :
"100000000";
1775 (field.fieldName == sfAmount2.fieldName) ? mpt.getJson(
JsonOptions::none) :
"100000000";
1776 jv[jss::TradingFee] = 0;
1777 test(jv, field.fieldName);
1779 ammCreate(sfAmount);
1780 ammCreate(sfAmount2);
1782 auto ammDeposit = [&](
SField const& field) {
1784 jv[jss::TransactionType] = jss::AMMDeposit;
1785 jv[jss::Account] = alice.
human();
1787 setMPTFields(field, jv);
1788 test(jv, field.fieldName);
1790 for (
SField const& field :
1791 {toSFieldRef(sfAmount),
1792 toSFieldRef(sfAmount2),
1793 toSFieldRef(sfEPrice),
1794 toSFieldRef(sfLPTokenOut),
1795 toSFieldRef(sfAsset),
1796 toSFieldRef(sfAsset2)})
1799 auto ammWithdraw = [&](
SField const& field) {
1801 jv[jss::TransactionType] = jss::AMMWithdraw;
1802 jv[jss::Account] = alice.
human();
1804 setMPTFields(field, jv);
1805 test(jv, field.fieldName);
1807 ammWithdraw(sfAmount);
1808 for (
SField const& field :
1809 {toSFieldRef(sfAmount2),
1810 toSFieldRef(sfEPrice),
1811 toSFieldRef(sfLPTokenIn),
1812 toSFieldRef(sfAsset),
1813 toSFieldRef(sfAsset2)})
1816 auto ammBid = [&](
SField const& field) {
1818 jv[jss::TransactionType] = jss::AMMBid;
1819 jv[jss::Account] = alice.
human();
1820 setMPTFields(field, jv);
1821 test(jv, field.fieldName);
1823 for (
SField const& field :
1824 {toSFieldRef(sfBidMin), toSFieldRef(sfBidMax), toSFieldRef(sfAsset), toSFieldRef(sfAsset2)})
1827 auto ammClawback = [&](
SField const& field) {
1829 jv[jss::TransactionType] = jss::AMMClawback;
1830 jv[jss::Account] = alice.
human();
1831 jv[jss::Holder] = carol.
human();
1832 setMPTFields(field, jv);
1833 test(jv, field.fieldName);
1835 for (
SField const& field : {toSFieldRef(sfAmount), toSFieldRef(sfAsset), toSFieldRef(sfAsset2)})
1838 auto ammDelete = [&](
SField const& field) {
1840 jv[jss::TransactionType] = jss::AMMDelete;
1841 jv[jss::Account] = alice.
human();
1842 setMPTFields(field, jv,
false);
1843 test(jv, field.fieldName);
1846 ammDelete(sfAsset2);
1848 auto ammVote = [&](
SField const& field) {
1850 jv[jss::TransactionType] = jss::AMMVote;
1851 jv[jss::Account] = alice.
human();
1852 jv[jss::TradingFee] = 100;
1853 setMPTFields(field, jv,
false);
1854 test(jv, field.fieldName);
1859 auto checkCash = [&](
SField const& field) {
1861 jv[jss::TransactionType] = jss::CheckCash;
1862 jv[jss::Account] = alice.
human();
1865 test(jv, field.fieldName);
1867 checkCash(sfAmount);
1868 checkCash(sfDeliverMin);
1872 jv[jss::TransactionType] = jss::CheckCreate;
1873 jv[jss::Account] = alice.
human();
1874 jv[jss::Destination] = carol.
human();
1876 test(jv, jss::SendMax.c_str());
1881 test(jv, jss::TakerPays.c_str());
1882 jv =
offer(alice, mpt, USD(100));
1883 test(jv, jss::TakerGets.c_str());
1888 jv[jss::TransactionType] = jss::PaymentChannelCreate;
1889 jv[jss::Account] = alice.
human();
1890 jv[jss::Destination] = carol.
human();
1891 jv[jss::SettleDelay] = 1;
1894 test(jv, jss::Amount.c_str());
1899 jv[jss::TransactionType] = jss::PaymentChannelFund;
1900 jv[jss::Account] = alice.
human();
1903 test(jv, jss::Amount.c_str());
1908 jv[jss::TransactionType] = jss::PaymentChannelClaim;
1909 jv[jss::Account] = alice.
human();
1912 test(jv, jss::Amount.c_str());
1917 jv[jss::TransactionType] = jss::NFTokenCreateOffer;
1918 jv[jss::Account] = alice.
human();
1921 test(jv, jss::Amount.c_str());
1926 jv[jss::TransactionType] = jss::NFTokenAcceptOffer;
1927 jv[jss::Account] = alice.
human();
1929 test(jv, sfNFTokenBrokerFee.fieldName);
1934 jv[jss::TransactionType] = jss::NFTokenMint;
1935 jv[jss::Account] = alice.
human();
1936 jv[sfNFTokenTaxon.fieldName] = 1;
1938 test(jv, jss::Amount.c_str());
1941 auto trustSet = [&](
SField const& field) {
1943 jv[jss::TransactionType] = jss::TrustSet;
1944 jv[jss::Account] = alice.
human();
1947 test(jv, field.fieldName);
1949 trustSet(sfLimitAmount);
1954 test(jv, jss::Amount.c_str());
1959 test(jv, jss::Amount.c_str());
1964 test(jv, sfSignatureReward.fieldName);
1969 test(jv, jss::Amount.c_str());
1975 for (
auto const& field : {sfAmount.fieldName, sfSignatureReward.fieldName})
1984 for (
auto const& field : {sfAmount.fieldName, sfSignatureReward.fieldName})
1996 jv[jss::TransactionType] = tt;
1997 jv[jss::Account] = alice.
human();
1998 jv[sfXChainBridge.fieldName] = jvb;
2000 jv[sfMinAccountCreateAmount.fieldName] = minAccountAmount.getJson(
JsonOptions::none);
2003 auto reward =
STAmount{sfSignatureReward, mpt};
2004 auto minAmount =
STAmount{sfMinAccountCreateAmount, USD(10)};
2007 bridgeTx(jss::XChainCreateBridge, reward, minAmount, field.fieldName);
2008 bridgeTx(jss::XChainModifyBridge, reward, minAmount, field.fieldName);
2009 reward =
STAmount{sfSignatureReward, USD(10)};
2010 minAmount =
STAmount{sfMinAccountCreateAmount, mpt};
2013 BEAST_EXPECT(txWithAmounts.
empty());
2451 testcase(
"invalid MPTokenIssuanceSet for DynamicMPT");
2453 using namespace test::jtx;
2460 Env env{*
this, features - featureDynamicMPT};
2461 MPTTester mptAlice(env, alice, {.holders = {bob}});
2462 auto const mptID =
makeMptID(env.seq(alice), alice);
2465 mptAlice.set({.account = alice, .
id = mptID, .mutableFlags = 2, .err =
temDISABLED});
2466 mptAlice.set({.account = alice, .
id = mptID, .mutableFlags = 0, .err =
temDISABLED});
2469 mptAlice.set({.account = alice, .
id = mptID, .metadata =
"test", .err =
temDISABLED});
2470 mptAlice.set({.account = alice, .
id = mptID, .metadata =
"", .err =
temDISABLED});
2473 mptAlice.set({.account = alice, .
id = mptID, .transferFee = 100, .err =
temDISABLED});
2474 mptAlice.set({.account = alice, .
id = mptID, .transferFee = 0, .err =
temDISABLED});
2480 Env env{*
this, features};
2481 MPTTester mptAlice(env, alice, {.holders = {bob}});
2482 auto const mptID =
makeMptID(env.seq(alice), alice);
2485 mptAlice.set({.account = alice, .holder = bob, .
id = mptID, .mutableFlags = 2, .err =
temMALFORMED});
2488 mptAlice.set({.account = alice, .holder = bob, .
id = mptID, .metadata =
"test", .err =
temMALFORMED});
2491 mptAlice.set({.account = alice, .holder = bob, .
id = mptID, .transferFee = 100, .err =
temMALFORMED});
2497 Env env{*
this, features};
2498 MPTTester mptAlice(env, alice, {.holders = {bob}});
2515 Env env{*
this, features};
2516 MPTTester mptAlice(env, alice, {.holders = {bob}});
2524 mptAlice.set({.account = alice, .flags = 0, .transferFee = 100, .metadata =
"test"});
2525 mptAlice.set({.account = alice, .flags =
tfFullyCanonicalSig, .transferFee = 200, .metadata =
"test2"});
2530 Env env{*
this, features};
2531 MPTTester mptAlice(env, alice, {.holders = {bob}});
2532 auto const mptID =
makeMptID(env.seq(alice), alice);
2534 for (
auto const flags : {10000, 0, 5000})
2542 Env env{*
this, features};
2543 MPTTester mptAlice(env, alice, {.holders = {bob}});
2544 auto const mptID =
makeMptID(env.seq(alice), alice);
2546 auto const flagCombinations = {
2556 for (
auto const& mutableFlags : flagCombinations)
2558 mptAlice.set({.account = alice, .
id = mptID, .mutableFlags = mutableFlags, .err =
temINVALID_FLAG});
2564 Env env{*
this, features};
2565 MPTTester mptAlice(env, alice, {.holders = {bob}});
2567 mptAlice.
create({.ownerCount = 1});
2569 auto const mutableFlags = {
2583 for (
auto const& mutableFlag : mutableFlags)
2585 mptAlice.set({.account = alice, .mutableFlags = mutableFlag, .err =
tecNO_PERMISSION});
2591 Env env{*
this, features};
2592 MPTTester mptAlice(env, alice, {.holders = {bob}});
2597 mptAlice.set({.account = alice, .metadata = metadata, .err =
temMALFORMED});
2602 Env env{*
this, features};
2603 MPTTester mptAlice(env, alice, {.holders = {bob}});
2605 mptAlice.
create({.ownerCount = 1});
2606 mptAlice.set({.account = alice, .metadata =
"test", .err =
tecNO_PERMISSION});
2611 Env env{*
this, features};
2612 MPTTester mptAlice(env, alice, {.holders = {bob}});
2613 auto const mptID =
makeMptID(env.seq(alice), alice);
2624 Env env{*
this, features};
2625 MPTTester mptAlice(env, alice, {.holders = {bob}});
2628 {.transferFee = 100,
2642 BEAST_EXPECT(!mptAlice.isTransferFeePresent());
2647 Env env{*
this, features};
2648 MPTTester mptAlice(env, alice, {.holders = {bob}});
2652 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2663 Env env{*
this, features};
2664 MPTTester mptAlice(env, alice, {.holders = {bob}});
2668 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2670 mptAlice.set({.account = alice, .transferFee = 0, .err =
tecNO_PERMISSION});
2675 Env env{*
this, features};
2676 MPTTester mptAlice(env, alice, {.holders = {bob}});
2683 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2685 auto const invalidFlags = {
2696 for (
auto const& mutableFlag : invalidFlags)
2698 mptAlice.set({.account = alice, .mutableFlags = mutableFlag, .err =
tecNO_PERMISSION});
2710 mptAlice.set({.account = alice, .metadata =
"test"});
2711 mptAlice.set({.account = alice, .metadata =
""});