282 testcase(
"Validate authorize transaction");
284 using namespace test::jtx;
290 Env env{*
this, features - featureMPTokensV1};
291 MPTTester mptAlice(env, alice, {.holders = {bob}});
299 Env env{*
this, features};
300 MPTTester mptAlice(env, alice, {.holders = {bob}});
302 mptAlice.
create({.ownerCount = 1});
306 mptAlice.authorize({.account = bob, .flags = 0x00000002, .err =
temINVALID_FLAG});
308 mptAlice.authorize({.account = bob, .holder = bob, .err =
temMALFORMED});
310 mptAlice.authorize({.holder = alice, .err =
temMALFORMED});
316 Env env{*
this, features};
317 MPTTester mptAlice(env, alice, {.holders = {bob}});
318 auto const id =
makeMptID(env.seq(alice), alice);
328 Env env{*
this, features};
329 MPTTester mptAlice(env, alice, {.holders = {bob}});
331 mptAlice.
create({.ownerCount = 1});
334 mptAlice.authorize({.account = bob, .holder = alice, .err =
tecNO_PERMISSION});
340 mptAlice.authorize({.holder = bob, .err =
tecNO_AUTH});
343 mptAlice.authorize({.account = bob, .holderCount = 1});
346 mptAlice.authorize({.account = bob, .err =
tecDUPLICATE});
352 mptAlice.pay(alice, bob, 100);
360 mptAlice.pay(bob, alice, 100);
364 mptAlice.authorize({.account = bob, .flags = tfMPTUnauthorize});
371 .flags = tfMPTUnauthorize,
377 Env env{*
this, features};
378 MPTTester mptAlice(env, alice, {.holders = {bob}});
380 mptAlice.
create({.ownerCount = 1, .flags = tfMPTRequireAuth});
390 mptAlice.authorize({.holder = cindy, .err =
tecNO_DST});
393 mptAlice.authorize({.account = bob, .holderCount = 1});
398 mptAlice.authorize({.holder = bob, .flags = tfMPTUnauthorize});
402 mptAlice.authorize({.holder = bob});
407 mptAlice.authorize({.holder = bob});
410 mptAlice.authorize({.account = bob, .holderCount = 0, .flags = tfMPTUnauthorize});
415 Env env{*
this, features};
416 auto const acctReserve = env.current()->fees().reserve;
417 auto const incReserve = env.current()->fees().increment;
422 env, alice, {.holders = {bob}, .xrpHolders = acctReserve + (incReserve - 1)});
425 MPTTester mptAlice2(env, alice, {.fund =
false});
428 MPTTester mptAlice3(env, alice, {.fund =
false});
429 mptAlice3.
create({.ownerCount = 3});
432 mptAlice1.authorize({.account = bob, .holderCount = 1});
435 mptAlice2.authorize({.account = bob, .holderCount = 2});
439 env(
pay(env.master, bob,
drops(incReserve + incReserve + incReserve)));
442 mptAlice3.authorize({.account = bob, .holderCount = 3});
816 using namespace test::jtx;
825 Env env{*
this, features - featureMPTokensV1};
829 env.fund(
XRP(1'000), alice);
830 env.fund(
XRP(1'000), bob);
838 Env env{*
this, features - featureMPTokensV1};
841 auto const USD = alice[
"USD"];
843 env.fund(
XRP(1'000), alice);
844 env.fund(
XRP(1'000), carol);
848 jv[jss::secret] = alice.
name();
849 jv[jss::tx_json] =
pay(alice, carol, mpt);
850 jv[jss::tx_json][jss::Fee] =
to_string(env.current()->fees().base);
851 auto const jrr = env.rpc(
"json",
"submit",
to_string(jv));
852 BEAST_EXPECT(jrr[jss::result][jss::engine_result] ==
"temDISABLED");
857 Env env{*
this, features};
859 MPTTester mptAlice(env, alice, {.holders = {bob}});
861 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
862 auto const MPT = mptAlice[
"MPT"];
864 mptAlice.authorize({.account = bob});
866 for (
auto flags : {tfNoRippleDirect, tfLimitQuality})
872 Env env{*
this, features};
876 MPTTester mptAlice(env, alice, {.holders = {carol}});
878 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
880 mptAlice.authorize({.account = carol});
884 auto const MPT = mptAlice[
"MPT"];
888 auto const USD = alice[
"USD"];
902 Env env{*
this, features};
906 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
908 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
909 auto const MPT = mptAlice[
"MPT"];
911 mptAlice.authorize({.account = carol});
914 payment[jss::secret] = alice.
name();
915 payment[jss::tx_json] =
pay(alice, carol,
MPT(100));
917 payment[jss::build_path] =
true;
918 auto jrr = env.rpc(
"json",
"submit",
to_string(payment));
919 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
921 jrr[jss::result][jss::error_message] ==
922 "Field 'build_path' not allowed in this context.");
927 Env env{*
this, features};
929 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
931 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
932 auto const MPT = mptAlice[
"MPT"];
934 mptAlice.authorize({.account = bob});
935 mptAlice.authorize({.account = carol});
948 Env env{*
this, features};
950 MPTTester mptAlice(env, alice, {.holders = {bob}});
952 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
954 mptAlice.authorize({.account = bob});
963 Env env{*
this, features};
965 MPTTester mptAlice(env, alice, {.holders = {bob}});
967 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
969 mptAlice.authorize({.account = bob});
982 Env env{*
this, features};
984 MPTTester mptAlice(env, alice, {.holders = {bob}});
987 {.ownerCount = 1, .holderCount = 0, .flags = tfMPTRequireAuth | tfMPTCanTransfer});
989 mptAlice.authorize({.account = bob});
997 Env env{*
this, features};
999 MPTTester mptAlice(env, alice, {.holders = {bob}});
1002 {.ownerCount = 1, .holderCount = 0, .flags = tfMPTRequireAuth | tfMPTCanTransfer});
1005 mptAlice.authorize({.account = bob});
1008 mptAlice.authorize({.account = alice, .holder = bob});
1011 mptAlice.pay(alice, bob, 100);
1014 mptAlice.authorize({.account = alice, .holder = bob, .flags = tfMPTUnauthorize});
1021 if (features[featureSingleAssetVault] && features[featurePermissionedDomains])
1025 Env env{*
this, features};
1027 Account const credIssuer1{
"credIssuer1"};
1028 env.fund(
XRP(1000), credIssuer1, bob);
1030 auto const domainId1 = [&]() {
1032 {.issuer = credIssuer1, .credType = credType}};
1051 .flags = tfMPTRequireAuth | tfMPTCanTransfer,
1052 .domainID = domainId1,
1059 mptAlice.
pay(alice, bob, 100);
1060 mptAlice.
set({.domainID = beast::zero});
1067 Env env{*
this, features};
1069 Account const credIssuer1{
"credIssuer1"};
1070 env.fund(
XRP(1000), credIssuer1, bob);
1072 auto const domainId1 = [&]() {
1074 {.issuer = credIssuer1, .credType = credType}};
1093 .flags = tfMPTRequireAuth | tfMPTCanTransfer,
1094 .domainID = domainId1,
1101 mptAlice.
authorize({.account = alice, .holder = bob});
1104 mptAlice.
pay(alice, bob, 100);
1107 mptAlice.
authorize({.account = alice, .holder = bob, .flags = tfMPTUnauthorize});
1110 mptAlice.
pay(bob, alice, 10);
1112 mptAlice.
set({.domainID = beast::zero});
1120 Env env{*
this, features};
1123 Account const credIssuer1{
"credIssuer1"};
1126 Account const credIssuer2{
"credIssuer2"};
1127 env.fund(
XRP(1000), credIssuer1, credIssuer2, bob, carol);
1129 auto const domainId1 = [&]() {
1131 {.issuer = credIssuer1, .credType = credType}};
1140 auto const domainId2 = [&]() {
1142 {.issuer = credIssuer1, .credType = credType},
1143 {.issuer = credIssuer2, .credType = credType}};
1170 .flags = tfMPTRequireAuth | tfMPTCanTransfer,
1171 .domainID = domainId1,
1180 mptAlice.
pay(alice, bob, 50);
1191 mptAlice.
set({.domainID = domainId2});
1193 mptAlice.
pay(alice, carol, 10);
1198 mptAlice.
pay(bob, carol, 10);
1212 Env env(*
this, features);
1217 MPTTester mptAlice(env, alice, {.holders = {bob, cindy}});
1220 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1223 mptAlice.authorize({.account = bob});
1226 mptAlice.authorize({.account = cindy});
1229 mptAlice.pay(alice, bob, 100);
1236 mptAlice.pay(bob, alice, 10);
1241 Env env{*
this, features};
1243 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1245 mptAlice.
create({.ownerCount = 1, .holderCount = 0, .flags = tfMPTCanTransfer});
1259 Env env{*
this, features};
1261 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1263 mptAlice.
create({.ownerCount = 1, .flags = tfMPTCanTransfer});
1265 mptAlice.authorize({.account = bob});
1266 mptAlice.authorize({.account = carol});
1268 mptAlice.pay(alice, bob, 100);
1279 Env env{*
this, features};
1281 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1283 mptAlice.
create({.ownerCount = 1, .flags = tfMPTCanLock | tfMPTCanTransfer});
1285 mptAlice.authorize({.account = bob});
1286 mptAlice.authorize({.account = carol});
1288 mptAlice.pay(alice, bob, 100);
1289 mptAlice.pay(alice, carol, 100);
1292 mptAlice.set({.account = alice, .flags = tfMPTLock});
1297 mptAlice.pay(alice, bob, 3);
1299 mptAlice.pay(bob, alice, 4);
1302 mptAlice.set({.account = alice, .flags = tfMPTUnlock});
1304 mptAlice.set({.account = alice, .holder = bob, .flags = tfMPTLock});
1309 mptAlice.pay(alice, bob, 7);
1311 mptAlice.pay(bob, alice, 8);
1316 Env env{*
this, features};
1318 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1322 {.transferFee = 10'000,
1325 .flags = tfMPTCanTransfer});
1328 mptAlice.authorize({.account = bob});
1329 mptAlice.authorize({.account = carol});
1332 mptAlice.pay(alice, bob, 2'000);
1335 mptAlice.pay(bob, alice, 1'000);
1336 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 1'000));
1346 auto const MPT = mptAlice[
"MPT"];
1355 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 780));
1356 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 200));
1362 BEAST_EXPECT(mptAlice.checkMPTokenAmount(bob, 690));
1363 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 282));
1368 Env env{*
this, features};
1370 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1372 mptAlice.
create({.ownerCount = 1, .holderCount = 0, .flags = tfMPTCanTransfer});
1375 mptAlice.authorize({.account = bob});
1376 mptAlice.authorize({.account = carol});
1377 mptAlice.pay(alice, bob, 1'000);
1379 auto const MPT = mptAlice[
"MPT"];
1386 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 100));
1389 BEAST_EXPECT(mptAlice.checkMPTokenAmount(carol, 199));
1394 Env env{*
this, features};
1396 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1398 mptAlice.
create({.ownerCount = 1, .holderCount = 0, .flags = tfMPTCanTransfer});
1401 mptAlice.authorize({.account = bob});
1402 mptAlice.authorize({.account = carol});
1403 mptAlice.pay(alice, bob, 1'000);
1405 auto const MPT = mptAlice[
"MPT"];
1408 env(
pay(bob, alice,
MPT(100)),
1414 env(
pay(bob, alice,
MPT(100)),
1422 Env env{*
this, features};
1424 MPTTester mptAlice(env, alice, {.holders = {bob}});
1427 {.maxAmt = 100, .ownerCount = 1, .holderCount = 0, .flags = tfMPTCanTransfer});
1429 mptAlice.authorize({.account = bob});
1432 mptAlice.pay(alice, bob, 100);
1441 Env env{*
this, features};
1443 MPTTester mptAlice(env, alice, {.holders = {bob}});
1445 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1447 mptAlice.authorize({.account = bob});
1459 Env env{*
this, features};
1460 env.fund(
XRP(1'000), alice, bob);
1463 jv[jss::secret] = alice.
name();
1464 jv[jss::tx_json] =
pay(alice, bob, mpt);
1466 auto const jrr = env.rpc(
"json",
"submit",
to_string(jv));
1467 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1473 Env env{*
this, features};
1475 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1482 .flags = tfMPTCanTransfer});
1483 auto const MPT = mptAlice[
"MPT"];
1485 mptAlice.authorize({.account = bob});
1486 mptAlice.authorize({.account = carol});
1489 mptAlice.pay(alice, bob, 10'000);
1494 auto const meta = env.meta()->getJson(
JsonOptions::none)[sfAffectedNodes.fieldName];
1497 meta[0u][sfModifiedNode.fieldName][sfFinalFields.fieldName]
1498 [sfOutstandingAmount.fieldName] ==
"9990");
1501 meta[1u][sfModifiedNode.fieldName][sfFinalFields.fieldName]
1502 [sfMPTAmount.fieldName] ==
"9990");
1505 meta[2u][sfModifiedNode.fieldName][sfPreviousFields.fieldName]
1506 [sfMPTAmount.fieldName] ==
"10000");
1507 BEAST_EXPECT(!meta[2u][sfModifiedNode.fieldName][sfFinalFields.fieldName].isMember(
1508 sfMPTAmount.fieldName));
1517 Env env{*
this, features};
1519 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1525 .flags = tfMPTCanTransfer});
1526 auto const MPT = mptAlice[
"MPT"];
1528 mptAlice.authorize({.account = bob});
1529 mptAlice.authorize({.account = carol});
1540 BEAST_EXPECT(mptAlice.checkMPTokenOutstandingAmount(0));
1545 Env env{*
this, features};
1547 MPTTester mptAlice(env, alice, {.holders = {bob}});
1549 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1551 mptAlice.authorize({.account = bob});
1554 mptAlice.destroy({.ownerCount = 0});
1563 Env env{*
this, features};
1565 env.fund(
XRP(1'000), alice, bob);
1574 Env env{*
this, features};
1576 MPTTester mptAlice(env, alice, {.holders = {bob}});
1578 mptAlice.
create({.ownerCount = 1, .holderCount = 0});
1581 mptAlice.destroy({.ownerCount = 0});
1591 Env env{*
this, features};
1596 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1598 mptAlice.
create({.maxAmt = 100, .ownerCount = 1, .flags = tfMPTCanTransfer});
1600 mptAlice.authorize({.account = bob});
1601 mptAlice.authorize({.account = carol});
1603 mptAlice.pay(alice, bob, 100);
1606 mptAlice.pay(bob, carol, 100);
1611 Env env{*
this, features};
1613 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
1615 mptAlice.
create({.ownerCount = 1, .holderCount = 0, .flags = tfMPTCanTransfer});
1617 mptAlice.authorize({.account = bob});
1618 mptAlice.authorize({.account = carol});
1621 mptAlice.pay(alice, bob, 100);
1624 mptAlice.pay(bob, alice, 100);
1627 mptAlice.pay(alice, bob, 100);
1628 mptAlice.pay(bob, carol, 50);
1782 testcase(
"MPT Issue Invalid in Transaction");
1783 using namespace test::jtx;
1792 for (
auto const& e : format.getSOTemplate())
1798 format.getName() != jss::SetFee)
1800 txWithAmounts.
insert(format.getName() + e.sField().fieldName);
1807 auto const USD = alice[
"USD"];
1810 STAmount mpt{issue, UINT64_C(100)};
1811 auto const jvb =
bridge(alice, USD, alice, USD);
1812 for (
auto const& feature : {features, features - featureMPTokensV1})
1814 Env env{*
this, feature};
1815 env.fund(
XRP(1'000), alice);
1816 env.fund(
XRP(1'000), carol);
1818 txWithAmounts.
erase(jv[jss::TransactionType].asString() + mptField);
1821 auto jtx = env.jt(jv);
1825 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidTransaction");
1829 jv1[jss::secret] = alice.
name();
1830 jv1[jss::tx_json] = jv;
1831 jrr = env.rpc(
"json",
"submit",
to_string(jv1));
1832 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1834 jrr = env.rpc(
"json",
"sign",
to_string(jv1));
1835 BEAST_EXPECT(jrr[jss::result][jss::error] ==
"invalidParams");
1837 auto toSFieldRef = [](
SField const& field) {
return std::ref(field); };
1838 auto setMPTFields = [&](
SField const& field,
Json::Value& jv,
bool withAmount =
true) {
1840 jv[jss::Asset2] =
to_json(USD.issue());
1843 if (field == sfAsset)
1847 else if (field == sfAsset2)
1861 auto ammCreate = [&](
SField const& field) {
1863 jv[jss::TransactionType] = jss::AMMCreate;
1864 jv[jss::Account] = alice.
human();
1865 jv[jss::Amount] = (field.fieldName == sfAmount.fieldName)
1868 jv[jss::Amount2] = (field.fieldName == sfAmount2.fieldName)
1871 jv[jss::TradingFee] = 0;
1872 test(jv, field.fieldName);
1874 ammCreate(sfAmount);
1875 ammCreate(sfAmount2);
1877 auto ammDeposit = [&](
SField const& field) {
1879 jv[jss::TransactionType] = jss::AMMDeposit;
1880 jv[jss::Account] = alice.
human();
1881 jv[jss::Flags] = tfSingleAsset;
1882 setMPTFields(field, jv);
1883 test(jv, field.fieldName);
1885 for (
SField const& field :
1886 {toSFieldRef(sfAmount),
1887 toSFieldRef(sfAmount2),
1888 toSFieldRef(sfEPrice),
1889 toSFieldRef(sfLPTokenOut),
1890 toSFieldRef(sfAsset),
1891 toSFieldRef(sfAsset2)})
1894 auto ammWithdraw = [&](
SField const& field) {
1896 jv[jss::TransactionType] = jss::AMMWithdraw;
1897 jv[jss::Account] = alice.
human();
1898 jv[jss::Flags] = tfSingleAsset;
1899 setMPTFields(field, jv);
1900 test(jv, field.fieldName);
1902 ammWithdraw(sfAmount);
1903 for (
SField const& field :
1904 {toSFieldRef(sfAmount2),
1905 toSFieldRef(sfEPrice),
1906 toSFieldRef(sfLPTokenIn),
1907 toSFieldRef(sfAsset),
1908 toSFieldRef(sfAsset2)})
1911 auto ammBid = [&](
SField const& field) {
1913 jv[jss::TransactionType] = jss::AMMBid;
1914 jv[jss::Account] = alice.
human();
1915 setMPTFields(field, jv);
1916 test(jv, field.fieldName);
1918 for (
SField const& field :
1919 {toSFieldRef(sfBidMin),
1920 toSFieldRef(sfBidMax),
1921 toSFieldRef(sfAsset),
1922 toSFieldRef(sfAsset2)})
1925 auto ammClawback = [&](
SField const& field) {
1927 jv[jss::TransactionType] = jss::AMMClawback;
1928 jv[jss::Account] = alice.
human();
1929 jv[jss::Holder] = carol.
human();
1930 setMPTFields(field, jv);
1931 test(jv, field.fieldName);
1933 for (
SField const& field :
1934 {toSFieldRef(sfAmount), toSFieldRef(sfAsset), toSFieldRef(sfAsset2)})
1937 auto ammDelete = [&](
SField const& field) {
1939 jv[jss::TransactionType] = jss::AMMDelete;
1940 jv[jss::Account] = alice.
human();
1941 setMPTFields(field, jv,
false);
1942 test(jv, field.fieldName);
1945 ammDelete(sfAsset2);
1947 auto ammVote = [&](
SField const& field) {
1949 jv[jss::TransactionType] = jss::AMMVote;
1950 jv[jss::Account] = alice.
human();
1951 jv[jss::TradingFee] = 100;
1952 setMPTFields(field, jv,
false);
1953 test(jv, field.fieldName);
1958 auto checkCash = [&](
SField const& field) {
1960 jv[jss::TransactionType] = jss::CheckCash;
1961 jv[jss::Account] = alice.
human();
1964 test(jv, field.fieldName);
1966 checkCash(sfAmount);
1967 checkCash(sfDeliverMin);
1971 jv[jss::TransactionType] = jss::CheckCreate;
1972 jv[jss::Account] = alice.
human();
1973 jv[jss::Destination] = carol.
human();
1975 test(jv, jss::SendMax.c_str());
1980 test(jv, jss::TakerPays.c_str());
1981 jv =
offer(alice, mpt, USD(100));
1982 test(jv, jss::TakerGets.c_str());
1987 jv[jss::TransactionType] = jss::PaymentChannelCreate;
1988 jv[jss::Account] = alice.
human();
1989 jv[jss::Destination] = carol.
human();
1990 jv[jss::SettleDelay] = 1;
1993 test(jv, jss::Amount.c_str());
1998 jv[jss::TransactionType] = jss::PaymentChannelFund;
1999 jv[jss::Account] = alice.
human();
2002 test(jv, jss::Amount.c_str());
2007 jv[jss::TransactionType] = jss::PaymentChannelClaim;
2008 jv[jss::Account] = alice.
human();
2011 test(jv, jss::Amount.c_str());
2016 jv[jss::TransactionType] = jss::NFTokenCreateOffer;
2017 jv[jss::Account] = alice.
human();
2020 test(jv, jss::Amount.c_str());
2025 jv[jss::TransactionType] = jss::NFTokenAcceptOffer;
2026 jv[jss::Account] = alice.
human();
2028 test(jv, sfNFTokenBrokerFee.fieldName);
2033 jv[jss::TransactionType] = jss::NFTokenMint;
2034 jv[jss::Account] = alice.
human();
2035 jv[sfNFTokenTaxon.fieldName] = 1;
2037 test(jv, jss::Amount.c_str());
2040 auto trustSet = [&](
SField const& field) {
2042 jv[jss::TransactionType] = jss::TrustSet;
2043 jv[jss::Account] = alice.
human();
2046 test(jv, field.fieldName);
2048 trustSet(sfLimitAmount);
2053 test(jv, jss::Amount.c_str());
2058 test(jv, jss::Amount.c_str());
2063 test(jv, sfSignatureReward.fieldName);
2069 test(jv, jss::Amount.c_str());
2074 alice, jvb, alice, mpt,
XRP(10), alice,
false, 1, alice,
signer(alice));
2075 for (
auto const& field : {sfAmount.fieldName, sfSignatureReward.fieldName})
2084 for (
auto const& field : {sfAmount.fieldName, sfSignatureReward.fieldName})
2096 jv[jss::TransactionType] = tt;
2097 jv[jss::Account] = alice.
human();
2098 jv[sfXChainBridge.fieldName] = jvb;
2100 jv[sfMinAccountCreateAmount.fieldName] =
2104 auto reward =
STAmount{sfSignatureReward, mpt};
2105 auto minAmount =
STAmount{sfMinAccountCreateAmount, USD(10)};
2106 for (
SField const& field :
2109 bridgeTx(jss::XChainCreateBridge, reward, minAmount, field.fieldName);
2110 bridgeTx(jss::XChainModifyBridge, reward, minAmount, field.fieldName);
2111 reward =
STAmount{sfSignatureReward, USD(10)};
2112 minAmount =
STAmount{sfMinAccountCreateAmount, mpt};
2115 BEAST_EXPECT(txWithAmounts.
empty());
2557 testcase(
"invalid MPTokenIssuanceSet for DynamicMPT");
2559 using namespace test::jtx;
2566 Env env{*
this, features - featureDynamicMPT};
2567 MPTTester mptAlice(env, alice, {.holders = {bob}});
2568 auto const mptID =
makeMptID(env.seq(alice), alice);
2571 mptAlice.set({.account = alice, .
id = mptID, .mutableFlags = 2, .err =
temDISABLED});
2572 mptAlice.set({.account = alice, .
id = mptID, .mutableFlags = 0, .err =
temDISABLED});
2575 mptAlice.set({.account = alice, .
id = mptID, .metadata =
"test", .err =
temDISABLED});
2576 mptAlice.set({.account = alice, .
id = mptID, .metadata =
"", .err =
temDISABLED});
2579 mptAlice.set({.account = alice, .
id = mptID, .transferFee = 100, .err =
temDISABLED});
2580 mptAlice.set({.account = alice, .
id = mptID, .transferFee = 0, .err =
temDISABLED});
2586 Env env{*
this, features};
2587 MPTTester mptAlice(env, alice, {.holders = {bob}});
2588 auto const mptID =
makeMptID(env.seq(alice), alice);
2618 Env env{*
this, features};
2619 MPTTester mptAlice(env, alice, {.holders = {bob}});
2627 {.account = alice, .flags = tfMPTCanLock, .mutableFlags = 2, .err =
temMALFORMED});
2631 {.account = alice, .flags = tfMPTCanLock, .metadata =
"test", .err =
temMALFORMED});
2635 {.account = alice, .flags = tfMPTCanLock, .transferFee = 100, .err =
temMALFORMED});
2640 Env env{*
this, features};
2641 MPTTester mptAlice(env, alice, {.holders = {bob}});
2646 .flags = tfMPTCanTransfer,
2649 mptAlice.set({.account = alice, .flags = 0, .transferFee = 100, .metadata =
"test"});
2654 .metadata =
"test2"});
2659 Env env{*
this, features};
2660 MPTTester mptAlice(env, alice, {.holders = {bob}});
2661 auto const mptID =
makeMptID(env.seq(alice), alice);
2663 for (
auto const flags : {10000, 0, 5000})
2672 Env env{*
this, features};
2673 MPTTester mptAlice(env, alice, {.holders = {bob}});
2674 auto const mptID =
makeMptID(env.seq(alice), alice);
2676 auto const flagCombinations = {
2687 for (
auto const& mutableFlags : flagCombinations)
2692 .mutableFlags = mutableFlags,
2699 Env env{*
this, features};
2700 MPTTester mptAlice(env, alice, {.holders = {bob}});
2702 mptAlice.
create({.ownerCount = 1});
2704 auto const mutableFlags = {
2718 for (
auto const& mutableFlag : mutableFlags)
2727 Env env{*
this, features};
2728 MPTTester mptAlice(env, alice, {.holders = {bob}});
2733 mptAlice.set({.account = alice, .metadata = metadata, .err =
temMALFORMED});
2738 Env env{*
this, features};
2739 MPTTester mptAlice(env, alice, {.holders = {bob}});
2741 mptAlice.
create({.ownerCount = 1});
2742 mptAlice.set({.account = alice, .metadata =
"test", .err =
tecNO_PERMISSION});
2747 Env env{*
this, features};
2748 MPTTester mptAlice(env, alice, {.holders = {bob}});
2749 auto const mptID =
makeMptID(env.seq(alice), alice);
2763 Env env{*
this, features};
2764 MPTTester mptAlice(env, alice, {.holders = {bob}});
2767 {.transferFee = 100,
2769 .flags = tfMPTCanTransfer,
2785 BEAST_EXPECT(!mptAlice.isTransferFeePresent());
2790 Env env{*
this, features};
2791 MPTTester mptAlice(env, alice, {.holders = {bob}});
2797 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2811 Env env{*
this, features};
2812 MPTTester mptAlice(env, alice, {.holders = {bob}});
2814 mptAlice.
create({.transferFee = 10, .ownerCount = 1, .flags = tfMPTCanTransfer});
2816 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2818 mptAlice.set({.account = alice, .transferFee = 0, .err =
tecNO_PERMISSION});
2823 Env env{*
this, features};
2824 MPTTester mptAlice(env, alice, {.holders = {bob}});
2832 mptAlice.set({.account = alice, .transferFee = 100, .err =
tecNO_PERMISSION});
2834 auto const invalidFlags = {
2845 for (
auto const& mutableFlag : invalidFlags)
2860 mptAlice.set({.account = alice, .metadata =
"test"});
2861 mptAlice.set({.account = alice, .metadata =
""});