diff --git a/AccountSet__test_8cpp_source.html b/AccountSet__test_8cpp_source.html index 3653808dbe..e1db68921d 100644 --- a/AccountSet__test_8cpp_source.html +++ b/AccountSet__test_8cpp_source.html @@ -662,10 +662,11 @@ $(function() {
591  }
592 };
593 
-
594 BEAST_DEFINE_TESTSUITE_PRIO(AccountSet, app, ripple, 1);
+
594 BEAST_DEFINE_TESTSUITE_PRIO(AccountSet, app, ripple, 1);
595 
596 } // namespace ripple
+
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2)
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:312
ripple::tefNO_TICKET
@ tefNO_TICKET
Definition: TER.h:179
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:488
@@ -705,7 +706,6 @@ $(function() {
ripple::OpenView::rawReplace
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition: OpenView.cpp:245
ripple::TERSubset< CanCvtToTER >
ripple::AccountSet_test::testTransferRate
void testTransferRate()
Definition: AccountSet_test.cpp:318
-
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2)
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:313
ripple::sfAccountTxnID
const SF_UINT256 sfAccountTxnID
ripple::sfTransferRate
const SF_UINT32 sfTransferRate
diff --git a/LedgerData__test_8cpp_source.html b/LedgerData__test_8cpp_source.html index cc142596b7..f673a07799 100644 --- a/LedgerData__test_8cpp_source.html +++ b/LedgerData__test_8cpp_source.html @@ -582,10 +582,11 @@ $(function() {
511  }
512 };
513 
-
514 BEAST_DEFINE_TESTSUITE_PRIO(LedgerData, app, ripple, 1);
+
514 BEAST_DEFINE_TESTSUITE_PRIO(LedgerData, app, ripple, 1);
515 
516 } // namespace ripple
+
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2)
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:638
std::string
STL class.
Json::Value::isString
bool isString() const
Definition: json_value.cpp:1009
@@ -597,7 +598,6 @@ $(function() {
ripple::LedgerData_test
Definition: LedgerData_test.cpp:26
std::chrono::time_point::time_since_epoch
T time_since_epoch(T... args)
ripple::LedgerData_test::checkMarker
static bool checkMarker(Json::Value const &val)
Definition: LedgerData_test.cpp:31
-
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2)
std::to_string
T to_string(T... args)
std::chrono::time_point
Json::Value::size
UInt size() const
Number of values in array or object.
Definition: json_value.cpp:706
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html index 8b34d1df1f..0bea36d4f2 100644 --- a/Main_8cpp_source.html +++ b/Main_8cpp_source.html @@ -502,433 +502,432 @@ $(function() {
431  po::value<std::string>()->implicit_value(""),
432  "Perform unit tests. The optional argument specifies one or "
433  "more comma-separated selectors. Each selector specifies a suite name, "
-
434  "full-name (lib.module.suite), module, or library "
-
435  "(checked in that "
-
436  "order).")(
-
437  "unittest-arg",
-
438  po::value<std::string>()->implicit_value(""),
-
439  "Supplies an argument string to unit tests. If provided, this argument "
-
440  "is made available to each suite that runs. Interpretation of the "
-
441  "argument is handled individually by any suite that accesses it -- "
-
442  "as such, it typically only make sense to provide this when running "
-
443  "a single suite.")(
-
444  "unittest-ipv6",
-
445  "Use IPv6 localhost when running unittests (default is IPv4).")(
-
446  "unittest-log",
-
447  "Force unit test log message output. Only useful in combination with "
-
448  "--quiet, in which case log messages will print but suite/case names "
-
449  "will not.")(
-
450  "unittest-jobs",
-
451  po::value<std::size_t>(),
-
452  "Number of unittest jobs to run in parallel (child processes).");
-
453 #endif // ENABLE_TESTS
-
454 
-
455  // These are hidden options, not intended to be shown in the usage/help
-
456  // message
-
457  po::options_description hidden("Hidden Options");
-
458  hidden.add_options()(
-
459  "parameters",
-
460  po::value<vector<string>>(),
-
461  "Specify rpc command and parameters. This option must be repeated "
-
462  "for each command/param. Positional parameters also serve this "
-
463  "purpose, "
-
464  "so this option is not needed for users")
-
465 #ifdef ENABLE_TESTS
-
466  ("unittest-child",
-
467  "For internal use only when spawning child unit test processes.")
-
468 #else
-
469  ("unittest", "Disabled in this build.")(
-
470  "unittest-child", "Disabled in this build.")
-
471 #endif // ENABLE_TESTS
-
472  ("fg", "Deprecated: server always in foreground mode.");
-
473 
-
474  // Interpret positional arguments as --parameters.
-
475  po::positional_options_description p;
-
476  p.add("parameters", -1);
-
477 
-
478  po::options_description all;
-
479  all.add(gen)
-
480  .add(rpc)
-
481  .add(data)
-
482 #ifdef ENABLE_TESTS
-
483  .add(test)
-
484 #endif // ENABLE_TESTS
-
485  .add(hidden);
-
486 
-
487  po::options_description desc;
-
488  desc.add(gen)
-
489  .add(rpc)
-
490  .add(data)
-
491 #ifdef ENABLE_TESTS
-
492  .add(test)
-
493 #endif // ENABLE_TESTS
-
494  ;
-
495 
-
496  // Parse options, if no error.
-
497  try
-
498  {
-
499  po::store(
-
500  po::command_line_parser(argc, argv)
-
501  .options(all) // Parse options.
-
502  .positional(p) // Remainder as --parameters.
-
503  .run(),
-
504  vm);
-
505  po::notify(vm); // Invoke option notify functions.
-
506  }
-
507  catch (std::exception const& ex)
-
508  {
-
509  std::cerr << "rippled: " << ex.what() << std::endl;
-
510  std::cerr << "Try 'rippled --help' for a list of options." << std::endl;
-
511  return 1;
-
512  }
-
513 
-
514  if (vm.count("help"))
-
515  {
-
516  printHelp(desc);
-
517  return 0;
-
518  }
-
519 
-
520  if (vm.count("version"))
-
521  {
-
522  std::cout << "rippled version " << BuildInfo::getVersionString()
-
523  << std::endl;
-
524  return 0;
-
525  }
-
526 
-
527 #ifndef ENABLE_TESTS
-
528  if (vm.count("unittest") || vm.count("unittest-child"))
-
529  {
-
530  std::cerr << "rippled: Tests disabled in this build." << std::endl;
-
531  std::cerr << "Try 'rippled --help' for a list of options." << std::endl;
-
532  return 1;
-
533  }
-
534 #else
-
535  // Run the unit tests if requested.
-
536  // The unit tests will exit the application with an appropriate return code.
-
537  //
-
538  if (vm.count("unittest"))
-
539  {
-
540  std::string argument;
-
541 
-
542  if (vm.count("unittest-arg"))
-
543  argument = vm["unittest-arg"].as<std::string>();
-
544 
-
545  std::size_t numJobs = 1;
-
546  bool unittestChild = false;
-
547  if (vm.count("unittest-jobs"))
-
548  numJobs = std::max(numJobs, vm["unittest-jobs"].as<std::size_t>());
-
549  unittestChild = bool(vm.count("unittest-child"));
-
550 
-
551  return runUnitTests(
-
552  vm["unittest"].as<std::string>(),
-
553  argument,
-
554  bool(vm.count("quiet")),
-
555  bool(vm.count("unittest-log")),
-
556  unittestChild,
-
557  bool(vm.count("unittest-ipv6")),
-
558  numJobs,
-
559  argc,
-
560  argv);
-
561  }
-
562  else
-
563  {
-
564  if (vm.count("unittest-jobs"))
-
565  {
-
566  // unittest jobs only makes sense with `unittest`
-
567  std::cerr << "rippled: '--unittest-jobs' specified without "
-
568  "'--unittest'.\n";
-
569  std::cerr << "To run the unit tests the '--unittest' option must "
-
570  "be present.\n";
-
571  return 1;
-
572  }
-
573  }
-
574 #endif // ENABLE_TESTS
-
575 
-
576  auto config = std::make_unique<Config>();
-
577 
-
578  auto configFile =
-
579  vm.count("conf") ? vm["conf"].as<std::string>() : std::string();
-
580 
-
581  // config file, quiet flag.
-
582  config->setup(
-
583  configFile,
-
584  bool(vm.count("quiet")),
-
585  bool(vm.count("silent")),
-
586  bool(vm.count("standalone")));
-
587 
-
588  if (vm.count("vacuum"))
-
589  {
-
590  if (config->standalone())
-
591  {
-
592  std::cerr << "vacuum not applicable in standalone mode.\n";
-
593  return -1;
-
594  }
-
595 
-
596  try
-
597  {
-
598  auto setup = setup_DatabaseCon(*config);
-
599  if (!doVacuumDB(setup))
-
600  return -1;
-
601  }
-
602  catch (std::exception const& e)
-
603  {
-
604  std::cerr << "exception " << e.what() << " in function " << __func__
-
605  << std::endl;
-
606  return -1;
-
607  }
-
608 
-
609  return 0;
-
610  }
-
611 
-
612  if (vm.contains("force_ledger_present_range"))
-
613  {
-
614  try
-
615  {
-
616  auto const r = [&vm]() -> std::vector<std::uint32_t> {
-
617  std::vector<std::string> strVec;
-
618  boost::split(
-
619  strVec,
-
620  vm["force_ledger_present_range"].as<std::string>(),
-
621  boost::algorithm::is_any_of(","));
-
622  std::vector<std::uint32_t> result;
-
623  for (auto& s : strVec)
-
624  {
-
625  boost::trim(s);
-
626  if (!s.empty())
-
627  result.push_back(std::stoi(s));
-
628  }
-
629  return result;
-
630  }();
-
631 
-
632  if (r.size() == 2)
-
633  {
-
634  if (r[0] > r[1])
-
635  {
-
636  throw std::runtime_error(
-
637  "Invalid force_ledger_present_range parameter");
-
638  }
-
639  config->FORCED_LEDGER_RANGE_PRESENT.emplace(r[0], r[1]);
-
640  }
-
641  else
-
642  {
-
643  throw std::runtime_error(
-
644  "Invalid force_ledger_present_range parameter");
-
645  }
-
646  }
-
647  catch (std::exception const& e)
-
648  {
-
649  std::cerr << "invalid 'force_ledger_present_range' parameter. The "
-
650  "parameter must be two numbers separated by a comma. "
-
651  "The first number must be <= the second."
-
652  << std::endl;
-
653  return -1;
-
654  }
-
655  }
-
656 
-
657  if (vm.count("start"))
-
658  {
-
659  config->START_UP = Config::FRESH;
-
660  }
-
661 
-
662  if (vm.count("startReporting"))
-
663  {
-
664  config->START_UP = Config::FRESH;
-
665  config->START_LEDGER = vm["startReporting"].as<std::string>();
-
666  }
-
667 
-
668  if (vm.count("reportingReadOnly"))
-
669  {
-
670  config->setReportingReadOnly(true);
-
671  }
-
672 
-
673  if (vm.count("import"))
-
674  config->doImport = true;
-
675 
-
676  if (vm.count("nodetoshard"))
-
677  config->nodeToShard = true;
-
678 
-
679  if (vm.count("ledger"))
-
680  {
-
681  config->START_LEDGER = vm["ledger"].as<std::string>();
-
682  if (vm.count("replay"))
-
683  config->START_UP = Config::REPLAY;
-
684  else
-
685  config->START_UP = Config::LOAD;
-
686  }
-
687  else if (vm.count("ledgerfile"))
-
688  {
-
689  config->START_LEDGER = vm["ledgerfile"].as<std::string>();
-
690  config->START_UP = Config::LOAD_FILE;
-
691  }
-
692  else if (vm.count("load") || config->FAST_LOAD)
-
693  {
-
694  config->START_UP = Config::LOAD;
-
695  }
-
696 
-
697  if (vm.count("net") && !config->FAST_LOAD)
-
698  {
-
699  if ((config->START_UP == Config::LOAD) ||
-
700  (config->START_UP == Config::REPLAY))
-
701  {
-
702  std::cerr << "Net and load/replay options are incompatible"
-
703  << std::endl;
-
704  return -1;
-
705  }
-
706 
-
707  config->START_UP = Config::NETWORK;
-
708  }
-
709 
-
710  if (vm.count("valid"))
-
711  {
-
712  config->START_VALID = true;
-
713  }
-
714 
-
715  // Override the RPC destination IP address. This must
-
716  // happen after the config file is loaded.
-
717  if (vm.count("rpc_ip"))
-
718  {
-
719  auto endpoint = beast::IP::Endpoint::from_string_checked(
-
720  vm["rpc_ip"].as<std::string>());
-
721  if (!endpoint)
-
722  {
-
723  std::cerr << "Invalid rpc_ip = " << vm["rpc_ip"].as<std::string>()
-
724  << "\n";
-
725  return -1;
-
726  }
-
727 
-
728  if (endpoint->port() == 0)
-
729  {
-
730  std::cerr << "No port specified in rpc_ip.\n";
-
731  if (vm.count("rpc_port"))
-
732  {
-
733  std::cerr << "WARNING: using deprecated rpc_port param.\n";
-
734  try
-
735  {
-
736  endpoint =
-
737  endpoint->at_port(vm["rpc_port"].as<std::uint16_t>());
-
738  if (endpoint->port() == 0)
-
739  throw std::domain_error("0");
-
740  }
-
741  catch (std::exception const& e)
-
742  {
-
743  std::cerr << "Invalid rpc_port = " << e.what() << "\n";
-
744  return -1;
-
745  }
-
746  }
-
747  else
-
748  return -1;
-
749  }
-
750 
-
751  config->rpc_ip = std::move(*endpoint);
-
752  }
-
753 
-
754  if (vm.count("quorum"))
-
755  {
-
756  try
-
757  {
-
758  config->VALIDATION_QUORUM = vm["quorum"].as<std::size_t>();
-
759  if (config->VALIDATION_QUORUM == std::size_t{})
-
760  {
-
761  throw std::domain_error("0");
-
762  }
-
763  }
-
764  catch (std::exception const& e)
-
765  {
-
766  std::cerr << "Invalid value specified for --quorum (" << e.what()
-
767  << ")\n";
-
768  return -1;
-
769  }
-
770  }
-
771 
-
772  // Construct the logs object at the configured severity
-
773  using namespace beast::severities;
-
774  Severity thresh = kInfo;
-
775 
-
776  if (vm.count("quiet"))
-
777  thresh = kFatal;
-
778  else if (vm.count("verbose"))
-
779  thresh = kTrace;
-
780 
-
781  auto logs = std::make_unique<Logs>(thresh);
-
782 
-
783  // No arguments. Run server.
-
784  if (!vm.count("parameters"))
-
785  {
-
786  // TODO: this comment can be removed in a future release -
-
787  // say 1.7 or higher
-
788  if (config->had_trailing_comments())
-
789  {
-
790  JLOG(logs->journal("Application").warn())
-
791  << "Trailing comments were seen in your config file. "
-
792  << "The treatment of inline/trailing comments has changed "
-
793  "recently. "
-
794  << "Any `#` characters NOT intended to delimit comments should "
-
795  "be "
-
796  << "preceded by a \\";
-
797  }
-
798 
-
799  // We want at least 1024 file descriptors. We'll
-
800  // tweak this further.
-
801  if (!adjustDescriptorLimit(1024, logs->journal("Application")))
-
802  return -1;
-
803 
-
804  if (vm.count("debug"))
-
805  setDebugLogSink(logs->makeSink("Debug", beast::severities::kTrace));
-
806 
-
807  auto app = make_Application(
-
808  std::move(config), std::move(logs), std::make_unique<TimeKeeper>());
-
809 
-
810  if (!app->setup(vm))
-
811  return -1;
-
812 
-
813  // With our configuration parsed, ensure we have
-
814  // enough file descriptors available:
-
815  if (!adjustDescriptorLimit(
-
816  app->fdRequired(), app->logs().journal("Application")))
-
817  return -1;
-
818 
-
819  // Start the server
-
820  app->start(true /*start timers*/);
-
821 
-
822  // Block until we get a stop RPC.
-
823  app->run();
-
824 
-
825  return 0;
-
826  }
-
827 
-
828  // We have an RPC command to process:
-
829  beast::setCurrentThreadName("rippled: rpc");
-
830  return RPCCall::fromCommandLine(
-
831  *config, vm["parameters"].as<std::vector<std::string>>(), *logs);
-
832 }
-
833 
-
834 } // namespace ripple
-
835 
-
836 int
-
837 main(int argc, char** argv)
-
838 {
-
839 #if BOOST_OS_WINDOWS
-
840  {
-
841  // Work around for https://svn.boost.org/trac/boost/ticket/10657
-
842  // Reported against boost version 1.56.0. If an application's
-
843  // first call to GetTimeZoneInformation is from a coroutine, an
-
844  // unhandled exception is generated. A workaround is to call
-
845  // GetTimeZoneInformation at least once before launching any
-
846  // coroutines. At the time of this writing the _ftime call is
-
847  // used to initialize the timezone information.
-
848  struct _timeb t;
-
849 #ifdef _INC_TIME_INL
-
850  _ftime_s(&t);
-
851 #else
-
852  _ftime(&t);
-
853 #endif
-
854  }
-
855 #endif
-
856 
-
857  atexit(&google::protobuf::ShutdownProtobufLibrary);
-
858 
-
859  return ripple::run(argc, argv);
-
860 }
+
434  "suite name prefix, full-name (lib.module.suite), module, or library "
+
435  "(checked in that order).")(
+
436  "unittest-arg",
+
437  po::value<std::string>()->implicit_value(""),
+
438  "Supplies an argument string to unit tests. If provided, this argument "
+
439  "is made available to each suite that runs. Interpretation of the "
+
440  "argument is handled individually by any suite that accesses it -- "
+
441  "as such, it typically only make sense to provide this when running "
+
442  "a single suite.")(
+
443  "unittest-ipv6",
+
444  "Use IPv6 localhost when running unittests (default is IPv4).")(
+
445  "unittest-log",
+
446  "Force unit test log message output. Only useful in combination with "
+
447  "--quiet, in which case log messages will print but suite/case names "
+
448  "will not.")(
+
449  "unittest-jobs",
+
450  po::value<std::size_t>(),
+
451  "Number of unittest jobs to run in parallel (child processes).");
+
452 #endif // ENABLE_TESTS
+
453 
+
454  // These are hidden options, not intended to be shown in the usage/help
+
455  // message
+
456  po::options_description hidden("Hidden Options");
+
457  hidden.add_options()(
+
458  "parameters",
+
459  po::value<vector<string>>(),
+
460  "Specify rpc command and parameters. This option must be repeated "
+
461  "for each command/param. Positional parameters also serve this "
+
462  "purpose, "
+
463  "so this option is not needed for users")
+
464 #ifdef ENABLE_TESTS
+
465  ("unittest-child",
+
466  "For internal use only when spawning child unit test processes.")
+
467 #else
+
468  ("unittest", "Disabled in this build.")(
+
469  "unittest-child", "Disabled in this build.")
+
470 #endif // ENABLE_TESTS
+
471  ("fg", "Deprecated: server always in foreground mode.");
+
472 
+
473  // Interpret positional arguments as --parameters.
+
474  po::positional_options_description p;
+
475  p.add("parameters", -1);
+
476 
+
477  po::options_description all;
+
478  all.add(gen)
+
479  .add(rpc)
+
480  .add(data)
+
481 #ifdef ENABLE_TESTS
+
482  .add(test)
+
483 #endif // ENABLE_TESTS
+
484  .add(hidden);
+
485 
+
486  po::options_description desc;
+
487  desc.add(gen)
+
488  .add(rpc)
+
489  .add(data)
+
490 #ifdef ENABLE_TESTS
+
491  .add(test)
+
492 #endif // ENABLE_TESTS
+
493  ;
+
494 
+
495  // Parse options, if no error.
+
496  try
+
497  {
+
498  po::store(
+
499  po::command_line_parser(argc, argv)
+
500  .options(all) // Parse options.
+
501  .positional(p) // Remainder as --parameters.
+
502  .run(),
+
503  vm);
+
504  po::notify(vm); // Invoke option notify functions.
+
505  }
+
506  catch (std::exception const& ex)
+
507  {
+
508  std::cerr << "rippled: " << ex.what() << std::endl;
+
509  std::cerr << "Try 'rippled --help' for a list of options." << std::endl;
+
510  return 1;
+
511  }
+
512 
+
513  if (vm.count("help"))
+
514  {
+
515  printHelp(desc);
+
516  return 0;
+
517  }
+
518 
+
519  if (vm.count("version"))
+
520  {
+
521  std::cout << "rippled version " << BuildInfo::getVersionString()
+
522  << std::endl;
+
523  return 0;
+
524  }
+
525 
+
526 #ifndef ENABLE_TESTS
+
527  if (vm.count("unittest") || vm.count("unittest-child"))
+
528  {
+
529  std::cerr << "rippled: Tests disabled in this build." << std::endl;
+
530  std::cerr << "Try 'rippled --help' for a list of options." << std::endl;
+
531  return 1;
+
532  }
+
533 #else
+
534  // Run the unit tests if requested.
+
535  // The unit tests will exit the application with an appropriate return code.
+
536  //
+
537  if (vm.count("unittest"))
+
538  {
+
539  std::string argument;
+
540 
+
541  if (vm.count("unittest-arg"))
+
542  argument = vm["unittest-arg"].as<std::string>();
+
543 
+
544  std::size_t numJobs = 1;
+
545  bool unittestChild = false;
+
546  if (vm.count("unittest-jobs"))
+
547  numJobs = std::max(numJobs, vm["unittest-jobs"].as<std::size_t>());
+
548  unittestChild = bool(vm.count("unittest-child"));
+
549 
+
550  return runUnitTests(
+
551  vm["unittest"].as<std::string>(),
+
552  argument,
+
553  bool(vm.count("quiet")),
+
554  bool(vm.count("unittest-log")),
+
555  unittestChild,
+
556  bool(vm.count("unittest-ipv6")),
+
557  numJobs,
+
558  argc,
+
559  argv);
+
560  }
+
561  else
+
562  {
+
563  if (vm.count("unittest-jobs"))
+
564  {
+
565  // unittest jobs only makes sense with `unittest`
+
566  std::cerr << "rippled: '--unittest-jobs' specified without "
+
567  "'--unittest'.\n";
+
568  std::cerr << "To run the unit tests the '--unittest' option must "
+
569  "be present.\n";
+
570  return 1;
+
571  }
+
572  }
+
573 #endif // ENABLE_TESTS
+
574 
+
575  auto config = std::make_unique<Config>();
+
576 
+
577  auto configFile =
+
578  vm.count("conf") ? vm["conf"].as<std::string>() : std::string();
+
579 
+
580  // config file, quiet flag.
+
581  config->setup(
+
582  configFile,
+
583  bool(vm.count("quiet")),
+
584  bool(vm.count("silent")),
+
585  bool(vm.count("standalone")));
+
586 
+
587  if (vm.count("vacuum"))
+
588  {
+
589  if (config->standalone())
+
590  {
+
591  std::cerr << "vacuum not applicable in standalone mode.\n";
+
592  return -1;
+
593  }
+
594 
+
595  try
+
596  {
+
597  auto setup = setup_DatabaseCon(*config);
+
598  if (!doVacuumDB(setup))
+
599  return -1;
+
600  }
+
601  catch (std::exception const& e)
+
602  {
+
603  std::cerr << "exception " << e.what() << " in function " << __func__
+
604  << std::endl;
+
605  return -1;
+
606  }
+
607 
+
608  return 0;
+
609  }
+
610 
+
611  if (vm.contains("force_ledger_present_range"))
+
612  {
+
613  try
+
614  {
+
615  auto const r = [&vm]() -> std::vector<std::uint32_t> {
+
616  std::vector<std::string> strVec;
+
617  boost::split(
+
618  strVec,
+
619  vm["force_ledger_present_range"].as<std::string>(),
+
620  boost::algorithm::is_any_of(","));
+
621  std::vector<std::uint32_t> result;
+
622  for (auto& s : strVec)
+
623  {
+
624  boost::trim(s);
+
625  if (!s.empty())
+
626  result.push_back(std::stoi(s));
+
627  }
+
628  return result;
+
629  }();
+
630 
+
631  if (r.size() == 2)
+
632  {
+
633  if (r[0] > r[1])
+
634  {
+
635  throw std::runtime_error(
+
636  "Invalid force_ledger_present_range parameter");
+
637  }
+
638  config->FORCED_LEDGER_RANGE_PRESENT.emplace(r[0], r[1]);
+
639  }
+
640  else
+
641  {
+
642  throw std::runtime_error(
+
643  "Invalid force_ledger_present_range parameter");
+
644  }
+
645  }
+
646  catch (std::exception const& e)
+
647  {
+
648  std::cerr << "invalid 'force_ledger_present_range' parameter. The "
+
649  "parameter must be two numbers separated by a comma. "
+
650  "The first number must be <= the second."
+
651  << std::endl;
+
652  return -1;
+
653  }
+
654  }
+
655 
+
656  if (vm.count("start"))
+
657  {
+
658  config->START_UP = Config::FRESH;
+
659  }
+
660 
+
661  if (vm.count("startReporting"))
+
662  {
+
663  config->START_UP = Config::FRESH;
+
664  config->START_LEDGER = vm["startReporting"].as<std::string>();
+
665  }
+
666 
+
667  if (vm.count("reportingReadOnly"))
+
668  {
+
669  config->setReportingReadOnly(true);
+
670  }
+
671 
+
672  if (vm.count("import"))
+
673  config->doImport = true;
+
674 
+
675  if (vm.count("nodetoshard"))
+
676  config->nodeToShard = true;
+
677 
+
678  if (vm.count("ledger"))
+
679  {
+
680  config->START_LEDGER = vm["ledger"].as<std::string>();
+
681  if (vm.count("replay"))
+
682  config->START_UP = Config::REPLAY;
+
683  else
+
684  config->START_UP = Config::LOAD;
+
685  }
+
686  else if (vm.count("ledgerfile"))
+
687  {
+
688  config->START_LEDGER = vm["ledgerfile"].as<std::string>();
+
689  config->START_UP = Config::LOAD_FILE;
+
690  }
+
691  else if (vm.count("load") || config->FAST_LOAD)
+
692  {
+
693  config->START_UP = Config::LOAD;
+
694  }
+
695 
+
696  if (vm.count("net") && !config->FAST_LOAD)
+
697  {
+
698  if ((config->START_UP == Config::LOAD) ||
+
699  (config->START_UP == Config::REPLAY))
+
700  {
+
701  std::cerr << "Net and load/replay options are incompatible"
+
702  << std::endl;
+
703  return -1;
+
704  }
+
705 
+
706  config->START_UP = Config::NETWORK;
+
707  }
+
708 
+
709  if (vm.count("valid"))
+
710  {
+
711  config->START_VALID = true;
+
712  }
+
713 
+
714  // Override the RPC destination IP address. This must
+
715  // happen after the config file is loaded.
+
716  if (vm.count("rpc_ip"))
+
717  {
+
718  auto endpoint = beast::IP::Endpoint::from_string_checked(
+
719  vm["rpc_ip"].as<std::string>());
+
720  if (!endpoint)
+
721  {
+
722  std::cerr << "Invalid rpc_ip = " << vm["rpc_ip"].as<std::string>()
+
723  << "\n";
+
724  return -1;
+
725  }
+
726 
+
727  if (endpoint->port() == 0)
+
728  {
+
729  std::cerr << "No port specified in rpc_ip.\n";
+
730  if (vm.count("rpc_port"))
+
731  {
+
732  std::cerr << "WARNING: using deprecated rpc_port param.\n";
+
733  try
+
734  {
+
735  endpoint =
+
736  endpoint->at_port(vm["rpc_port"].as<std::uint16_t>());
+
737  if (endpoint->port() == 0)
+
738  throw std::domain_error("0");
+
739  }
+
740  catch (std::exception const& e)
+
741  {
+
742  std::cerr << "Invalid rpc_port = " << e.what() << "\n";
+
743  return -1;
+
744  }
+
745  }
+
746  else
+
747  return -1;
+
748  }
+
749 
+
750  config->rpc_ip = std::move(*endpoint);
+
751  }
+
752 
+
753  if (vm.count("quorum"))
+
754  {
+
755  try
+
756  {
+
757  config->VALIDATION_QUORUM = vm["quorum"].as<std::size_t>();
+
758  if (config->VALIDATION_QUORUM == std::size_t{})
+
759  {
+
760  throw std::domain_error("0");
+
761  }
+
762  }
+
763  catch (std::exception const& e)
+
764  {
+
765  std::cerr << "Invalid value specified for --quorum (" << e.what()
+
766  << ")\n";
+
767  return -1;
+
768  }
+
769  }
+
770 
+
771  // Construct the logs object at the configured severity
+
772  using namespace beast::severities;
+
773  Severity thresh = kInfo;
+
774 
+
775  if (vm.count("quiet"))
+
776  thresh = kFatal;
+
777  else if (vm.count("verbose"))
+
778  thresh = kTrace;
+
779 
+
780  auto logs = std::make_unique<Logs>(thresh);
+
781 
+
782  // No arguments. Run server.
+
783  if (!vm.count("parameters"))
+
784  {
+
785  // TODO: this comment can be removed in a future release -
+
786  // say 1.7 or higher
+
787  if (config->had_trailing_comments())
+
788  {
+
789  JLOG(logs->journal("Application").warn())
+
790  << "Trailing comments were seen in your config file. "
+
791  << "The treatment of inline/trailing comments has changed "
+
792  "recently. "
+
793  << "Any `#` characters NOT intended to delimit comments should "
+
794  "be "
+
795  << "preceded by a \\";
+
796  }
+
797 
+
798  // We want at least 1024 file descriptors. We'll
+
799  // tweak this further.
+
800  if (!adjustDescriptorLimit(1024, logs->journal("Application")))
+
801  return -1;
+
802 
+
803  if (vm.count("debug"))
+
804  setDebugLogSink(logs->makeSink("Debug", beast::severities::kTrace));
+
805 
+
806  auto app = make_Application(
+
807  std::move(config), std::move(logs), std::make_unique<TimeKeeper>());
+
808 
+
809  if (!app->setup(vm))
+
810  return -1;
+
811 
+
812  // With our configuration parsed, ensure we have
+
813  // enough file descriptors available:
+
814  if (!adjustDescriptorLimit(
+
815  app->fdRequired(), app->logs().journal("Application")))
+
816  return -1;
+
817 
+
818  // Start the server
+
819  app->start(true /*start timers*/);
+
820 
+
821  // Block until we get a stop RPC.
+
822  app->run();
+
823 
+
824  return 0;
+
825  }
+
826 
+
827  // We have an RPC command to process:
+
828  beast::setCurrentThreadName("rippled: rpc");
+
829  return RPCCall::fromCommandLine(
+
830  *config, vm["parameters"].as<std::vector<std::string>>(), *logs);
+
831 }
+
832 
+
833 } // namespace ripple
+
834 
+
835 int
+
836 main(int argc, char** argv)
+
837 {
+
838 #if BOOST_OS_WINDOWS
+
839  {
+
840  // Work around for https://svn.boost.org/trac/boost/ticket/10657
+
841  // Reported against boost version 1.56.0. If an application's
+
842  // first call to GetTimeZoneInformation is from a coroutine, an
+
843  // unhandled exception is generated. A workaround is to call
+
844  // GetTimeZoneInformation at least once before launching any
+
845  // coroutines. At the time of this writing the _ftime call is
+
846  // used to initialize the timezone information.
+
847  struct _timeb t;
+
848 #ifdef _INC_TIME_INL
+
849  _ftime_s(&t);
+
850 #else
+
851  _ftime(&t);
+
852 #endif
+
853  }
+
854 #endif
+
855 
+
856  atexit(&google::protobuf::ShutdownProtobufLibrary);
+
857 
+
858  return ripple::run(argc, argv);
+
859 }
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:338
beast::severities::kTrace
@ kTrace
Definition: Journal.h:34
diff --git a/NFTokenBurn__test_8cpp_source.html b/NFTokenBurn__test_8cpp_source.html index 8a4f44969f..36cfd83e69 100644 --- a/NFTokenBurn__test_8cpp_source.html +++ b/NFTokenBurn__test_8cpp_source.html @@ -97,11 +97,11 @@ $(function() {
26 
27 namespace ripple {
28 
-
29 class NFTokenBurn0_test : public beast::unit_test::suite
+
29 class NFTokenBurnBaseUtil_test : public beast::unit_test::suite
30 {
31  // Helper function that returns the owner count of an account root.
32  static std::uint32_t
-
33  ownerCount(test::jtx::Env const& env, test::jtx::Account const& acct)
+
33  ownerCount(test::jtx::Env const& env, test::jtx::Account const& acct)
34  {
35  std::uint32_t ret{0};
36  if (auto const sleAcct = env.le(acct))
@@ -111,7 +111,7 @@ $(function() {
40 
41  // Helper function that returns the number of nfts owned by an account.
42  static std::uint32_t
-
43  nftCount(test::jtx::Env& env, test::jtx::Account const& acct)
+
43  nftCount(test::jtx::Env& env, test::jtx::Account const& acct)
44  {
45  Json::Value params;
46  params[jss::account] = acct.human();
@@ -123,7 +123,7 @@ $(function() {
52  // Helper function that returns new nft id for an account and create
53  // specified number of sell offers
54  uint256
-
55  createNftAndOffers(
+
55  createNftAndOffers(
56  test::jtx::Env& env,
57  test::jtx::Account const& owner,
58  std::vector<uint256>& offerIndexes,
@@ -152,7 +152,7 @@ $(function() {
81  };
82 
83  void
-
84  testBurnRandom(FeatureBitset features)
+
84  testBurnRandom(FeatureBitset features)
85  {
86  // Exercise a number of conditions with NFT burning.
87  testcase("Burn random");
@@ -259,9 +259,9 @@ $(function() {
188  }
189 
190  // Now all three participants have 70 NFTs.
-
191  BEAST_EXPECT(nftCount(env, alice.acct) == 70);
-
192  BEAST_EXPECT(nftCount(env, becky.acct) == 70);
-
193  BEAST_EXPECT(nftCount(env, minter.acct) == 70);
+
191  BEAST_EXPECT(nftCount(env, alice.acct) == 70);
+
192  BEAST_EXPECT(nftCount(env, becky.acct) == 70);
+
193  BEAST_EXPECT(nftCount(env, minter.acct) == 70);
194 
195  // Next we'll create offers for all of those NFTs. This calls for
196  // another lambda.
@@ -295,9 +295,9 @@ $(function() {
224  addOffers(alice, becky, minter);
225  addOffers(becky, minter, alice);
226  addOffers(minter, alice, becky);
-
227  BEAST_EXPECT(ownerCount(env, alice) == 424);
-
228  BEAST_EXPECT(ownerCount(env, becky) == 424);
-
229  BEAST_EXPECT(ownerCount(env, minter) == 424);
+
227  BEAST_EXPECT(ownerCount(env, alice) == 424);
+
228  BEAST_EXPECT(ownerCount(env, becky) == 424);
+
229  BEAST_EXPECT(ownerCount(env, minter) == 424);
230 
231  // Now each of the 270 NFTs has six offers associated with it.
232  // Randomly select an NFT out of the pile and burn it. Continue
@@ -337,23 +337,23 @@ $(function() {
266 
267  // Every time we burn an nft, the number of nfts they hold should
268  // match the number of nfts we think they hold.
-
269  BEAST_EXPECT(nftCount(env, alice.acct) == alice.nfts.size());
-
270  BEAST_EXPECT(nftCount(env, becky.acct) == becky.nfts.size());
-
271  BEAST_EXPECT(nftCount(env, minter.acct) == minter.nfts.size());
+
269  BEAST_EXPECT(nftCount(env, alice.acct) == alice.nfts.size());
+
270  BEAST_EXPECT(nftCount(env, becky.acct) == becky.nfts.size());
+
271  BEAST_EXPECT(nftCount(env, minter.acct) == minter.nfts.size());
272  }
-
273  BEAST_EXPECT(nftCount(env, alice.acct) == 0);
-
274  BEAST_EXPECT(nftCount(env, becky.acct) == 0);
-
275  BEAST_EXPECT(nftCount(env, minter.acct) == 0);
+
273  BEAST_EXPECT(nftCount(env, alice.acct) == 0);
+
274  BEAST_EXPECT(nftCount(env, becky.acct) == 0);
+
275  BEAST_EXPECT(nftCount(env, minter.acct) == 0);
276 
277  // When all nfts are burned none of the accounts should have
278  // an ownerCount.
-
279  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
280  BEAST_EXPECT(ownerCount(env, becky) == 0);
-
281  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
279  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
280  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
281  BEAST_EXPECT(ownerCount(env, minter) == 0);
282  }
283 
284  void
-
285  testBurnSequential(FeatureBitset features)
+
285  testBurnSequential(FeatureBitset features)
286  {
287  // The earlier burn test randomizes which nft is burned. There are
288  // a couple of directory merging scenarios that can only be tested by
@@ -519,16 +519,16 @@ $(function() {
448  // pages is not possible.
449  std::vector<uint256> nfts;
450  genPackedTokens(nfts);
-
451  BEAST_EXPECT(nftCount(env, alice) == 96);
-
452  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
451  BEAST_EXPECT(nftCount(env, alice) == 96);
+
452  BEAST_EXPECT(ownerCount(env, alice) == 3);
453 
454  for (uint256 const& nft : nfts)
455  {
456  env(token::burn(alice, {nft}));
457  env.close();
458  }
-
459  BEAST_EXPECT(nftCount(env, alice) == 0);
-
460  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
459  BEAST_EXPECT(nftCount(env, alice) == 0);
+
460  BEAST_EXPECT(ownerCount(env, alice) == 0);
461 
462  // A lambda verifies that the ledger no longer contains any NFT pages.
463  auto checkNoTokenPages = [this, &env]() {
@@ -555,8 +555,8 @@ $(function() {
484  // last to first. This exercises different specific cases where
485  // coalescing pages is not possible.
486  genPackedTokens(nfts);
-
487  BEAST_EXPECT(nftCount(env, alice) == 96);
-
488  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
487  BEAST_EXPECT(nftCount(env, alice) == 96);
+
488  BEAST_EXPECT(ownerCount(env, alice) == 3);
489 
490  std::reverse(nfts.begin(), nfts.end());
491  for (uint256 const& nft : nfts)
@@ -564,16 +564,16 @@ $(function() {
493  env(token::burn(alice, {nft}));
494  env.close();
495  }
-
496  BEAST_EXPECT(nftCount(env, alice) == 0);
-
497  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
496  BEAST_EXPECT(nftCount(env, alice) == 0);
+
497  BEAST_EXPECT(ownerCount(env, alice) == 0);
498  checkNoTokenPages();
499 
500  // Generate three packed pages. Then burn all tokens in the middle
501  // page. This exercises the case where a page is removed between
502  // two fully populated pages.
503  genPackedTokens(nfts);
-
504  BEAST_EXPECT(nftCount(env, alice) == 96);
-
505  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
504  BEAST_EXPECT(nftCount(env, alice) == 96);
+
505  BEAST_EXPECT(ownerCount(env, alice) == 3);
506 
507  for (std::size_t i = 32; i < 64; ++i)
508  {
@@ -581,8 +581,8 @@ $(function() {
510  env.close();
511  }
512  nfts.erase(nfts.begin() + 32, nfts.begin() + 64);
-
513  BEAST_EXPECT(nftCount(env, alice) == 64);
-
514  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
513  BEAST_EXPECT(nftCount(env, alice) == 64);
+
514  BEAST_EXPECT(ownerCount(env, alice) == 2);
515 
516  // Burn the remaining nfts.
517  for (uint256 const& nft : nfts)
@@ -590,12 +590,12 @@ $(function() {
519  env(token::burn(alice, {nft}));
520  env.close();
521  }
-
522  BEAST_EXPECT(nftCount(env, alice) == 0);
+
522  BEAST_EXPECT(nftCount(env, alice) == 0);
523  checkNoTokenPages();
524  }
525 
526  void
-
527  testBurnTooManyOffers(FeatureBitset features)
+
527  testBurnTooManyOffers(FeatureBitset features)
528  {
529  // Look at the case where too many offers prevents burning a token.
530  testcase("Burn too many offers");
@@ -694,8 +694,8 @@ $(function() {
623  }
624 
625  // Both alice and becky should have ownerCounts of zero.
-
626  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
627  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
626  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
627  BEAST_EXPECT(ownerCount(env, becky) == 0);
628  }
629 
630  // Test that up to 499 buy/sell offers will be removed when NFT is
@@ -715,7 +715,7 @@ $(function() {
644  // When the token is burned, 498 sell offers and 1 buy offer are
645  // removed. In total, 499 offers are removed
646  std::vector<uint256> offerIndexes;
-
647  auto const nftokenID = createNftAndOffers(
+
647  auto const nftokenID = createNftAndOffers(
648  env, alice, offerIndexes, maxDeletableTokenOfferEntries - 2);
649 
650  // Verify all sell offers are present in the ledger.
@@ -747,8 +747,8 @@ $(function() {
676  BEAST_EXPECT(!env.le(keylet::nftoffer(beckyOfferIndex)));
677 
678  // alice and becky should have ownerCounts of zero
-
679  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
680  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
679  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
680  BEAST_EXPECT(ownerCount(env, becky) == 0);
681  }
682 
683  // Test that up to 500 buy offers are removed when NFT is burned
@@ -766,7 +766,7 @@ $(function() {
695  // After we burn the token, 500 of the sell offers should be
696  // removed, and one is left over
697  std::vector<uint256> offerIndexes;
-
698  auto const nftokenID = createNftAndOffers(
+
698  auto const nftokenID = createNftAndOffers(
699  env, alice, offerIndexes, maxDeletableTokenOfferEntries + 1);
700 
701  // Verify all sell offers are present in the ledger.
@@ -793,7 +793,7 @@ $(function() {
722  BEAST_EXPECT(offerDeletedCount == maxTokenOfferCancelCount);
723 
724  // alice should have ownerCounts of one for the orphaned sell offer
-
725  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
725  BEAST_EXPECT(ownerCount(env, alice) == 1);
726  }
727 
728  // Test that up to 500 buy/sell offers are removed when NFT is burned
@@ -812,7 +812,7 @@ $(function() {
741  // are removed.
742  // In total, 500 offers are removed
743  std::vector<uint256> offerIndexes;
-
744  auto const nftokenID = createNftAndOffers(
+
744  auto const nftokenID = createNftAndOffers(
745  env, alice, offerIndexes, maxDeletableTokenOfferEntries - 1);
746 
747  // Verify all sell offers are present in the ledger.
@@ -842,24 +842,24 @@ $(function() {
771 
772  // alice should have ownerCount of zero because all her
773  // sell offers have been deleted
-
774  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
774  BEAST_EXPECT(ownerCount(env, alice) == 0);
775 
776  // becky has ownerCount of one due to an orphaned buy offer
-
777  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
777  BEAST_EXPECT(ownerCount(env, becky) == 1);
778  }
779  }
780 
781  void
-
782  testWithFeats(FeatureBitset features)
+
782  testWithFeats(FeatureBitset features)
783  {
-
784  testBurnRandom(features);
-
785  testBurnSequential(features);
-
786  testBurnTooManyOffers(features);
+
784  testBurnRandom(features);
+
785  testBurnSequential(features);
+
786  testBurnTooManyOffers(features);
787  }
788 
789 protected:
790  void
-
791  run(std::uint32_t instance, bool last = false)
+
791  run(std::uint32_t instance, bool last = false)
792  {
793  using namespace test::jtx;
794  static FeatureBitset const all{supported_amendments()};
@@ -873,82 +873,73 @@ $(function() {
802 
803  if (BEAST_EXPECT(instance < feats.size()))
804  {
-
805  testWithFeats(feats[instance]);
+
805  testWithFeats(feats[instance]);
806  }
807  BEAST_EXPECT(!last || instance == feats.size() - 1);
808  }
809 
810 public:
811  void
-
812  run() override
+
812  run() override
813  {
-
814  run(0);
+
814  run(0);
815  }
816 };
817 
-
818 class NFTokenBurn1_test : public NFTokenBurn0_test
+
818 class NFTokenBurnWOfixFungTokens_test : public NFTokenBurnBaseUtil_test
819 {
820 public:
821  void
-
822  run() override
+
822  run() override
823  {
-
824  NFTokenBurn0_test::run(1);
+
824  NFTokenBurnBaseUtil_test::run(1);
825  }
826 };
827 
-
828 class NFTokenBurn2_test : public NFTokenBurn0_test
+
828 class NFTokenBurnWOFixTokenRemint_test : public NFTokenBurnBaseUtil_test
829 {
830 public:
831  void
-
832  run() override
+
832  run() override
833  {
-
834  NFTokenBurn0_test::run(2);
+
834  NFTokenBurnBaseUtil_test::run(2);
835  }
836 };
837 
-
838 class NFTokenBurn3_test : public NFTokenBurn0_test
+
838 class NFTokenBurnAllFeatures_test : public NFTokenBurnBaseUtil_test
839 {
840 public:
841  void
-
842  run() override
+
842  run() override
843  {
-
844  NFTokenBurn0_test::run(3, true);
+
844  NFTokenBurnBaseUtil_test::run(3, true);
845  }
846 };
847 
-
848 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn0, tx, ripple, 3);
-
849 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn1, tx, ripple, 3);
-
850 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn2, tx, ripple, 3);
-
851 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurn3, tx, ripple, 3);
+
848 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurnBaseUtil, tx, ripple, 3);
+
849 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurnWOfixFungTokens, tx, ripple, 3);
+
850 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurnWOFixTokenRemint, tx, ripple, 3);
+
851 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBurnAllFeatures, tx, ripple, 3);
852 
853 } // namespace ripple
ripple::maxTransferFee
constexpr std::uint16_t maxTransferFee
The maximum token transfer fee allowed.
Definition: Protocol.h:81
+
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2)
ripple::sfOwnerCount
const SF_UINT32 sfOwnerCount
ripple::sfFirstNFTokenSequence
const SF_UINT32 sfFirstNFTokenSequence
-
ripple::NFTokenBurn0_test::nftCount
static std::uint32_t nftCount(test::jtx::Env &env, test::jtx::Account const &acct)
Definition: NFTokenBurn_test.cpp:43
ripple::tfTransferable
constexpr const std::uint32_t tfTransferable
Definition: TxFlags.h:131
-
ripple::NFTokenBurn0_test::testBurnTooManyOffers
void testBurnTooManyOffers(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:527
-
ripple::NFTokenBurn3_test
Definition: NFTokenBurn_test.cpp:838
-
ripple::NFTokenBurn0_test::testBurnRandom
void testBurnRandom(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:84
std::string
STL class.
std::uniform_int_distribution
ripple::maxDeletableTokenOfferEntries
constexpr std::size_t maxDeletableTokenOfferEntries
The maximum number of offers in an offer directory for NFT to be burnable.
Definition: Protocol.h:70
ripple::test::jtx::Env::rpc
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:711
-
ripple::NFTokenBurn0_test
Definition: NFTokenBurn_test.cpp:29
std::vector::reserve
T reserve(T... args)
ripple::TxSearched::all
@ all
-
ripple::NFTokenBurn0_test::testWithFeats
void testWithFeats(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:782
Json::UInt
unsigned int UInt
Definition: json_forwards.h:27
-
ripple::NFTokenBurn0_test::ownerCount
static std::uint32_t ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFTokenBurn_test.cpp:33
std::vector
STL class.
-
ripple::NFTokenBurn2_test::run
void run() override
Definition: NFTokenBurn_test.cpp:832
ripple::sfMintedNFTokens
const SF_UINT32 sfMintedNFTokens
ripple::keylet::nftoffer
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
Definition: Indexes.cpp:364
random
ripple::test::jtx::Account::human
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:113
-
ripple::NFTokenBurn1_test::run
void run() override
Definition: NFTokenBurn_test.cpp:822
-
ripple::NFTokenBurn0_test::run
void run() override
Definition: NFTokenBurn_test.cpp:812
std::reverse
T reverse(T... args)
Json::Value::toStyledString
std::string toStyledString() const
Definition: json_value.cpp:1039
ripple::nft::toTaxon
Taxon toTaxon(std::uint32_t i)
Definition: nft.h:42
@@ -957,41 +948,50 @@ $(function() {
ripple::fixNFTokenRemint
const uint256 fixNFTokenRemint
std::mt19937
std::vector::push_back
T push_back(T... args)
+
ripple::NFTokenBurnBaseUtil_test::testWithFeats
void testWithFeats(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:782
std::cout
ripple::Keylet::key
uint256 key
Definition: Keylet.h:40
ripple::base_uint< 256 >
ripple::tfBurnable
constexpr const std::uint32_t tfBurnable
Definition: TxFlags.h:128
-
ripple::NFTokenBurn1_test
Definition: NFTokenBurn_test.cpp:818
-
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2)
+
ripple::NFTokenBurnBaseUtil_test::testBurnRandom
void testBurnRandom(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:84
+
ripple::NFTokenBurnAllFeatures_test
Definition: NFTokenBurn_test.cpp:838
+
ripple::NFTokenBurnBaseUtil_test::testBurnSequential
void testBurnSequential(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:285
+
ripple::NFTokenBurnBaseUtil_test
Definition: NFTokenBurn_test.cpp:29
+
ripple::NFTokenBurnBaseUtil_test::run
void run() override
Definition: NFTokenBurn_test.cpp:812
std::to_string
T to_string(T... args)
+
ripple::NFTokenBurnWOFixTokenRemint_test::run
void run() override
Definition: NFTokenBurn_test.cpp:832
std::array
STL class.
ripple::test::jtx::Env::close
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
Json::Value::size
UInt size() const
Number of values in array or object.
Definition: json_value.cpp:706
ripple::tfSellNFToken
constexpr const std::uint32_t tfSellNFToken
Definition: TxFlags.h:153
-
ripple::NFTokenBurn3_test::run
void run() override
Definition: NFTokenBurn_test.cpp:842
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::maxTokenOfferCancelCount
constexpr std::size_t maxTokenOfferCancelCount
The maximum number of token offers that can be canceled at once.
Definition: Protocol.h:67
+
ripple::NFTokenBurnBaseUtil_test::createNftAndOffers
uint256 createNftAndOffers(test::jtx::Env &env, test::jtx::Account const &owner, std::vector< uint256 > &offerIndexes, size_t const tokenCancelCount)
Definition: NFTokenBurn_test.cpp:55
std::uint32_t
-
ripple::NFTokenBurn0_test::createNftAndOffers
uint256 createNftAndOffers(test::jtx::Env &env, test::jtx::Account const &owner, std::vector< uint256 > &offerIndexes, size_t const tokenCancelCount)
Definition: NFTokenBurn_test.cpp:55
+
ripple::NFTokenBurnWOfixFungTokens_test::run
void run() override
Definition: NFTokenBurn_test.cpp:822
ripple::test::jtx::Env::seq
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:207
ripple::fixNFTokenDirV1
const uint256 fixNFTokenDirV1
ripple::maxTokenURILength
constexpr std::size_t maxTokenURILength
The maximum length of a URI inside an NFT.
Definition: Protocol.h:84
-
ripple::NFTokenBurn0_test::testBurnSequential
void testBurnSequential(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:285
+
ripple::NFTokenBurnBaseUtil_test::run
void run(std::uint32_t instance, bool last=false)
Definition: NFTokenBurn_test.cpp:791
Json::Value::isArray
bool isArray() const
Definition: json_value.cpp:1015
ripple::sfNFTokens
const SField sfNFTokens
-
ripple::NFTokenBurn2_test
Definition: NFTokenBurn_test.cpp:828
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
+
ripple::NFTokenBurnBaseUtil_test::ownerCount
static std::uint32_t ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFTokenBurn_test.cpp:33
std::endl
T endl(T... args)
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:216
ripple::tefTOO_BIG
@ tefTOO_BIG
Definition: TER.h:178
ripple::FeatureBitset
Definition: Feature.h:113
+
ripple::NFTokenBurnWOfixFungTokens_test
Definition: NFTokenBurn_test.cpp:818
+
ripple::NFTokenBurnWOFixTokenRemint_test
Definition: NFTokenBurn_test.cpp:828
std::size_t
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:41
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition: Account.h:37
ripple::fixNonFungibleTokensV1_2
const uint256 fixNonFungibleTokensV1_2
ripple::nft::cipheredTaxon
Taxon cipheredTaxon(std::uint32_t tokenSeq, Taxon taxon)
Definition: nft.h:83
-
ripple::NFTokenBurn0_test::run
void run(std::uint32_t instance, bool last=false)
Definition: NFTokenBurn_test.cpp:791
+
ripple::NFTokenBurnBaseUtil_test::testBurnTooManyOffers
void testBurnTooManyOffers(FeatureBitset features)
Definition: NFTokenBurn_test.cpp:527
+
ripple::NFTokenBurnAllFeatures_test::run
void run() override
Definition: NFTokenBurn_test.cpp:842
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
+
ripple::NFTokenBurnBaseUtil_test::nftCount
static std::uint32_t nftCount(test::jtx::Env &env, test::jtx::Account const &acct)
Definition: NFTokenBurn_test.cpp:43
Json::Value
Represents a JSON value.
Definition: json_value.h:145
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
diff --git a/NFTokenDir__test_8cpp_source.html b/NFTokenDir__test_8cpp_source.html index a9ba5028ed..44e481cb9b 100644 --- a/NFTokenDir__test_8cpp_source.html +++ b/NFTokenDir__test_8cpp_source.html @@ -1179,7 +1179,7 @@ $(function() {
1108  }
1109 };
1110 
-
1111 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDir, tx, ripple, 1);
+
1111 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDir, tx, ripple, 1);
1112 
1113 } // namespace ripple
1114 
@@ -1694,6 +1694,7 @@ $(function() {
1623 
1624 #endif // 0
+
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2)
ripple::tfTransferable
constexpr const std::uint32_t tfTransferable
Definition: TxFlags.h:131
ripple::NFTokenDir_test::testWithFeats
void testWithFeats(FeatureBitset features)
Definition: NFTokenDir_test.cpp:1087
ripple::tecINVARIANT_FAILED
@ tecINVARIANT_FAILED
Definition: TER.h:293
@@ -1729,7 +1730,6 @@ $(function() {
ripple::NFTokenDir_test::run
void run() override
Definition: NFTokenDir_test.cpp:1098
ripple::TERSubset< CanCvtToTER >
ripple::NFTokenDir_test::printNFTPages
void printNFTPages(test::jtx::Env &env, Volume vol)
Definition: NFTokenDir_test.cpp:42
-
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2)
std::array
STL class.
Json::Value::size
UInt size() const
Number of values in array or object.
Definition: json_value.cpp:706
std::set::erase
T erase(T... args)
diff --git a/NFToken__test_8cpp_source.html b/NFToken__test_8cpp_source.html index 12f851f10c..408ceebb00 100644 --- a/NFToken__test_8cpp_source.html +++ b/NFToken__test_8cpp_source.html @@ -98,13 +98,13 @@ $(function() {
27 
28 namespace ripple {
29 
-
30 class NFToken0_test : public beast::unit_test::suite
+
30 class NFTokenBaseUtil_test : public beast::unit_test::suite
31 {
-
32  FeatureBitset const disallowIncoming{featureDisallowIncoming};
+
32  FeatureBitset const disallowIncoming{featureDisallowIncoming};
33 
34  // Helper function that returns the owner count of an account root.
35  static std::uint32_t
-
36  ownerCount(test::jtx::Env const& env, test::jtx::Account const& acct)
+
36  ownerCount(test::jtx::Env const& env, test::jtx::Account const& acct)
37  {
38  std::uint32_t ret{0};
39  if (auto const sleAcct = env.le(acct))
@@ -114,7 +114,7 @@ $(function() {
43 
44  // Helper function that returns the number of NFTs minted by an issuer.
45  static std::uint32_t
-
46  mintedCount(test::jtx::Env const& env, test::jtx::Account const& issuer)
+
46  mintedCount(test::jtx::Env const& env, test::jtx::Account const& issuer)
47  {
48  std::uint32_t ret{0};
49  if (auto const sleIssuer = env.le(issuer))
@@ -124,7 +124,7 @@ $(function() {
53 
54  // Helper function that returns the number of an issuer's burned NFTs.
55  static std::uint32_t
-
56  burnedCount(test::jtx::Env const& env, test::jtx::Account const& issuer)
+
56  burnedCount(test::jtx::Env const& env, test::jtx::Account const& issuer)
57  {
58  std::uint32_t ret{0};
59  if (auto const sleIssuer = env.le(issuer))
@@ -134,7 +134,7 @@ $(function() {
63 
64  // Helper function that returns the number of nfts owned by an account.
65  static std::uint32_t
-
66  nftCount(test::jtx::Env& env, test::jtx::Account const& acct)
+
66  nftCount(test::jtx::Env& env, test::jtx::Account const& acct)
67  {
68  Json::Value params;
69  params[jss::account] = acct.human();
@@ -145,7 +145,7 @@ $(function() {
74 
75  // Helper function that returns the number of tickets held by an account.
76  static std::uint32_t
-
77  ticketCount(test::jtx::Env const& env, test::jtx::Account const& acct)
+
77  ticketCount(test::jtx::Env const& env, test::jtx::Account const& acct)
78  {
79  std::uint32_t ret{0};
80  if (auto const sleAcct = env.le(acct))
@@ -155,13 +155,13 @@ $(function() {
84 
85  // Helper function returns the close time of the parent ledger.
86  std::uint32_t
-
87  lastClose(test::jtx::Env& env)
+
87  lastClose(test::jtx::Env& env)
88  {
89  return env.current()->info().parentCloseTime.time_since_epoch().count();
90  }
91 
92  void
-
93  testEnabled(FeatureBitset features)
+
93  testEnabled(FeatureBitset features)
94  {
95  testcase("Enabled");
96 
@@ -175,42 +175,42 @@ $(function() {
104  featureNonFungibleTokensV1_1};
105  Account const& master = env.master;
106 
-
107  BEAST_EXPECT(ownerCount(env, master) == 0);
-
108  BEAST_EXPECT(mintedCount(env, master) == 0);
-
109  BEAST_EXPECT(burnedCount(env, master) == 0);
+
107  BEAST_EXPECT(ownerCount(env, master) == 0);
+
108  BEAST_EXPECT(mintedCount(env, master) == 0);
+
109  BEAST_EXPECT(burnedCount(env, master) == 0);
110 
111  uint256 const nftId{token::getNextID(env, master, 0u)};
112  env(token::mint(master, 0u), ter(temDISABLED));
113  env.close();
-
114  BEAST_EXPECT(ownerCount(env, master) == 0);
-
115  BEAST_EXPECT(mintedCount(env, master) == 0);
-
116  BEAST_EXPECT(burnedCount(env, master) == 0);
+
114  BEAST_EXPECT(ownerCount(env, master) == 0);
+
115  BEAST_EXPECT(mintedCount(env, master) == 0);
+
116  BEAST_EXPECT(burnedCount(env, master) == 0);
117 
118  env(token::burn(master, nftId), ter(temDISABLED));
119  env.close();
-
120  BEAST_EXPECT(ownerCount(env, master) == 0);
-
121  BEAST_EXPECT(mintedCount(env, master) == 0);
-
122  BEAST_EXPECT(burnedCount(env, master) == 0);
+
120  BEAST_EXPECT(ownerCount(env, master) == 0);
+
121  BEAST_EXPECT(mintedCount(env, master) == 0);
+
122  BEAST_EXPECT(burnedCount(env, master) == 0);
123 
124  uint256 const offerIndex =
125  keylet::nftoffer(master, env.seq(master)).key;
126  env(token::createOffer(master, nftId, XRP(10)), ter(temDISABLED));
127  env.close();
-
128  BEAST_EXPECT(ownerCount(env, master) == 0);
-
129  BEAST_EXPECT(mintedCount(env, master) == 0);
-
130  BEAST_EXPECT(burnedCount(env, master) == 0);
+
128  BEAST_EXPECT(ownerCount(env, master) == 0);
+
129  BEAST_EXPECT(mintedCount(env, master) == 0);
+
130  BEAST_EXPECT(burnedCount(env, master) == 0);
131 
132  env(token::cancelOffer(master, {offerIndex}), ter(temDISABLED));
133  env.close();
-
134  BEAST_EXPECT(ownerCount(env, master) == 0);
-
135  BEAST_EXPECT(mintedCount(env, master) == 0);
-
136  BEAST_EXPECT(burnedCount(env, master) == 0);
+
134  BEAST_EXPECT(ownerCount(env, master) == 0);
+
135  BEAST_EXPECT(mintedCount(env, master) == 0);
+
136  BEAST_EXPECT(burnedCount(env, master) == 0);
137 
138  env(token::acceptBuyOffer(master, offerIndex), ter(temDISABLED));
139  env.close();
-
140  BEAST_EXPECT(ownerCount(env, master) == 0);
-
141  BEAST_EXPECT(mintedCount(env, master) == 0);
-
142  BEAST_EXPECT(burnedCount(env, master) == 0);
+
140  BEAST_EXPECT(ownerCount(env, master) == 0);
+
141  BEAST_EXPECT(mintedCount(env, master) == 0);
+
142  BEAST_EXPECT(burnedCount(env, master) == 0);
143  }
144  {
145  // If the NFT amendment is enabled all NFT-related
@@ -218,30 +218,30 @@ $(function() {
147  Env env{*this, features};
148  Account const& master = env.master;
149 
-
150  BEAST_EXPECT(ownerCount(env, master) == 0);
-
151  BEAST_EXPECT(mintedCount(env, master) == 0);
-
152  BEAST_EXPECT(burnedCount(env, master) == 0);
+
150  BEAST_EXPECT(ownerCount(env, master) == 0);
+
151  BEAST_EXPECT(mintedCount(env, master) == 0);
+
152  BEAST_EXPECT(burnedCount(env, master) == 0);
153 
154  uint256 const nftId0{token::getNextID(env, env.master, 0u)};
155  env(token::mint(env.master, 0u));
156  env.close();
-
157  BEAST_EXPECT(ownerCount(env, master) == 1);
-
158  BEAST_EXPECT(mintedCount(env, master) == 1);
-
159  BEAST_EXPECT(burnedCount(env, master) == 0);
+
157  BEAST_EXPECT(ownerCount(env, master) == 1);
+
158  BEAST_EXPECT(mintedCount(env, master) == 1);
+
159  BEAST_EXPECT(burnedCount(env, master) == 0);
160 
161  env(token::burn(env.master, nftId0));
162  env.close();
-
163  BEAST_EXPECT(ownerCount(env, master) == 0);
-
164  BEAST_EXPECT(mintedCount(env, master) == 1);
-
165  BEAST_EXPECT(burnedCount(env, master) == 1);
+
163  BEAST_EXPECT(ownerCount(env, master) == 0);
+
164  BEAST_EXPECT(mintedCount(env, master) == 1);
+
165  BEAST_EXPECT(burnedCount(env, master) == 1);
166 
167  uint256 const nftId1{
168  token::getNextID(env, env.master, 0u, tfTransferable)};
169  env(token::mint(env.master, 0u), txflags(tfTransferable));
170  env.close();
-
171  BEAST_EXPECT(ownerCount(env, master) == 1);
-
172  BEAST_EXPECT(mintedCount(env, master) == 2);
-
173  BEAST_EXPECT(burnedCount(env, master) == 1);
+
171  BEAST_EXPECT(ownerCount(env, master) == 1);
+
172  BEAST_EXPECT(mintedCount(env, master) == 2);
+
173  BEAST_EXPECT(burnedCount(env, master) == 1);
174 
175  Account const alice{"alice"};
176  env.fund(XRP(10000), alice);
@@ -252,29 +252,29 @@ $(function() {
181  token::owner(master));
182  env.close();
183 
-
184  BEAST_EXPECT(ownerCount(env, master) == 1);
-
185  BEAST_EXPECT(mintedCount(env, master) == 2);
-
186  BEAST_EXPECT(burnedCount(env, master) == 1);
+
184  BEAST_EXPECT(ownerCount(env, master) == 1);
+
185  BEAST_EXPECT(mintedCount(env, master) == 2);
+
186  BEAST_EXPECT(burnedCount(env, master) == 1);
187 
-
188  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
189  BEAST_EXPECT(mintedCount(env, alice) == 0);
-
190  BEAST_EXPECT(burnedCount(env, alice) == 0);
+
188  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
189  BEAST_EXPECT(mintedCount(env, alice) == 0);
+
190  BEAST_EXPECT(burnedCount(env, alice) == 0);
191 
192  env(token::acceptBuyOffer(master, aliceOfferIndex));
193  env.close();
194 
-
195  BEAST_EXPECT(ownerCount(env, master) == 0);
-
196  BEAST_EXPECT(mintedCount(env, master) == 2);
-
197  BEAST_EXPECT(burnedCount(env, master) == 1);
+
195  BEAST_EXPECT(ownerCount(env, master) == 0);
+
196  BEAST_EXPECT(mintedCount(env, master) == 2);
+
197  BEAST_EXPECT(burnedCount(env, master) == 1);
198 
-
199  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
200  BEAST_EXPECT(mintedCount(env, alice) == 0);
-
201  BEAST_EXPECT(burnedCount(env, alice) == 0);
+
199  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
200  BEAST_EXPECT(mintedCount(env, alice) == 0);
+
201  BEAST_EXPECT(burnedCount(env, alice) == 0);
202  }
203  }
204 
205  void
-
206  testMintReserve(FeatureBitset features)
+
206  testMintReserve(FeatureBitset features)
207  {
208  // Verify that the reserve behaves as expected for minting.
209  testcase("Mint reserve");
@@ -293,16 +293,16 @@ $(function() {
222  env.close();
223  BEAST_EXPECT(env.balance(alice) == acctReserve);
224  BEAST_EXPECT(env.balance(minter) == acctReserve);
-
225  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
226  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
225  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
226  BEAST_EXPECT(ownerCount(env, minter) == 0);
227 
228  // alice does not have enough XRP to cover the reserve for an NFT
229  // page.
230  env(token::mint(alice, 0u), ter(tecINSUFFICIENT_RESERVE));
231  env.close();
-
232  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
233  BEAST_EXPECT(mintedCount(env, alice) == 0);
-
234  BEAST_EXPECT(burnedCount(env, alice) == 0);
+
232  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
233  BEAST_EXPECT(mintedCount(env, alice) == 0);
+
234  BEAST_EXPECT(burnedCount(env, alice) == 0);
235 
236  // Pay alice almost enough to make the reserve for an NFT page.
237  env(pay(env.master, alice, incReserve + drops(9)));
@@ -328,9 +328,9 @@ $(function() {
257  fail(ss.str(), __FILE__, line);
258  }
259  };
-
260  oneCheck("owner", ownerCount(env, alice), owners);
-
261  oneCheck("minted", mintedCount(env, alice), minted);
-
262  oneCheck("burned", burnedCount(env, alice), burned);
+
260  oneCheck("owner", ownerCount(env, alice), owners);
+
261  oneCheck("minted", mintedCount(env, alice), minted);
+
262  oneCheck("burned", burnedCount(env, alice), burned);
263  };
264 
265  // alice still does not have enough XRP for the reserve of an NFT
@@ -430,17 +430,17 @@ $(function() {
359  fail(ss.str(), __FILE__, line);
360  }
361  };
-
362  oneCheck("alice owner", ownerCount(env, alice), aliceOwners, line);
+
362  oneCheck("alice owner", ownerCount(env, alice), aliceOwners, line);
363  oneCheck(
-
364  "alice minted", mintedCount(env, alice), aliceMinted, line);
+
364  "alice minted", mintedCount(env, alice), aliceMinted, line);
365  oneCheck(
-
366  "alice burned", burnedCount(env, alice), aliceBurned, line);
+
366  "alice burned", burnedCount(env, alice), aliceBurned, line);
367  oneCheck(
-
368  "minter owner", ownerCount(env, minter), minterOwners, line);
+
368  "minter owner", ownerCount(env, minter), minterOwners, line);
369  oneCheck(
-
370  "minter minted", mintedCount(env, minter), minterMinted, line);
+
370  "minter minted", mintedCount(env, minter), minterMinted, line);
371  oneCheck(
-
372  "minter burned", burnedCount(env, minter), minterBurned, line);
+
372  "minter burned", burnedCount(env, minter), minterBurned, line);
373  };
374 
375  std::uint32_t nftSeq = 33;
@@ -523,7 +523,7 @@ $(function() {
452  }
453 
454  void
-
455  testMintMaxTokens(FeatureBitset features)
+
455  testMintMaxTokens(FeatureBitset features)
456  {
457  // Make sure that an account cannot cause the sfMintedNFTokens
458  // field to wrap by minting more than 0xFFFF'FFFF tokens.
@@ -593,7 +593,7 @@ $(function() {
522  }
523 
524  void
-
525  testMintInvalid(FeatureBitset features)
+
525  testMintInvalid(FeatureBitset features)
526  {
527  // Explore many of the invalid ways to mint an NFT.
528  testcase("Mint invalid");
@@ -669,7 +669,7 @@ $(function() {
598  }
599 
600  void
-
601  testBurnInvalid(FeatureBitset features)
+
601  testBurnInvalid(FeatureBitset features)
602  {
603  // Explore many of the invalid ways to burn an NFT.
604  testcase("Burn invalid");
@@ -688,13 +688,13 @@ $(function() {
617  // Account reserve for unit tests is 200 XRP, not 20.
618  env.fund(XRP(250), alice, buyer, minter, gw);
619  env.close();
-
620  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
620  BEAST_EXPECT(ownerCount(env, alice) == 0);
621 
622  uint256 const nftAlice0ID =
623  token::getNextID(env, alice, 0, tfTransferable);
624  env(token::mint(alice, 0u), txflags(tfTransferable));
625  env.close();
-
626  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
626  BEAST_EXPECT(ownerCount(env, alice) == 1);
627 
628  //----------------------------------------------------------------------
629  // preflight
@@ -704,14 +704,14 @@ $(function() {
633  fee(STAmount(10ull, true)),
634  ter(temBAD_FEE));
635  env.close();
-
636  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
636  BEAST_EXPECT(ownerCount(env, alice) == 1);
637 
638  // Set an invalid flag.
639  env(token::burn(alice, nftAlice0ID),
640  txflags(0x00008000),
641  ter(temINVALID_FLAG));
642  env.close();
-
643  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
643  BEAST_EXPECT(ownerCount(env, buyer) == 0);
644 
645  //----------------------------------------------------------------------
646  // preclaim
@@ -720,7 +720,7 @@ $(function() {
649  env(token::burn(alice, token::getID(env, alice, 0, 1)),
650  ter(tecNO_ENTRY));
651  env.close();
-
652  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
652  BEAST_EXPECT(ownerCount(env, buyer) == 0);
653 
654  // Can't burn a token with many buy or sell offers. But that is
655  // verified in testManyNftOffers().
@@ -730,7 +730,7 @@ $(function() {
659  }
660 
661  void
-
662  testCreateOfferInvalid(FeatureBitset features)
+
662  testCreateOfferInvalid(FeatureBitset features)
663  {
664  testcase("Invalid NFT offer create");
665 
@@ -747,7 +747,7 @@ $(function() {
676  // Account reserve for unit tests is 200 XRP, not 20.
677  env.fund(XRP(250), alice, buyer, gw);
678  env.close();
-
679  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
679  BEAST_EXPECT(ownerCount(env, alice) == 0);
680 
681  uint256 const nftAlice0ID =
682  token::getNextID(env, alice, 0, tfTransferable, 10);
@@ -755,18 +755,18 @@ $(function() {
684  txflags(tfTransferable),
685  token::xferFee(10));
686  env.close();
-
687  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
687  BEAST_EXPECT(ownerCount(env, alice) == 1);
688 
689  uint256 const nftXrpOnlyID =
690  token::getNextID(env, alice, 0, tfOnlyXRP | tfTransferable);
691  env(token::mint(alice, 0), txflags(tfOnlyXRP | tfTransferable));
692  env.close();
-
693  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
693  BEAST_EXPECT(ownerCount(env, alice) == 1);
694 
695  uint256 nftNoXferID = token::getNextID(env, alice, 0);
696  env(token::mint(alice, 0));
697  env.close();
-
698  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
698  BEAST_EXPECT(ownerCount(env, alice) == 1);
699 
700  //----------------------------------------------------------------------
701  // preflight
@@ -781,21 +781,21 @@ $(function() {
710  token::owner(alice),
711  ter(tecINSUFFICIENT_RESERVE));
712  env.close();
-
713  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
713  BEAST_EXPECT(ownerCount(env, buyer) == 0);
714 
715  // Set a negative fee.
716  env(token::createOffer(buyer, nftAlice0ID, XRP(1000)),
717  fee(STAmount(10ull, true)),
718  ter(temBAD_FEE));
719  env.close();
-
720  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
720  BEAST_EXPECT(ownerCount(env, buyer) == 0);
721 
722  // Set an invalid flag.
723  env(token::createOffer(buyer, nftAlice0ID, XRP(1000)),
724  txflags(0x00008000),
725  ter(temINVALID_FLAG));
726  env.close();
-
727  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
727  BEAST_EXPECT(ownerCount(env, buyer) == 0);
728 
729  // Set an invalid amount.
730  env(token::createOffer(buyer, nftXrpOnlyID, buyer["USD"](1)),
@@ -805,21 +805,21 @@ $(function() {
734  env(token::createOffer(buyer, nftXrpOnlyID, drops(0)),
735  ter(temBAD_AMOUNT));
736  env.close();
-
737  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
737  BEAST_EXPECT(ownerCount(env, buyer) == 0);
738 
739  // Set a bad expiration.
740  env(token::createOffer(buyer, nftAlice0ID, buyer["USD"](1)),
741  token::expiration(0),
742  ter(temBAD_EXPIRATION));
743  env.close();
-
744  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
744  BEAST_EXPECT(ownerCount(env, buyer) == 0);
745 
746  // Invalid Owner field and tfSellToken flag relationships.
747  // A buy offer must specify the owner.
748  env(token::createOffer(buyer, nftXrpOnlyID, XRP(1000)),
749  ter(temMALFORMED));
750  env.close();
-
751  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
751  BEAST_EXPECT(ownerCount(env, buyer) == 0);
752 
753  // A sell offer must not specify the owner; the owner is implicit.
754  env(token::createOffer(alice, nftXrpOnlyID, XRP(1000)),
@@ -827,14 +827,14 @@ $(function() {
756  txflags(tfSellNFToken),
757  ter(temMALFORMED));
758  env.close();
-
759  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
759  BEAST_EXPECT(ownerCount(env, alice) == 1);
760 
761  // An owner may not offer to buy their own token.
762  env(token::createOffer(alice, nftXrpOnlyID, XRP(1000)),
763  token::owner(alice),
764  ter(temMALFORMED));
765  env.close();
-
766  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
766  BEAST_EXPECT(ownerCount(env, alice) == 1);
767 
768  // The destination may not be the account submitting the transaction.
769  env(token::createOffer(alice, nftXrpOnlyID, XRP(1000)),
@@ -842,7 +842,7 @@ $(function() {
771  txflags(tfSellNFToken),
772  ter(temMALFORMED));
773  env.close();
-
774  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
774  BEAST_EXPECT(ownerCount(env, alice) == 1);
775 
776  // The destination must be an account already established in the ledger.
777  env(token::createOffer(alice, nftXrpOnlyID, XRP(1000)),
@@ -850,7 +850,7 @@ $(function() {
779  txflags(tfSellNFToken),
780  ter(tecNO_DST));
781  env.close();
-
782  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
782  BEAST_EXPECT(ownerCount(env, alice) == 1);
783 
784  //----------------------------------------------------------------------
785  // preclaim
@@ -858,10 +858,10 @@ $(function() {
787  // The new NFTokenOffer may not have passed its expiration time.
788  env(token::createOffer(buyer, nftXrpOnlyID, XRP(1000)),
789  token::owner(alice),
-
790  token::expiration(lastClose(env)),
+
790  token::expiration(lastClose(env)),
791  ter(tecEXPIRED));
792  env.close();
-
793  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
793  BEAST_EXPECT(ownerCount(env, buyer) == 0);
794 
795  // The nftID must be present in the ledger.
796  env(token::createOffer(
@@ -869,7 +869,7 @@ $(function() {
798  token::owner(alice),
799  ter(tecNO_ENTRY));
800  env.close();
-
801  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
801  BEAST_EXPECT(ownerCount(env, buyer) == 0);
802 
803  // The nftID must be present in the ledger of a sell offer too.
804  env(token::createOffer(
@@ -877,18 +877,18 @@ $(function() {
806  txflags(tfSellNFToken),
807  ter(tecNO_ENTRY));
808  env.close();
-
809  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
809  BEAST_EXPECT(ownerCount(env, buyer) == 0);
810 
811  // buyer must have the funds to pay for their offer.
812  env(token::createOffer(buyer, nftAlice0ID, gwAUD(1000)),
813  token::owner(alice),
814  ter(tecNO_LINE));
815  env.close();
-
816  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
816  BEAST_EXPECT(ownerCount(env, buyer) == 0);
817 
818  env(trust(buyer, gwAUD(1000)));
819  env.close();
-
820  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
820  BEAST_EXPECT(ownerCount(env, buyer) == 1);
821  env.close();
822 
823  // Issuer (alice) must have a trust line for the offered funds.
@@ -896,7 +896,7 @@ $(function() {
825  token::owner(alice),
826  ter(tecNO_LINE));
827  env.close();
-
828  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
828  BEAST_EXPECT(ownerCount(env, buyer) == 1);
829 
830  // Give alice the needed trust line, but freeze it.
831  env(trust(gw, alice["AUD"](999), tfSetFreeze));
@@ -908,7 +908,7 @@ $(function() {
837  token::owner(alice),
838  ter(tecFROZEN));
839  env.close();
-
840  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
840  BEAST_EXPECT(ownerCount(env, buyer) == 1);
841 
842  // Unfreeze alice's trustline.
843  env(trust(gw, alice["AUD"](999), tfClearFreeze));
@@ -919,7 +919,7 @@ $(function() {
848  token::owner(alice),
849  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
850  env.close();
-
851  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
851  BEAST_EXPECT(ownerCount(env, buyer) == 1);
852 
853  // Give buyer the needed trust line, but freeze it.
854  env(trust(gw, buyer["AUD"](999), tfSetFreeze));
@@ -929,7 +929,7 @@ $(function() {
858  token::owner(alice),
859  ter(tecFROZEN));
860  env.close();
-
861  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
861  BEAST_EXPECT(ownerCount(env, buyer) == 1);
862 
863  // Unfreeze buyer's trust line, but buyer has no actual gwAUD.
864  // to cover the offer.
@@ -941,7 +941,7 @@ $(function() {
870  token::owner(alice),
871  ter(tecUNFUNDED_OFFER));
872  env.close();
-
873  BEAST_EXPECT(ownerCount(env, buyer) == 1); // the trust line.
+
873  BEAST_EXPECT(ownerCount(env, buyer) == 1); // the trust line.
874 
875  //----------------------------------------------------------------------
876  // doApply
@@ -956,7 +956,7 @@ $(function() {
885  token::owner(alice),
886  ter(tecINSUFFICIENT_RESERVE));
887  env.close();
-
888  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
888  BEAST_EXPECT(ownerCount(env, buyer) == 1);
889 
890  // Give buyer almost enough XRP to cover the reserve.
891  env(pay(env.master, buyer, XRP(50) + drops(119)));
@@ -966,7 +966,7 @@ $(function() {
895  token::owner(alice),
896  ter(tecINSUFFICIENT_RESERVE));
897  env.close();
-
898  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
898  BEAST_EXPECT(ownerCount(env, buyer) == 1);
899 
900  // Give buyer just enough XRP to cover the reserve for the offer.
901  env(pay(env.master, buyer, drops(11)));
@@ -978,11 +978,11 @@ $(function() {
907  token::owner(alice),
908  ter(tesSUCCESS));
909  env.close();
-
910  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
910  BEAST_EXPECT(ownerCount(env, buyer) == 2);
911  }
912 
913  void
-
914  testCancelOfferInvalid(FeatureBitset features)
+
914  testCancelOfferInvalid(FeatureBitset features)
915  {
916  testcase("Invalid NFT offer cancel");
917 
@@ -996,13 +996,13 @@ $(function() {
925 
926  env.fund(XRP(1000), alice, buyer, gw);
927  env.close();
-
928  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
928  BEAST_EXPECT(ownerCount(env, alice) == 0);
929 
930  uint256 const nftAlice0ID =
931  token::getNextID(env, alice, 0, tfTransferable);
932  env(token::mint(alice, 0u), txflags(tfTransferable));
933  env.close();
-
934  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
934  BEAST_EXPECT(ownerCount(env, alice) == 1);
935 
936  // This is the offer we'll try to cancel.
937  uint256 const buyerOfferIndex =
@@ -1011,7 +1011,7 @@ $(function() {
940  token::owner(alice),
941  ter(tesSUCCESS));
942  env.close();
-
943  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
943  BEAST_EXPECT(ownerCount(env, buyer) == 1);
944 
945  //----------------------------------------------------------------------
946  // preflight
@@ -1021,14 +1021,14 @@ $(function() {
950  fee(STAmount(10ull, true)),
951  ter(temBAD_FEE));
952  env.close();
-
953  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
953  BEAST_EXPECT(ownerCount(env, buyer) == 1);
954 
955  // Set an invalid flag.
956  env(token::cancelOffer(buyer, {buyerOfferIndex}),
957  txflags(0x00008000),
958  ter(temINVALID_FLAG));
959  env.close();
-
960  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
960  BEAST_EXPECT(ownerCount(env, buyer) == 1);
961 
962  // Empty list of tokens to delete.
963  {
@@ -1036,7 +1036,7 @@ $(function() {
965  jv[sfNFTokenOffers.jsonName] = Json::arrayValue;
966  env(jv, ter(temMALFORMED));
967  env.close();
-
968  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
968  BEAST_EXPECT(ownerCount(env, buyer) == 1);
969  }
970 
971  // List of tokens to delete is too long.
@@ -1046,19 +1046,19 @@ $(function() {
975 
976  env(token::cancelOffer(buyer, offers), ter(temMALFORMED));
977  env.close();
-
978  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
978  BEAST_EXPECT(ownerCount(env, buyer) == 1);
979  }
980 
981  // Duplicate entries are not allowed in the list of offers to cancel.
982  env(token::cancelOffer(buyer, {buyerOfferIndex, buyerOfferIndex}),
983  ter(temMALFORMED));
984  env.close();
-
985  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
985  BEAST_EXPECT(ownerCount(env, buyer) == 1);
986 
987  // Provide neither offers to cancel nor a root index.
988  env(token::cancelOffer(buyer), ter(temMALFORMED));
989  env.close();
-
990  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
990  BEAST_EXPECT(ownerCount(env, buyer) == 1);
991 
992  //----------------------------------------------------------------------
993  // preclaim
@@ -1089,7 +1089,7 @@ $(function() {
1018  // gw attempts to cancel an offer they don't have permission to cancel.
1019  env(token::cancelOffer(gw, {buyerOfferIndex}), ter(tecNO_PERMISSION));
1020  env.close();
-
1021  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1021  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1022 
1023  //----------------------------------------------------------------------
1024  // doApply
@@ -1098,11 +1098,11 @@ $(function() {
1027  // But let's see a successful offer cancel.
1028  env(token::cancelOffer(buyer, {buyerOfferIndex}));
1029  env.close();
-
1030  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1030  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1031  }
1032 
1033  void
-
1034  testAcceptOfferInvalid(FeatureBitset features)
+
1034  testAcceptOfferInvalid(FeatureBitset features)
1035  {
1036  testcase("Invalid NFT offer accept");
1037 
@@ -1116,24 +1116,24 @@ $(function() {
1045 
1046  env.fund(XRP(1000), alice, buyer, gw);
1047  env.close();
-
1048  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1048  BEAST_EXPECT(ownerCount(env, alice) == 0);
1049 
1050  uint256 const nftAlice0ID =
1051  token::getNextID(env, alice, 0, tfTransferable);
1052  env(token::mint(alice, 0u), txflags(tfTransferable));
1053  env.close();
-
1054  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1054  BEAST_EXPECT(ownerCount(env, alice) == 1);
1055 
1056  uint256 const nftXrpOnlyID =
1057  token::getNextID(env, alice, 0, tfOnlyXRP | tfTransferable);
1058  env(token::mint(alice, 0), txflags(tfOnlyXRP | tfTransferable));
1059  env.close();
-
1060  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1060  BEAST_EXPECT(ownerCount(env, alice) == 1);
1061 
1062  uint256 nftNoXferID = token::getNextID(env, alice, 0);
1063  env(token::mint(alice, 0));
1064  env.close();
-
1065  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1065  BEAST_EXPECT(ownerCount(env, alice) == 1);
1066 
1067  // alice creates sell offers for her nfts.
1068  uint256 const plainOfferIndex =
@@ -1141,37 +1141,37 @@ $(function() {
1070  env(token::createOffer(alice, nftAlice0ID, XRP(10)),
1071  txflags(tfSellNFToken));
1072  env.close();
-
1073  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1073  BEAST_EXPECT(ownerCount(env, alice) == 2);
1074 
1075  uint256 const audOfferIndex =
1076  keylet::nftoffer(alice, env.seq(alice)).key;
1077  env(token::createOffer(alice, nftAlice0ID, gwAUD(30)),
1078  txflags(tfSellNFToken));
1079  env.close();
-
1080  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
1080  BEAST_EXPECT(ownerCount(env, alice) == 3);
1081 
1082  uint256 const xrpOnlyOfferIndex =
1083  keylet::nftoffer(alice, env.seq(alice)).key;
1084  env(token::createOffer(alice, nftXrpOnlyID, XRP(20)),
1085  txflags(tfSellNFToken));
1086  env.close();
-
1087  BEAST_EXPECT(ownerCount(env, alice) == 4);
+
1087  BEAST_EXPECT(ownerCount(env, alice) == 4);
1088 
1089  uint256 const noXferOfferIndex =
1090  keylet::nftoffer(alice, env.seq(alice)).key;
1091  env(token::createOffer(alice, nftNoXferID, XRP(30)),
1092  txflags(tfSellNFToken));
1093  env.close();
-
1094  BEAST_EXPECT(ownerCount(env, alice) == 5);
+
1094  BEAST_EXPECT(ownerCount(env, alice) == 5);
1095 
1096  // alice creates a sell offer that will expire soon.
1097  uint256 const aliceExpOfferIndex =
1098  keylet::nftoffer(alice, env.seq(alice)).key;
1099  env(token::createOffer(alice, nftNoXferID, XRP(40)),
1100  txflags(tfSellNFToken),
-
1101  token::expiration(lastClose(env) + 5));
+
1101  token::expiration(lastClose(env) + 5));
1102  env.close();
-
1103  BEAST_EXPECT(ownerCount(env, alice) == 6);
+
1103  BEAST_EXPECT(ownerCount(env, alice) == 6);
1104 
1105  //----------------------------------------------------------------------
1106  // preflight
@@ -1181,14 +1181,14 @@ $(function() {
1110  fee(STAmount(10ull, true)),
1111  ter(temBAD_FEE));
1112  env.close();
-
1113  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1113  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1114 
1115  // Set an invalid flag.
1116  env(token::acceptSellOffer(buyer, noXferOfferIndex),
1117  txflags(0x00008000),
1118  ter(temINVALID_FLAG));
1119  env.close();
-
1120  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1120  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1121 
1122  // Supply nether an sfNFTokenBuyOffer nor an sfNFTokenSellOffer field.
1123  {
@@ -1196,7 +1196,7 @@ $(function() {
1125  jv.removeMember(sfNFTokenSellOffer.jsonName);
1126  env(jv, ter(temMALFORMED));
1127  env.close();
-
1128  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1128  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1129  }
1130 
1131  // A buy offer may not contain a sfNFTokenBrokerFee field.
@@ -1206,7 +1206,7 @@ $(function() {
1135  STAmount(500000).getJson(JsonOptions::none);
1136  env(jv, ter(temMALFORMED));
1137  env.close();
-
1138  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1138  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1139  }
1140 
1141  // A sell offer may not contain a sfNFTokenBrokerFee field.
@@ -1216,7 +1216,7 @@ $(function() {
1145  STAmount(500000).getJson(JsonOptions::none);
1146  env(jv, ter(temMALFORMED));
1147  env.close();
-
1148  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1148  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1149  }
1150 
1151  // A brokered offer may not contain a negative or zero brokerFee.
@@ -1224,7 +1224,7 @@ $(function() {
1153  token::brokerFee(gwAUD(0)),
1154  ter(temMALFORMED));
1155  env.close();
-
1156  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1156  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1157 
1158  //----------------------------------------------------------------------
1159  // preclaim
@@ -1233,36 +1233,36 @@ $(function() {
1162  env(token::acceptBuyOffer(buyer, beast::zero),
1163  ter(tecOBJECT_NOT_FOUND));
1164  env.close();
-
1165  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1165  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1166 
1167  // The buy offer must be present in the ledger.
1168  uint256 const missingOfferIndex = keylet::nftoffer(alice, 1).key;
1169  env(token::acceptBuyOffer(buyer, missingOfferIndex),
1170  ter(tecOBJECT_NOT_FOUND));
1171  env.close();
-
1172  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1172  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1173 
1174  // The buy offer must not have expired.
1175  env(token::acceptBuyOffer(buyer, aliceExpOfferIndex), ter(tecEXPIRED));
1176  env.close();
-
1177  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1177  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1178 
1179  // The sell offer must be non-zero.
1180  env(token::acceptSellOffer(buyer, beast::zero),
1181  ter(tecOBJECT_NOT_FOUND));
1182  env.close();
-
1183  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1183  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1184 
1185  // The sell offer must be present in the ledger.
1186  env(token::acceptSellOffer(buyer, missingOfferIndex),
1187  ter(tecOBJECT_NOT_FOUND));
1188  env.close();
-
1189  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1189  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1190 
1191  // The sell offer must not have expired.
1192  env(token::acceptSellOffer(buyer, aliceExpOfferIndex), ter(tecEXPIRED));
1193  env.close();
-
1194  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1194  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1195 
1196  //----------------------------------------------------------------------
1197  // preclaim brokered
@@ -1274,8 +1274,8 @@ $(function() {
1203  env.close();
1204  env(pay(gw, buyer, gwAUD(30)));
1205  env.close();
-
1206  BEAST_EXPECT(ownerCount(env, alice) == 7);
-
1207  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1206  BEAST_EXPECT(ownerCount(env, alice) == 7);
+
1207  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1208 
1209  // We're about to exercise offer brokering, so we need
1210  // corresponding buy and sell offers.
@@ -1286,31 +1286,31 @@ $(function() {
1215  env(token::createOffer(buyer, nftAlice0ID, gwAUD(29)),
1216  token::owner(alice));
1217  env.close();
-
1218  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1218  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1219 
1220  // gw attempts to broker offers that are not for the same token.
1221  env(token::brokerOffers(gw, buyerOfferIndex, xrpOnlyOfferIndex),
1222  ter(tecNFTOKEN_BUY_SELL_MISMATCH));
1223  env.close();
-
1224  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1224  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1225 
1226  // gw attempts to broker offers that are not for the same currency.
1227  env(token::brokerOffers(gw, buyerOfferIndex, plainOfferIndex),
1228  ter(tecNFTOKEN_BUY_SELL_MISMATCH));
1229  env.close();
-
1230  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1230  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1231 
1232  // In a brokered offer, the buyer must offer greater than or
1233  // equal to the selling price.
1234  env(token::brokerOffers(gw, buyerOfferIndex, audOfferIndex),
1235  ter(tecINSUFFICIENT_PAYMENT));
1236  env.close();
-
1237  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1237  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1238 
1239  // Remove buyer's offer.
1240  env(token::cancelOffer(buyer, {buyerOfferIndex}));
1241  env.close();
-
1242  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1242  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1243  }
1244  {
1245  // buyer creates a buy offer for one of alice's nfts.
@@ -1319,7 +1319,7 @@ $(function() {
1248  env(token::createOffer(buyer, nftAlice0ID, gwAUD(31)),
1249  token::owner(alice));
1250  env.close();
-
1251  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1251  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1252 
1253  // Broker sets their fee in a denomination other than the one
1254  // used by the offers
@@ -1327,14 +1327,14 @@ $(function() {
1256  token::brokerFee(XRP(40)),
1257  ter(tecNFTOKEN_BUY_SELL_MISMATCH));
1258  env.close();
-
1259  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1259  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1260 
1261  // Broker fee way too big.
1262  env(token::brokerOffers(gw, buyerOfferIndex, audOfferIndex),
1263  token::brokerFee(gwAUD(31)),
1264  ter(tecINSUFFICIENT_PAYMENT));
1265  env.close();
-
1266  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1266  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1267 
1268  // Broker fee is smaller, but still too big once the offer
1269  // seller's minimum is taken into account.
@@ -1342,12 +1342,12 @@ $(function() {
1271  token::brokerFee(gwAUD(1.5)),
1272  ter(tecINSUFFICIENT_PAYMENT));
1273  env.close();
-
1274  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1274  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1275 
1276  // Remove buyer's offer.
1277  env(token::cancelOffer(buyer, {buyerOfferIndex}));
1278  env.close();
-
1279  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1279  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1280  }
1281  //----------------------------------------------------------------------
1282  // preclaim buy
@@ -1358,19 +1358,19 @@ $(function() {
1287  env(token::createOffer(buyer, nftAlice0ID, gwAUD(30)),
1288  token::owner(alice));
1289  env.close();
-
1290  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1290  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1291 
1292  // Don't accept a buy offer if the sell flag is set.
1293  env(token::acceptBuyOffer(buyer, plainOfferIndex),
1294  ter(tecNFTOKEN_OFFER_TYPE_MISMATCH));
1295  env.close();
-
1296  BEAST_EXPECT(ownerCount(env, alice) == 7);
+
1296  BEAST_EXPECT(ownerCount(env, alice) == 7);
1297 
1298  // An account can't accept its own offer.
1299  env(token::acceptBuyOffer(buyer, buyerOfferIndex),
1300  ter(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER));
1301  env.close();
-
1302  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1302  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1303 
1304  // An offer acceptor must have enough funds to pay for the offer.
1305  env(pay(buyer, gw, gwAUD(30)));
@@ -1379,7 +1379,7 @@ $(function() {
1308  env(token::acceptBuyOffer(alice, buyerOfferIndex),
1309  ter(tecINSUFFICIENT_FUNDS));
1310  env.close();
-
1311  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1311  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1312 
1313  // alice gives her NFT to gw, so alice no longer owns nftAlice0.
1314  {
@@ -1390,7 +1390,7 @@ $(function() {
1319  env.close();
1320  env(token::acceptSellOffer(gw, offerIndex));
1321  env.close();
-
1322  BEAST_EXPECT(ownerCount(env, alice) == 7);
+
1322  BEAST_EXPECT(ownerCount(env, alice) == 7);
1323  }
1324  env(pay(gw, buyer, gwAUD(30)));
1325  env.close();
@@ -1399,12 +1399,12 @@ $(function() {
1328  env(token::acceptBuyOffer(alice, buyerOfferIndex),
1329  ter(tecNO_PERMISSION));
1330  env.close();
-
1331  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1331  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1332 
1333  // Remove buyer's offer.
1334  env(token::cancelOffer(buyer, {buyerOfferIndex}));
1335  env.close();
-
1336  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1336  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1337  }
1338  //----------------------------------------------------------------------
1339  // preclaim sell
@@ -1415,26 +1415,26 @@ $(function() {
1344  env(token::createOffer(buyer, nftXrpOnlyID, XRP(30)),
1345  token::owner(alice));
1346  env.close();
-
1347  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1347  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1348 
1349  // Don't accept a sell offer without the sell flag set.
1350  env(token::acceptSellOffer(alice, buyerOfferIndex),
1351  ter(tecNFTOKEN_OFFER_TYPE_MISMATCH));
1352  env.close();
-
1353  BEAST_EXPECT(ownerCount(env, alice) == 7);
+
1353  BEAST_EXPECT(ownerCount(env, alice) == 7);
1354 
1355  // An account can't accept its own offer.
1356  env(token::acceptSellOffer(alice, plainOfferIndex),
1357  ter(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER));
1358  env.close();
-
1359  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1359  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1360 
1361  // The seller must currently be in possession of the token they
1362  // are selling. alice gave nftAlice0ID to gw.
1363  env(token::acceptSellOffer(buyer, plainOfferIndex),
1364  ter(tecNO_PERMISSION));
1365  env.close();
-
1366  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1366  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1367 
1368  // gw gives nftAlice0ID back to alice. That allows us to check
1369  // buyer attempting to accept one of alice's offers with
@@ -1447,7 +1447,7 @@ $(function() {
1376  env.close();
1377  env(token::acceptSellOffer(alice, offerIndex));
1378  env.close();
-
1379  BEAST_EXPECT(ownerCount(env, alice) == 7);
+
1379  BEAST_EXPECT(ownerCount(env, alice) == 7);
1380  }
1381  env(pay(buyer, gw, gwAUD(30)));
1382  env.close();
@@ -1455,7 +1455,7 @@ $(function() {
1384  env(token::acceptSellOffer(buyer, audOfferIndex),
1385  ter(tecINSUFFICIENT_FUNDS));
1386  env.close();
-
1387  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1387  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1388  }
1389 
1390  //----------------------------------------------------------------------
@@ -1466,7 +1466,7 @@ $(function() {
1395  }
1396 
1397  void
-
1398  testMintFlagBurnable(FeatureBitset features)
+
1398  testMintFlagBurnable(FeatureBitset features)
1399  {
1400  // Exercise NFTs with flagBurnable set and not set.
1401  testcase("Mint flagBurnable");
@@ -1481,7 +1481,7 @@ $(function() {
1410 
1411  env.fund(XRP(1000), alice, buyer, minter1, minter2);
1412  env.close();
-
1413  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1413  BEAST_EXPECT(ownerCount(env, alice) == 0);
1414 
1415  // alice selects minter as her minter.
1416  env(token::setMinter(alice, minter1));
@@ -1525,10 +1525,10 @@ $(function() {
1454  ter(tecNO_PERMISSION));
1455  env.close();
1456 
-
1457  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1457  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1458  env(token::burn(buyer, noBurnID), token::owner(buyer));
1459  env.close();
-
1460  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1460  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1461  }
1462  // An NFT with flagBurnable can be burned by the issuer.
1463  {
@@ -1538,32 +1538,32 @@ $(function() {
1467  ter(tecNO_PERMISSION));
1468  env.close();
1469 
-
1470  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1470  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1471  env(token::burn(alice, burnableID), token::owner(buyer));
1472  env.close();
-
1473  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1473  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1474  }
1475  // An NFT with flagBurnable can be burned by the owner.
1476  {
1477  uint256 const burnableID = nftToBuyer(tfBurnable);
-
1478  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1478  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1479  env(token::burn(buyer, burnableID));
1480  env.close();
-
1481  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1481  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1482  }
1483  // An NFT with flagBurnable can be burned by the minter.
1484  {
1485  uint256 const burnableID = nftToBuyer(tfBurnable);
-
1486  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1486  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1487  env(token::burn(buyer, burnableID), token::owner(buyer));
1488  env.close();
-
1489  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1489  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1490  }
1491  // An nft with flagBurnable may be burned by the issuers' minter,
1492  // who may not be the original minter.
1493  {
1494  uint256 const burnableID = nftToBuyer(tfBurnable);
-
1495  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1495  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1496 
1497  env(token::setMinter(alice, minter2));
1498  env.close();
@@ -1574,17 +1574,17 @@ $(function() {
1503  token::owner(buyer),
1504  ter(tecNO_PERMISSION));
1505  env.close();
-
1506  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1506  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1507 
1508  // minter2, however, can burn alice's nfts.
1509  env(token::burn(minter2, burnableID), token::owner(buyer));
1510  env.close();
-
1511  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
1511  BEAST_EXPECT(ownerCount(env, buyer) == 0);
1512  }
1513  }
1514 
1515  void
-
1516  testMintFlagOnlyXRP(FeatureBitset features)
+
1516  testMintFlagOnlyXRP(FeatureBitset features)
1517  {
1518  // Exercise NFTs with flagOnlyXRP set and not set.
1519  testcase("Mint flagOnlyXRP");
@@ -1612,33 +1612,33 @@ $(function() {
1541  env(token::mint(alice, 0u), txflags(tfTransferable));
1542  env.close();
1543 
-
1544  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1544  BEAST_EXPECT(ownerCount(env, alice) == 2);
1545  uint256 const aliceOfferIndex =
1546  keylet::nftoffer(alice, env.seq(alice)).key;
1547  env(token::createOffer(alice, nftIOUsOkayID, gwAUD(50)),
1548  txflags(tfSellNFToken));
1549  env.close();
-
1550  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
1550  BEAST_EXPECT(ownerCount(env, alice) == 3);
1551 
-
1552  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1552  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1553  uint256 const buyerOfferIndex =
1554  keylet::nftoffer(buyer, env.seq(buyer)).key;
1555  env(token::createOffer(buyer, nftIOUsOkayID, gwAUD(50)),
1556  token::owner(alice));
1557  env.close();
-
1558  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1558  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1559 
1560  // Cancel the two offers just to be tidy.
1561  env(token::cancelOffer(alice, {aliceOfferIndex}));
1562  env(token::cancelOffer(buyer, {buyerOfferIndex}));
1563  env.close();
-
1564  BEAST_EXPECT(ownerCount(env, alice) == 2);
-
1565  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1564  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1565  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1566 
1567  // Also burn alice's nft.
1568  env(token::burn(alice, nftIOUsOkayID));
1569  env.close();
-
1570  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1570  BEAST_EXPECT(ownerCount(env, alice) == 1);
1571  }
1572 
1573  // Set flagOnlyXRP and offers using IOUs are rejected.
@@ -1648,37 +1648,37 @@ $(function() {
1577  env(token::mint(alice, 0u), txflags(tfOnlyXRP | tfTransferable));
1578  env.close();
1579 
-
1580  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1580  BEAST_EXPECT(ownerCount(env, alice) == 2);
1581  env(token::createOffer(alice, nftOnlyXRPID, gwAUD(50)),
1582  txflags(tfSellNFToken),
1583  ter(temBAD_AMOUNT));
1584  env.close();
-
1585  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1585  BEAST_EXPECT(ownerCount(env, alice) == 2);
1586 
-
1587  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1587  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1588  env(token::createOffer(buyer, nftOnlyXRPID, gwAUD(50)),
1589  token::owner(alice),
1590  ter(temBAD_AMOUNT));
1591  env.close();
-
1592  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1592  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1593 
1594  // However offers for XRP are okay.
-
1595  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
1595  BEAST_EXPECT(ownerCount(env, alice) == 2);
1596  env(token::createOffer(alice, nftOnlyXRPID, XRP(60)),
1597  txflags(tfSellNFToken));
1598  env.close();
-
1599  BEAST_EXPECT(ownerCount(env, alice) == 3);
+
1599  BEAST_EXPECT(ownerCount(env, alice) == 3);
1600 
-
1601  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
1601  BEAST_EXPECT(ownerCount(env, buyer) == 1);
1602  env(token::createOffer(buyer, nftOnlyXRPID, XRP(60)),
1603  token::owner(alice));
1604  env.close();
-
1605  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
1605  BEAST_EXPECT(ownerCount(env, buyer) == 2);
1606  }
1607  }
1608 
1609  void
-
1610  testMintFlagCreateTrustLine(FeatureBitset features)
+
1610  testMintFlagCreateTrustLine(FeatureBitset features)
1611  {
1612  // Exercise NFTs with flagCreateTrustLines set and not set.
1613  testcase("Mint flagCreateTrustLines");
@@ -1870,7 +1870,7 @@ $(function() {
1799  }
1800 
1801  void
-
1802  testMintFlagTransferable(FeatureBitset features)
+
1802  testMintFlagTransferable(FeatureBitset features)
1803  {
1804  // Exercise NFTs with flagTransferable set and not set.
1805  testcase("Mint flagTransferable");
@@ -1888,15 +1888,15 @@ $(function() {
1817 
1818  // First try an nft made by alice without flagTransferable set.
1819  {
-
1820  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1820  BEAST_EXPECT(ownerCount(env, alice) == 0);
1821  uint256 const nftAliceNoTransferID{
1822  token::getNextID(env, alice, 0u)};
1823  env(token::mint(alice, 0u), token::xferFee(0));
1824  env.close();
-
1825  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1825  BEAST_EXPECT(ownerCount(env, alice) == 1);
1826 
1827  // becky tries to offer to buy alice's nft.
-
1828  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1828  BEAST_EXPECT(ownerCount(env, becky) == 0);
1829  env(token::createOffer(becky, nftAliceNoTransferID, XRP(20)),
1830  token::owner(alice),
1831  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
@@ -1909,16 +1909,16 @@ $(function() {
1838  env.close();
1839  env(token::acceptSellOffer(becky, aliceSellOfferIndex));
1840  env.close();
-
1841  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
1842  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
1841  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1842  BEAST_EXPECT(ownerCount(env, becky) == 1);
1843 
1844  // becky tries to offer the nft for sale.
1845  env(token::createOffer(becky, nftAliceNoTransferID, XRP(21)),
1846  txflags(tfSellNFToken),
1847  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
1848  env.close();
-
1849  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
1850  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
1849  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1850  BEAST_EXPECT(ownerCount(env, becky) == 1);
1851 
1852  // becky tries to offer the nft for sale with alice as the
1853  // destination. That also doesn't work.
@@ -1927,8 +1927,8 @@ $(function() {
1856  token::destination(alice),
1857  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
1858  env.close();
-
1859  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
1860  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
1859  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1860  BEAST_EXPECT(ownerCount(env, becky) == 1);
1861 
1862  // alice offers to buy the nft back from becky. becky accepts
1863  // the offer.
@@ -1939,46 +1939,46 @@ $(function() {
1868  env.close();
1869  env(token::acceptBuyOffer(becky, aliceBuyOfferIndex));
1870  env.close();
-
1871  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
1872  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1871  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1872  BEAST_EXPECT(ownerCount(env, becky) == 0);
1873 
1874  // alice burns her nft so accounting is simpler below.
1875  env(token::burn(alice, nftAliceNoTransferID));
1876  env.close();
-
1877  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
1878  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1877  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1878  BEAST_EXPECT(ownerCount(env, becky) == 0);
1879  }
1880  // Try an nft minted by minter for alice without flagTransferable set.
1881  {
1882  env(token::setMinter(alice, minter));
1883  env.close();
1884 
-
1885  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
1885  BEAST_EXPECT(ownerCount(env, minter) == 0);
1886  uint256 const nftMinterNoTransferID{
1887  token::getNextID(env, alice, 0u)};
1888  env(token::mint(minter), token::issuer(alice));
1889  env.close();
-
1890  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1890  BEAST_EXPECT(ownerCount(env, minter) == 1);
1891 
1892  // becky tries to offer to buy minter's nft.
-
1893  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1893  BEAST_EXPECT(ownerCount(env, becky) == 0);
1894  env(token::createOffer(becky, nftMinterNoTransferID, XRP(20)),
1895  token::owner(minter),
1896  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
1897  env.close();
-
1898  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1898  BEAST_EXPECT(ownerCount(env, becky) == 0);
1899 
1900  // alice removes authorization of minter.
1901  env(token::clearMinter(alice));
1902  env.close();
1903 
1904  // minter tries to offer their nft for sale.
-
1905  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1905  BEAST_EXPECT(ownerCount(env, minter) == 1);
1906  env(token::createOffer(minter, nftMinterNoTransferID, XRP(21)),
1907  txflags(tfSellNFToken),
1908  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
1909  env.close();
-
1910  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1910  BEAST_EXPECT(ownerCount(env, minter) == 1);
1911 
1912  // Let enough ledgers pass that old transactions are no longer
1913  // retried, then alice gives authorization back to minter.
@@ -1987,16 +1987,16 @@ $(function() {
1916 
1917  env(token::setMinter(alice, minter));
1918  env.close();
-
1919  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1919  BEAST_EXPECT(ownerCount(env, minter) == 1);
1920 
1921  // minter successfully offers their nft for sale.
-
1922  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1922  BEAST_EXPECT(ownerCount(env, minter) == 1);
1923  uint256 const minterSellOfferIndex =
1924  keylet::nftoffer(minter, env.seq(minter)).key;
1925  env(token::createOffer(minter, nftMinterNoTransferID, XRP(22)),
1926  txflags(tfSellNFToken));
1927  env.close();
-
1928  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
1928  BEAST_EXPECT(ownerCount(env, minter) == 2);
1929 
1930  // alice removes authorization of minter so we can see whether
1931  // minter's pre-existing offer still works.
@@ -2005,11 +2005,11 @@ $(function() {
1934 
1935  // becky buys minter's nft even though minter is no longer alice's
1936  // official minter.
-
1937  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1937  BEAST_EXPECT(ownerCount(env, becky) == 0);
1938  env(token::acceptSellOffer(becky, minterSellOfferIndex));
1939  env.close();
-
1940  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
1941  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
1940  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
1941  BEAST_EXPECT(ownerCount(env, minter) == 0);
1942 
1943  // becky attempts to sell the nft.
1944  env(token::createOffer(becky, nftMinterNoTransferID, XRP(23)),
@@ -2019,21 +2019,21 @@ $(function() {
1948 
1949  // Since minter is not, at the moment, alice's official minter
1950  // they cannot create an offer to buy the nft they minted.
-
1951  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
1951  BEAST_EXPECT(ownerCount(env, minter) == 0);
1952  env(token::createOffer(minter, nftMinterNoTransferID, XRP(24)),
1953  token::owner(becky),
1954  ter(tefNFTOKEN_IS_NOT_TRANSFERABLE));
1955  env.close();
-
1956  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
1956  BEAST_EXPECT(ownerCount(env, minter) == 0);
1957 
1958  // alice can create an offer to buy the nft.
-
1959  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
1959  BEAST_EXPECT(ownerCount(env, alice) == 0);
1960  uint256 const aliceBuyOfferIndex =
1961  keylet::nftoffer(alice, env.seq(alice)).key;
1962  env(token::createOffer(alice, nftMinterNoTransferID, XRP(25)),
1963  token::owner(becky));
1964  env.close();
-
1965  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1965  BEAST_EXPECT(ownerCount(env, alice) == 1);
1966 
1967  // Let enough ledgers pass that old transactions are no longer
1968  // retried, then alice gives authorization back to minter.
@@ -2044,13 +2044,13 @@ $(function() {
1973  env.close();
1974 
1975  // Now minter can create an offer to buy the nft.
-
1976  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
1976  BEAST_EXPECT(ownerCount(env, minter) == 0);
1977  uint256 const minterBuyOfferIndex =
1978  keylet::nftoffer(minter, env.seq(minter)).key;
1979  env(token::createOffer(minter, nftMinterNoTransferID, XRP(26)),
1980  token::owner(becky));
1981  env.close();
-
1982  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1982  BEAST_EXPECT(ownerCount(env, minter) == 1);
1983 
1984  // alice removes authorization of minter so we can see whether
1985  // minter's pre-existing buy offer still works.
@@ -2058,13 +2058,13 @@ $(function() {
1987  env.close();
1988 
1989  // becky accepts minter's sell offer.
-
1990  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
1991  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
1990  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1991  BEAST_EXPECT(ownerCount(env, becky) == 1);
1992  env(token::acceptBuyOffer(becky, minterBuyOfferIndex));
1993  env.close();
-
1994  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
1995  BEAST_EXPECT(ownerCount(env, becky) == 0);
-
1996  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
1994  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
1995  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
1996  BEAST_EXPECT(ownerCount(env, alice) == 1);
1997 
1998  // minter burns their nft and alice cancels her offer so the
1999  // next tests can start with a clean slate.
@@ -2072,19 +2072,19 @@ $(function() {
2001  env.close();
2002  env(token::cancelOffer(alice, {aliceBuyOfferIndex}));
2003  env.close();
-
2004  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2005  BEAST_EXPECT(ownerCount(env, becky) == 0);
-
2006  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2004  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2005  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
2006  BEAST_EXPECT(ownerCount(env, minter) == 0);
2007  }
2008  // nfts with flagTransferable set should be buyable and salable
2009  // by anybody.
2010  {
-
2011  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2011  BEAST_EXPECT(ownerCount(env, alice) == 0);
2012  uint256 const nftAliceID{
2013  token::getNextID(env, alice, 0u, tfTransferable)};
2014  env(token::mint(alice, 0u), txflags(tfTransferable));
2015  env.close();
-
2016  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2016  BEAST_EXPECT(ownerCount(env, alice) == 1);
2017 
2018  // Both alice and becky can make offers for alice's nft.
2019  uint256 const aliceSellOfferIndex =
@@ -2092,20 +2092,20 @@ $(function() {
2021  env(token::createOffer(alice, nftAliceID, XRP(20)),
2022  txflags(tfSellNFToken));
2023  env.close();
-
2024  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
2024  BEAST_EXPECT(ownerCount(env, alice) == 2);
2025 
2026  uint256 const beckyBuyOfferIndex =
2027  keylet::nftoffer(becky, env.seq(becky)).key;
2028  env(token::createOffer(becky, nftAliceID, XRP(21)),
2029  token::owner(alice));
2030  env.close();
-
2031  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
2031  BEAST_EXPECT(ownerCount(env, alice) == 2);
2032 
2033  // becky accepts alice's sell offer.
2034  env(token::acceptSellOffer(becky, aliceSellOfferIndex));
2035  env.close();
-
2036  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2037  BEAST_EXPECT(ownerCount(env, becky) == 2);
+
2036  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2037  BEAST_EXPECT(ownerCount(env, becky) == 2);
2038 
2039  // becky offers to sell the nft.
2040  uint256 const beckySellOfferIndex =
@@ -2113,16 +2113,16 @@ $(function() {
2042  env(token::createOffer(becky, nftAliceID, XRP(22)),
2043  txflags(tfSellNFToken));
2044  env.close();
-
2045  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2046  BEAST_EXPECT(ownerCount(env, becky) == 3);
+
2045  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2046  BEAST_EXPECT(ownerCount(env, becky) == 3);
2047 
2048  // minter buys the nft (even though minter is not currently
2049  // alice's minter).
2050  env(token::acceptSellOffer(minter, beckySellOfferIndex));
2051  env.close();
-
2052  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2053  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2054  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2052  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2053  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2054  BEAST_EXPECT(ownerCount(env, minter) == 1);
2055 
2056  // minter offers to sell the nft.
2057  uint256 const minterSellOfferIndex =
@@ -2130,37 +2130,37 @@ $(function() {
2059  env(token::createOffer(minter, nftAliceID, XRP(23)),
2060  txflags(tfSellNFToken));
2061  env.close();
-
2062  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2063  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2064  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
2062  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2063  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2064  BEAST_EXPECT(ownerCount(env, minter) == 2);
2065 
2066  // alice buys back the nft.
2067  env(token::acceptSellOffer(alice, minterSellOfferIndex));
2068  env.close();
-
2069  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
2070  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2071  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2069  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2070  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2071  BEAST_EXPECT(ownerCount(env, minter) == 0);
2072 
2073  // Remember the buy offer that becky made for alice's token way
2074  // back when? It's still in the ledger, and alice accepts it.
2075  env(token::acceptBuyOffer(alice, beckyBuyOfferIndex));
2076  env.close();
-
2077  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2078  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2079  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2077  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2078  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2079  BEAST_EXPECT(ownerCount(env, minter) == 0);
2080 
2081  // Just for tidyness, becky burns the token before shutting
2082  // things down.
2083  env(token::burn(becky, nftAliceID));
2084  env.close();
-
2085  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
2086  BEAST_EXPECT(ownerCount(env, becky) == 0);
-
2087  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2085  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
2086  BEAST_EXPECT(ownerCount(env, becky) == 0);
+
2087  BEAST_EXPECT(ownerCount(env, minter) == 0);
2088  }
2089  }
2090 
2091  void
-
2092  testMintTransferFee(FeatureBitset features)
+
2092  testMintTransferFee(FeatureBitset features)
2093  {
2094  // Exercise NFTs with and without a transferFee.
2095  testcase("Mint transferFee");
@@ -2198,10 +2198,10 @@ $(function() {
2127  // If there is no transferFee, then alice gets nothing for the
2128  // transfer.
2129  {
-
2130  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
2131  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2132  BEAST_EXPECT(ownerCount(env, carol) == 1);
-
2133  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2130  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2131  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2132  BEAST_EXPECT(ownerCount(env, carol) == 1);
+
2133  BEAST_EXPECT(ownerCount(env, minter) == 1);
2134 
2135  uint256 const nftID =
2136  token::getNextID(env, alice, 0u, tfTransferable);
@@ -2264,10 +2264,10 @@ $(function() {
2193  // alice burns the nft to make later tests easier to think about.
2194  env(token::burn(alice, nftID));
2195  env.close();
-
2196  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
2197  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2198  BEAST_EXPECT(ownerCount(env, carol) == 1);
-
2199  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2196  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2197  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2198  BEAST_EXPECT(ownerCount(env, carol) == 1);
+
2199  BEAST_EXPECT(ownerCount(env, minter) == 1);
2200  }
2201 
2202  // Set the smallest possible transfer fee.
@@ -2347,10 +2347,10 @@ $(function() {
2276  // alice burns the nft to make later tests easier to think about.
2277  env(token::burn(alice, nftID));
2278  env.close();
-
2279  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
2280  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2281  BEAST_EXPECT(ownerCount(env, carol) == 1);
-
2282  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2279  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2280  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2281  BEAST_EXPECT(ownerCount(env, carol) == 1);
+
2282  BEAST_EXPECT(ownerCount(env, minter) == 1);
2283  }
2284 
2285  // Set the largest allowed transfer fee.
@@ -2438,10 +2438,10 @@ $(function() {
2367  // alice burns the nft to make later tests easier to think about.
2368  env(token::burn(alice, nftID));
2369  env.close();
-
2370  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
2371  BEAST_EXPECT(ownerCount(env, becky) == 1);
-
2372  BEAST_EXPECT(ownerCount(env, carol) == 1);
-
2373  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2370  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
2371  BEAST_EXPECT(ownerCount(env, becky) == 1);
+
2372  BEAST_EXPECT(ownerCount(env, carol) == 1);
+
2373  BEAST_EXPECT(ownerCount(env, minter) == 1);
2374  }
2375 
2376  // See the impact of rounding when the nft is sold for small amounts
@@ -2597,7 +2597,7 @@ $(function() {
2526  }
2527 
2528  void
-
2529  testMintTaxon(FeatureBitset features)
+
2529  testMintTaxon(FeatureBitset features)
2530  {
2531  // Exercise the NFT taxon field.
2532  testcase("Mint taxon");
@@ -2672,7 +2672,7 @@ $(function() {
2601  }
2602 
2603  void
-
2604  testMintURI(FeatureBitset features)
+
2604  testMintURI(FeatureBitset features)
2605  {
2606  // Exercise the NFT URI field.
2607  // 1. Create a number of NFTs with and without URIs.
@@ -2782,7 +2782,7 @@ $(function() {
2711  }
2712 
2713  void
-
2714  testCreateOfferDestination(FeatureBitset features)
+
2714  testCreateOfferDestination(FeatureBitset features)
2715  {
2716  // Explore the CreateOffer Destination field.
2717  testcase("Create offer destination");
@@ -2838,9 +2838,9 @@ $(function() {
2767  token::destination(buyer));
2768 
2769  env.close();
-
2770  BEAST_EXPECT(ownerCount(env, issuer) == 2);
-
2771  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
2772  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2770  BEAST_EXPECT(ownerCount(env, issuer) == 2);
+
2771  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
2772  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2773 
2774  // Test who gets to cancel the offers. Anyone outside of the
2775  // offer-owner/destination pair should not be able to cancel the
@@ -2858,9 +2858,9 @@ $(function() {
2787  env(token::cancelOffer(minter, {offerIssuerToBuyer}),
2788  ter(tecNO_PERMISSION));
2789  env.close();
-
2790  BEAST_EXPECT(ownerCount(env, issuer) == 2);
-
2791  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
2792  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2790  BEAST_EXPECT(ownerCount(env, issuer) == 2);
+
2791  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
2792  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2793 
2794  // Both the offer creator and and destination should be able to
2795  // cancel the offers.
@@ -2869,9 +2869,9 @@ $(function() {
2798  env(token::cancelOffer(buyer, {offerIssuerToBuyer}));
2799  env(token::cancelOffer(issuer, {offerIssuerToMinter}));
2800  env.close();
-
2801  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2802  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2803  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2801  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2802  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2803  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2804  }
2805 
2806  // Test how adding a Destination field to a sell offer affects
@@ -2883,25 +2883,25 @@ $(function() {
2812  token::destination(buyer),
2813  txflags(tfSellNFToken));
2814  env.close();
-
2815  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2816  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
2817  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2815  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2816  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
2817  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2818 
2819  // issuer cannot accept a sell offer where they are not the
2820  // destination.
2821  env(token::acceptSellOffer(issuer, offerMinterSellsToBuyer),
2822  ter(tecNO_PERMISSION));
2823  env.close();
-
2824  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2825  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
2826  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2824  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2825  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
2826  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2827 
2828  // However buyer can accept the sell offer.
2829  env(token::acceptSellOffer(buyer, offerMinterSellsToBuyer));
2830  env.close();
-
2831  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2832  BEAST_EXPECT(ownerCount(env, minter) == 0);
-
2833  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2831  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2832  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2833  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2834  }
2835 
2836  // Test how adding a Destination field to a buy offer affects
@@ -2913,25 +2913,25 @@ $(function() {
2842  token::owner(buyer),
2843  token::destination(buyer));
2844  env.close();
-
2845  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2846  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2847  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2845  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2846  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2847  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2848 
2849  // issuer cannot accept a buy offer where they are the
2850  // destination.
2851  env(token::acceptBuyOffer(issuer, offerMinterBuysFromBuyer),
2852  ter(tecNO_PERMISSION));
2853  env.close();
-
2854  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2855  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2856  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2854  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2855  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2856  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2857 
2858  // Buyer accepts minter's offer.
2859  env(token::acceptBuyOffer(buyer, offerMinterBuysFromBuyer));
2860  env.close();
-
2861  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2862  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2863  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2861  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2862  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2863  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2864 
2865  // If a destination other than the NFToken owner is set, that
2866  // destination must act as a broker. The NFToken owner may not
@@ -2942,9 +2942,9 @@ $(function() {
2871  token::owner(minter),
2872  token::destination(broker));
2873  env.close();
-
2874  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2875  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2876  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2874  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2875  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2876  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2877 
2878  env(token::acceptBuyOffer(minter, offerBuyerBuysFromMinter),
2879  ter(tecNO_PERMISSION));
@@ -2953,9 +2953,9 @@ $(function() {
2882  // Clean up the unused offer.
2883  env(token::cancelOffer(buyer, {offerBuyerBuysFromMinter}));
2884  env.close();
-
2885  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2886  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2887  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2885  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2886  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2887  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2888  }
2889 
2890  // Show that a sell offer's Destination can broker that sell offer
@@ -2973,9 +2973,9 @@ $(function() {
2902  token::owner(minter));
2903 
2904  env.close();
-
2905  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2906  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
2907  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2905  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2906  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
2907  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2908 
2909  {
2910  // issuer cannot broker the offers, because they are not the
@@ -2987,9 +2987,9 @@ $(function() {
2916  issuer, offerBuyerToMinter, offerMinterToBroker),
2917  ter(expectTer));
2918  env.close();
-
2919  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2920  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
2921  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2919  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2920  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
2921  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2922  }
2923 
2924  // Since broker is the sell offer's destination, they can broker
@@ -2997,9 +2997,9 @@ $(function() {
2926  env(token::brokerOffers(
2927  broker, offerBuyerToMinter, offerMinterToBroker));
2928  env.close();
-
2929  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
2930  BEAST_EXPECT(ownerCount(env, minter) == 0);
-
2931  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
2929  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
2930  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
2931  BEAST_EXPECT(ownerCount(env, buyer) == 1);
2932  }
2933 
2934  // Show that brokered mode cannot complete a transfer where the
@@ -3023,9 +3023,9 @@ $(function() {
2952  token::owner(buyer));
2953 
2954  env.close();
-
2955  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
2956  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2957  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
2955  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
2956  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2957  BEAST_EXPECT(ownerCount(env, buyer) == 2);
2958 
2959  {
2960  // Cannot broker offers when the sell destination is not the
@@ -3038,9 +3038,9 @@ $(function() {
2967  ter(expectTer));
2968  env.close();
2969 
-
2970  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
2971  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2972  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
2970  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
2971  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2972  BEAST_EXPECT(ownerCount(env, buyer) == 2);
2973 
2974  // amendment switch: When enabled the broker fails, when
2975  // disabled the broker succeeds if the destination is the buyer.
@@ -3061,16 +3061,16 @@ $(function() {
2990  env(token::cancelOffer(buyer, {offerBuyerToMinter}));
2991  env.close();
2992 
-
2993  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
2994  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
2995  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
2993  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
2994  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
2995  BEAST_EXPECT(ownerCount(env, buyer) == 0);
2996 
2997  // Clean out the unconsumed offer.
2998  env(token::cancelOffer(issuer, {offerIssuerToBuyer}));
2999  env.close();
-
3000  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3001  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3002  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3000  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3001  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3002  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3003  return;
3004  }
3005  }
@@ -3100,23 +3100,23 @@ $(function() {
3029  issuer, offerBuyerToBroker, offerMinterToBroker),
3030  ter(expectTer));
3031  env.close();
-
3032  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3033  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3034  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3032  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3033  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3034  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3035  }
3036 
3037  // Broker is successful if they are the destination of both offers.
3038  env(token::brokerOffers(
3039  broker, offerBuyerToBroker, offerMinterToBroker));
3040  env.close();
-
3041  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3042  BEAST_EXPECT(ownerCount(env, minter) == 0);
-
3043  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3041  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3042  BEAST_EXPECT(ownerCount(env, minter) == 0);
+
3043  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3044  }
3045  }
3046 
3047  void
-
3048  testCreateOfferDestinationDisallowIncoming(FeatureBitset features)
+
3048  testCreateOfferDestinationDisallowIncoming(FeatureBitset features)
3049  {
3050  testcase("Create offer destination disallow incoming");
3051 
@@ -3124,7 +3124,7 @@ $(function() {
3053 
3054  // test flag doesn't set unless amendment enabled
3055  {
-
3056  Env env{*this, features - disallowIncoming};
+
3056  Env env{*this, features - disallowIncoming};
3057  Account const alice{"alice"};
3058  env.fund(XRP(10000), alice);
3059  env(fset(alice, asfDisallowIncomingNFTokenOffer));
@@ -3134,7 +3134,7 @@ $(function() {
3063  BEAST_EXPECT(!(flags & lsfDisallowIncomingNFTokenOffer));
3064  }
3065 
-
3066  Env env{*this, features | disallowIncoming};
+
3066  Env env{*this, features | disallowIncoming};
3067 
3068  Account const issuer{"issuer"};
3069  Account const minter{"minter"};
@@ -3164,9 +3164,9 @@ $(function() {
3093  txflags(tfSellNFToken),
3094  ter(tecNO_PERMISSION));
3095  env.close();
-
3096  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3097  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3098  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3096  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3097  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3098  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3099  }
3100 
3101  // disable the flag
@@ -3245,7 +3245,7 @@ $(function() {
3174  }
3175 
3176  void
-
3177  testCreateOfferExpiration(FeatureBitset features)
+
3177  testCreateOfferExpiration(FeatureBitset features)
3178  {
3179  // Explore the CreateOffer Expiration field.
3180  testcase("Create offer expiration");
@@ -3282,7 +3282,7 @@ $(function() {
3211  // Test how adding an Expiration field to an offer affects permissions
3212  // for cancelling offers.
3213  {
-
3214  std::uint32_t const expiration = lastClose(env) + 25;
+
3214  std::uint32_t const expiration = lastClose(env) + 25;
3215 
3216  uint256 const offerMinterToIssuer =
3217  keylet::nftoffer(minter, env.seq(minter)).key;
@@ -3309,9 +3309,9 @@ $(function() {
3238  token::owner(minter),
3239  token::expiration(expiration));
3240  env.close();
-
3241  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
3242  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3243  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3241  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
3242  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3243  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3244 
3245  // Test who gets to cancel the offers. Anyone outside of the
3246  // offer-owner/destination pair should not be able to cancel
@@ -3324,10 +3324,10 @@ $(function() {
3253  env(token::cancelOffer(buyer, {offerIssuerToMinter}),
3254  ter(tecNO_PERMISSION));
3255  env.close();
-
3256  BEAST_EXPECT(lastClose(env) < expiration);
-
3257  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
3258  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3259  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3256  BEAST_EXPECT(lastClose(env) < expiration);
+
3257  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
3258  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3259  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3260 
3261  // The offer creator can cancel their own unexpired offer.
3262  env(token::cancelOffer(minter, {offerMinterToAnyone}));
@@ -3337,27 +3337,27 @@ $(function() {
3266  env(token::cancelOffer(issuer, {offerMinterToIssuer}));
3267 
3268  // Close enough ledgers to get past the expiration.
-
3269  while (lastClose(env) < expiration)
+
3269  while (lastClose(env) < expiration)
3270  env.close();
3271 
-
3272  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
3273  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3274  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3272  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
3273  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3274  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3275 
3276  // Anyone can cancel expired offers.
3277  env(token::cancelOffer(issuer, {offerBuyerToMinter}));
3278  env(token::cancelOffer(buyer, {offerIssuerToMinter}));
3279  env.close();
-
3280  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3281  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3282  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3280  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3281  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3282  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3283  }
3284  // Show that:
3285  // 1. An unexpired sell offer with an expiration can be accepted.
3286  // 2. An expired sell offer cannot be accepted and remains
3287  // in ledger after the accept fails.
3288  {
-
3289  std::uint32_t const expiration = lastClose(env) + 25;
+
3289  std::uint32_t const expiration = lastClose(env) + 25;
3290 
3291  uint256 const offer0 =
3292  keylet::nftoffer(minter, env.seq(minter)).key;
@@ -3371,21 +3371,21 @@ $(function() {
3300  token::expiration(expiration),
3301  txflags(tfSellNFToken));
3302  env.close();
-
3303  BEAST_EXPECT(lastClose(env) < expiration);
-
3304  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3305  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3306  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3303  BEAST_EXPECT(lastClose(env) < expiration);
+
3304  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3305  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3306  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3307 
3308  // Anyone can accept an unexpired sell offer.
3309  env(token::acceptSellOffer(buyer, offer0));
3310 
3311  // Close enough ledgers to get past the expiration.
-
3312  while (lastClose(env) < expiration)
+
3312  while (lastClose(env) < expiration)
3313  env.close();
3314 
-
3315  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3316  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3317  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3315  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3316  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3317  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3318 
3319  // No one can accept an expired sell offer.
3320  env(token::acceptSellOffer(buyer, offer1), ter(tecEXPIRED));
@@ -3393,16 +3393,16 @@ $(function() {
3322  env.close();
3323 
3324  // The expired sell offer is still in the ledger.
-
3325  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3326  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3327  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3325  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3326  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3327  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3328 
3329  // Anyone can cancel the expired sell offer.
3330  env(token::cancelOffer(issuer, {offer1}));
3331  env.close();
-
3332  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3333  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3334  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3332  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3333  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3334  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3335 
3336  // Transfer nftokenID0 back to minter so we start the next test in
3337  // a simple place.
@@ -3414,16 +3414,16 @@ $(function() {
3343  env.close();
3344  env(token::acceptSellOffer(minter, offerSellBack));
3345  env.close();
-
3346  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3347  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3348  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3346  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3347  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3348  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3349  }
3350  // Show that:
3351  // 1. An unexpired buy offer with an expiration can be accepted.
3352  // 2. An expired buy offer cannot be accepted and remains
3353  // in ledger after the accept fails.
3354  {
-
3355  std::uint32_t const expiration = lastClose(env) + 25;
+
3355  std::uint32_t const expiration = lastClose(env) + 25;
3356 
3357  uint256 const offer0 = keylet::nftoffer(buyer, env.seq(buyer)).key;
3358  env(token::createOffer(buyer, nftokenID0, drops(1)),
@@ -3435,21 +3435,21 @@ $(function() {
3364  token::owner(minter),
3365  token::expiration(expiration));
3366  env.close();
-
3367  BEAST_EXPECT(lastClose(env) < expiration);
-
3368  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3369  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3370  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3367  BEAST_EXPECT(lastClose(env) < expiration);
+
3368  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3369  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3370  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3371 
3372  // An unexpired buy offer can be accepted.
3373  env(token::acceptBuyOffer(minter, offer0));
3374 
3375  // Close enough ledgers to get past the expiration.
-
3376  while (lastClose(env) < expiration)
+
3376  while (lastClose(env) < expiration)
3377  env.close();
3378 
-
3379  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3380  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3381  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3379  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3380  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3381  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3382 
3383  // An expired buy offer cannot be accepted.
3384  env(token::acceptBuyOffer(minter, offer1), ter(tecEXPIRED));
@@ -3457,16 +3457,16 @@ $(function() {
3386  env.close();
3387 
3388  // The expired buy offer is still in the ledger.
-
3389  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3390  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3391  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3389  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3390  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3391  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3392 
3393  // Anyone can cancel the expired buy offer.
3394  env(token::cancelOffer(issuer, {offer1}));
3395  env.close();
-
3396  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3397  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3398  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3396  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3397  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3398  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3399 
3400  // Transfer nftokenID0 back to minter so we start the next test in
3401  // a simple place.
@@ -3478,16 +3478,16 @@ $(function() {
3407  env.close();
3408  env(token::acceptSellOffer(minter, offerSellBack));
3409  env.close();
-
3410  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3411  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3412  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3410  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3411  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3412  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3413  }
3414  // Show that in brokered mode:
3415  // 1. An unexpired sell offer with an expiration can be accepted.
3416  // 2. An expired sell offer cannot be accepted and remains
3417  // in ledger after the accept fails.
3418  {
-
3419  std::uint32_t const expiration = lastClose(env) + 25;
+
3419  std::uint32_t const expiration = lastClose(env) + 25;
3420 
3421  uint256 const sellOffer0 =
3422  keylet::nftoffer(minter, env.seq(minter)).key;
@@ -3512,21 +3512,21 @@ $(function() {
3441  token::owner(minter));
3442 
3443  env.close();
-
3444  BEAST_EXPECT(lastClose(env) < expiration);
-
3445  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3446  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3447  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3444  BEAST_EXPECT(lastClose(env) < expiration);
+
3445  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3446  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3447  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3448 
3449  // An unexpired offer can be brokered.
3450  env(token::brokerOffers(issuer, buyOffer0, sellOffer0));
3451 
3452  // Close enough ledgers to get past the expiration.
-
3453  while (lastClose(env) < expiration)
+
3453  while (lastClose(env) < expiration)
3454  env.close();
3455 
-
3456  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3457  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3458  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3456  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3457  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3458  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3459 
3460  // If the sell offer is expired it cannot be brokered.
3461  env(token::brokerOffers(issuer, buyOffer1, sellOffer1),
@@ -3534,16 +3534,16 @@ $(function() {
3463  env.close();
3464 
3465  // The expired sell offer is still in the ledger.
-
3466  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3467  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3468  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3466  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3467  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3468  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3469 
3470  // Anyone can cancel the expired sell offer.
3471  env(token::cancelOffer(buyer, {buyOffer1, sellOffer1}));
3472  env.close();
-
3473  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3474  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3475  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3473  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3474  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3475  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3476 
3477  // Transfer nftokenID0 back to minter so we start the next test in
3478  // a simple place.
@@ -3555,16 +3555,16 @@ $(function() {
3484  env.close();
3485  env(token::acceptSellOffer(minter, offerSellBack));
3486  env.close();
-
3487  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3488  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3489  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3487  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3488  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3489  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3490  }
3491  // Show that in brokered mode:
3492  // 1. An unexpired buy offer with an expiration can be accepted.
3493  // 2. An expired buy offer cannot be accepted and remains
3494  // in ledger after the accept fails.
3495  {
-
3496  std::uint32_t const expiration = lastClose(env) + 25;
+
3496  std::uint32_t const expiration = lastClose(env) + 25;
3497 
3498  uint256 const sellOffer0 =
3499  keylet::nftoffer(minter, env.seq(minter)).key;
@@ -3589,21 +3589,21 @@ $(function() {
3518  token::owner(minter));
3519 
3520  env.close();
-
3521  BEAST_EXPECT(lastClose(env) < expiration);
-
3522  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3523  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3524  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3521  BEAST_EXPECT(lastClose(env) < expiration);
+
3522  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3523  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3524  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3525 
3526  // An unexpired offer can be brokered.
3527  env(token::brokerOffers(issuer, buyOffer0, sellOffer0));
3528 
3529  // Close enough ledgers to get past the expiration.
-
3530  while (lastClose(env) < expiration)
+
3530  while (lastClose(env) < expiration)
3531  env.close();
3532 
-
3533  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3534  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3535  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3533  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3534  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3535  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3536 
3537  // If the buy offer is expired it cannot be brokered.
3538  env(token::brokerOffers(issuer, buyOffer1, sellOffer1),
@@ -3611,16 +3611,16 @@ $(function() {
3540  env.close();
3541 
3542  // The expired buy offer is still in the ledger.
-
3543  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3544  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3545  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3543  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3544  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3545  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3546 
3547  // Anyone can cancel the expired buy offer.
3548  env(token::cancelOffer(minter, {buyOffer1, sellOffer1}));
3549  env.close();
-
3550  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3551  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3552  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3550  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3551  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3552  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3553 
3554  // Transfer nftokenID0 back to minter so we start the next test in
3555  // a simple place.
@@ -3632,9 +3632,9 @@ $(function() {
3561  env.close();
3562  env(token::acceptSellOffer(minter, offerSellBack));
3563  env.close();
-
3564  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3565  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3566  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3564  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3565  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3566  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3567  }
3568  // Show that in brokered mode:
3569  // 1. An unexpired buy/sell offer pair with an expiration can be
@@ -3642,7 +3642,7 @@ $(function() {
3571  // 2. An expired buy/sell offer pair cannot be accepted and they
3572  // remain in ledger after the accept fails.
3573  {
-
3574  std::uint32_t const expiration = lastClose(env) + 25;
+
3574  std::uint32_t const expiration = lastClose(env) + 25;
3575 
3576  uint256 const sellOffer0 =
3577  keylet::nftoffer(minter, env.seq(minter)).key;
@@ -3669,21 +3669,21 @@ $(function() {
3598  token::owner(minter));
3599 
3600  env.close();
-
3601  BEAST_EXPECT(lastClose(env) < expiration);
-
3602  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3603  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
3604  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3601  BEAST_EXPECT(lastClose(env) < expiration);
+
3602  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3603  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
3604  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3605 
3606  // Unexpired offers can be brokered.
3607  env(token::brokerOffers(issuer, buyOffer0, sellOffer0));
3608 
3609  // Close enough ledgers to get past the expiration.
-
3610  while (lastClose(env) < expiration)
+
3610  while (lastClose(env) < expiration)
3611  env.close();
3612 
-
3613  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3614  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3615  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3613  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3614  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3615  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3616 
3617  // If the offers are expired they cannot be brokered.
3618  env(token::brokerOffers(issuer, buyOffer1, sellOffer1),
@@ -3691,16 +3691,16 @@ $(function() {
3620  env.close();
3621 
3622  // The expired offers are still in the ledger.
-
3623  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3624  BEAST_EXPECT(ownerCount(env, minter) == 2);
-
3625  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
3623  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3624  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3625  BEAST_EXPECT(ownerCount(env, buyer) == 2);
3626 
3627  // Anyone can cancel the expired offers.
3628  env(token::cancelOffer(issuer, {buyOffer1, sellOffer1}));
3629  env.close();
-
3630  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3631  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3632  BEAST_EXPECT(ownerCount(env, buyer) == 1);
+
3630  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3631  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3632  BEAST_EXPECT(ownerCount(env, buyer) == 1);
3633 
3634  // Transfer nftokenID0 back to minter so we start the next test in
3635  // a simple place.
@@ -3712,14 +3712,14 @@ $(function() {
3641  env.close();
3642  env(token::acceptSellOffer(minter, offerSellBack));
3643  env.close();
-
3644  BEAST_EXPECT(ownerCount(env, issuer) == 0);
-
3645  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
3646  BEAST_EXPECT(ownerCount(env, buyer) == 0);
+
3644  BEAST_EXPECT(ownerCount(env, issuer) == 0);
+
3645  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3646  BEAST_EXPECT(ownerCount(env, buyer) == 0);
3647  }
3648  }
3649 
3650  void
-
3651  testCancelOffers(FeatureBitset features)
+
3651  testCancelOffers(FeatureBitset features)
3652  {
3653  // Look at offer canceling.
3654  testcase("Cancel offers");
@@ -3749,11 +3749,11 @@ $(function() {
3678 
3679  env(token::createOffer(alice, nftokenID, XRP(1000)),
3680  txflags(tfSellNFToken),
-
3681  token::expiration(lastClose(env) + 13));
+
3681  token::expiration(lastClose(env) + 13));
3682  env.close();
3683 
3684  // The offer has not expired yet, so becky can't cancel it now.
-
3685  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
3685  BEAST_EXPECT(ownerCount(env, alice) == 2);
3686  env(token::cancelOffer(becky, {expiredOfferIndex}),
3687  ter(tecNO_PERMISSION));
3688  env.close();
@@ -3764,7 +3764,7 @@ $(function() {
3693  env.close();
3694  env(token::cancelOffer(becky, {expiredOfferIndex}));
3695  env.close();
-
3696  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
3696  BEAST_EXPECT(ownerCount(env, alice) == 1);
3697 
3698  // Create a couple of offers with a destination. Those offers
3699  // should be cancellable by the creator and the destination.
@@ -3775,17 +3775,17 @@ $(function() {
3704  token::destination(becky),
3705  txflags(tfSellNFToken));
3706  env.close();
-
3707  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
3707  BEAST_EXPECT(ownerCount(env, alice) == 2);
3708 
3709  // Minter can't cancel that offer, but becky (the destination) can.
3710  env(token::cancelOffer(minter, {dest1OfferIndex}),
3711  ter(tecNO_PERMISSION));
3712  env.close();
-
3713  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
3713  BEAST_EXPECT(ownerCount(env, alice) == 2);
3714 
3715  env(token::cancelOffer(becky, {dest1OfferIndex}));
3716  env.close();
-
3717  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
3717  BEAST_EXPECT(ownerCount(env, alice) == 1);
3718 
3719  // alice can cancel her own offer, even if becky is the destination.
3720  uint256 const dest2OfferIndex =
@@ -3795,11 +3795,11 @@ $(function() {
3724  token::destination(becky),
3725  txflags(tfSellNFToken));
3726  env.close();
-
3727  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
3727  BEAST_EXPECT(ownerCount(env, alice) == 2);
3728 
3729  env(token::cancelOffer(alice, {dest2OfferIndex}));
3730  env.close();
-
3731  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
3731  BEAST_EXPECT(ownerCount(env, alice) == 1);
3732 
3733  // The issuer has no special permissions regarding offer cancellation.
3734  // Minter creates a token with alice as issuer. alice cannot cancel
@@ -3817,7 +3817,7 @@ $(function() {
3746  env(token::createOffer(minter, mintersNFTokenID, XRP(1000)),
3747  txflags(tfSellNFToken));
3748  env.close();
-
3749  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3749  BEAST_EXPECT(ownerCount(env, minter) == 2);
3750 
3751  // Nobody other than minter should be able to cancel minter's offer.
3752  env(token::cancelOffer(alice, {minterOfferIndex}),
@@ -3825,15 +3825,15 @@ $(function() {
3754  env(token::cancelOffer(becky, {minterOfferIndex}),
3755  ter(tecNO_PERMISSION));
3756  env.close();
-
3757  BEAST_EXPECT(ownerCount(env, minter) == 2);
+
3757  BEAST_EXPECT(ownerCount(env, minter) == 2);
3758 
3759  env(token::cancelOffer(minter, {minterOfferIndex}));
3760  env.close();
-
3761  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
3761  BEAST_EXPECT(ownerCount(env, minter) == 1);
3762  }
3763 
3764  void
-
3765  testCancelTooManyOffers(FeatureBitset features)
+
3765  testCancelTooManyOffers(FeatureBitset features)
3766  {
3767  // Look at the case where too many offers are passed in a cancel.
3768  testcase("Cancel too many offers");
@@ -3881,7 +3881,7 @@ $(function() {
3810  keylet::nftoffer(offerAcct, env.seq(offerAcct)).key);
3811  env(token::createOffer(offerAcct, nftokenID, drops(1)),
3812  token::owner(nftAcct),
-
3813  token::expiration(lastClose(env) + 5));
+
3813  token::expiration(lastClose(env) + 5));
3814  env.close();
3815  }
3816 
@@ -3922,7 +3922,7 @@ $(function() {
3851  env.close();
3852 
3853  // alice's owner count should now to 2 for the nft and the offer.
-
3854  BEAST_EXPECT(ownerCount(env, alice) == 2);
+
3854  BEAST_EXPECT(ownerCount(env, alice) == 2);
3855 
3856  // Because alice added the sell offer there are still too many
3857  // offers in the list to cancel.
@@ -3935,7 +3935,7 @@ $(function() {
3864 
3865  // If alice's owner count is zero we can see that the offer
3866  // and nft are both gone.
-
3867  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
3867  BEAST_EXPECT(ownerCount(env, alice) == 0);
3868  offerIndexes.pop_back();
3869  }
3870 
@@ -3952,7 +3952,7 @@ $(function() {
3881  }
3882 
3883  void
-
3884  testBrokeredAccept(FeatureBitset features)
+
3884  testBrokeredAccept(FeatureBitset features)
3885  {
3886  // Look at the case where too many offers are passed in a cancel.
3887  testcase("Brokered NFT offer accept");
@@ -3998,14 +3998,14 @@ $(function() {
3927  int line) {
3928  for (Account const& acct : accounts)
3929  {
-
3930  if (std::uint32_t ownerCount =
-
3931  this->ownerCount(env, acct);
-
3932  ownerCount != 1)
+
3930  if (std::uint32_t ownerCount =
+
3931  this->ownerCount(env, acct);
+
3932  ownerCount != 1)
3933  {
3934  std::stringstream ss;
3935  ss << "Account " << acct.human()
3936  << " expected ownerCount == 1. Got "
-
3937  << ownerCount;
+
3937  << ownerCount;
3938  fail(ss.str(), __FILE__, line);
3939  }
3940  }
@@ -4332,10 +4332,10 @@ $(function() {
4261  broker, buyOfferIndex, minterOfferIndex));
4262  env.close();
4263 
-
4264  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
4265  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
4266  BEAST_EXPECT(ownerCount(env, buyer) == 2);
-
4267  BEAST_EXPECT(ownerCount(env, broker) == 1);
+
4264  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
4265  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
4266  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
4267  BEAST_EXPECT(ownerCount(env, broker) == 1);
4268  BEAST_EXPECT(env.balance(issuer, gwXAU) == gwXAU(1000));
4269  BEAST_EXPECT(env.balance(minter, gwXAU) == gwXAU(2000));
4270  BEAST_EXPECT(env.balance(buyer, gwXAU) == gwXAU(0));
@@ -4422,10 +4422,10 @@ $(function() {
4351  token::brokerFee(gwXAU(100)));
4352  env.close();
4353 
-
4354  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
4355  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
4356  BEAST_EXPECT(ownerCount(env, buyer) == 2);
-
4357  BEAST_EXPECT(ownerCount(env, broker) == 1);
+
4354  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
4355  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
4356  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
4357  BEAST_EXPECT(ownerCount(env, broker) == 1);
4358  BEAST_EXPECT(env.balance(issuer, gwXAU) == gwXAU(1450));
4359  BEAST_EXPECT(env.balance(minter, gwXAU) == gwXAU(1450));
4360  BEAST_EXPECT(env.balance(buyer, gwXAU) == gwXAU(0));
@@ -4466,10 +4466,10 @@ $(function() {
4395  token::brokerFee(gwXAU(50)));
4396  env.close();
4397 
-
4398  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
4399  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
4400  BEAST_EXPECT(ownerCount(env, buyer) == 2);
-
4401  BEAST_EXPECT(ownerCount(env, broker) == 1);
+
4398  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
4399  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
4400  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
4401  BEAST_EXPECT(ownerCount(env, broker) == 1);
4402  BEAST_EXPECT(env.balance(issuer, gwXAU) == gwXAU(1237.5));
4403  BEAST_EXPECT(env.balance(minter, gwXAU) == gwXAU(1712.5));
4404  BEAST_EXPECT(env.balance(buyer, gwXAU) == gwXAU(0));
@@ -4506,10 +4506,10 @@ $(function() {
4435  broker, buyOfferIndex, minterOfferIndex),
4436  token::brokerFee(gwXAU(50)));
4437  env.close();
-
4438  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
4439  BEAST_EXPECT(ownerCount(env, minter) == 1);
-
4440  BEAST_EXPECT(ownerCount(env, buyer) == 2);
-
4441  BEAST_EXPECT(ownerCount(env, broker) == 1);
+
4438  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
4439  BEAST_EXPECT(ownerCount(env, minter) == 1);
+
4440  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
4441  BEAST_EXPECT(ownerCount(env, broker) == 1);
4442  BEAST_EXPECT(env.balance(issuer, gwXAU) == gwXAU(1237.5));
4443  BEAST_EXPECT(env.balance(minter, gwXAU) == gwXAU(1712.5));
4444  BEAST_EXPECT(env.balance(buyer, gwXAU) == gwXAU(0));
@@ -4526,10 +4526,10 @@ $(function() {
4455  token::brokerFee(gwXAU(50)),
4456  ter(tecINSUFFICIENT_FUNDS));
4457  env.close();
-
4458  BEAST_EXPECT(ownerCount(env, issuer) == 1);
-
4459  BEAST_EXPECT(ownerCount(env, minter) == 3);
-
4460  BEAST_EXPECT(ownerCount(env, buyer) == 2);
-
4461  BEAST_EXPECT(ownerCount(env, broker) == 1);
+
4458  BEAST_EXPECT(ownerCount(env, issuer) == 1);
+
4459  BEAST_EXPECT(ownerCount(env, minter) == 3);
+
4460  BEAST_EXPECT(ownerCount(env, buyer) == 2);
+
4461  BEAST_EXPECT(ownerCount(env, broker) == 1);
4462  BEAST_EXPECT(env.balance(issuer, gwXAU) == gwXAU(1000));
4463  BEAST_EXPECT(env.balance(minter, gwXAU) == gwXAU(1000));
4464  BEAST_EXPECT(env.balance(buyer, gwXAU) == gwXAU(1000));
@@ -4544,7 +4544,7 @@ $(function() {
4473  }
4474 
4475  void
-
4476  testNFTokenOfferOwner(FeatureBitset features)
+
4476  testNFTokenOfferOwner(FeatureBitset features)
4477  {
4478  // Verify the Owner field of an offer behaves as expected.
4479  testcase("NFToken offer owner");
@@ -4565,9 +4565,9 @@ $(function() {
4494  env.close();
4495 
4496  // Prove that issuer now owns nftId.
-
4497  BEAST_EXPECT(nftCount(env, issuer) == 1);
-
4498  BEAST_EXPECT(nftCount(env, buyer1) == 0);
-
4499  BEAST_EXPECT(nftCount(env, buyer2) == 0);
+
4497  BEAST_EXPECT(nftCount(env, issuer) == 1);
+
4498  BEAST_EXPECT(nftCount(env, buyer1) == 0);
+
4499  BEAST_EXPECT(nftCount(env, buyer2) == 0);
4500 
4501  // Both buyer1 and buyer2 create buy offers for nftId.
4502  uint256 const buyer1OfferIndex =
@@ -4602,9 +4602,9 @@ $(function() {
4531  env.close();
4532 
4533  // Prove that buyer1 now owns nftId.
-
4534  BEAST_EXPECT(nftCount(env, issuer) == 0);
-
4535  BEAST_EXPECT(nftCount(env, buyer1) == 1);
-
4536  BEAST_EXPECT(nftCount(env, buyer2) == 0);
+
4534  BEAST_EXPECT(nftCount(env, issuer) == 0);
+
4535  BEAST_EXPECT(nftCount(env, buyer1) == 1);
+
4536  BEAST_EXPECT(nftCount(env, buyer2) == 0);
4537 
4538  // buyer1's offer was consumed, but buyer2's offer is still in the
4539  // ledger.
@@ -4616,16 +4616,16 @@ $(function() {
4545  env.close();
4546 
4547  // Prove that buyer2 now owns nftId.
-
4548  BEAST_EXPECT(nftCount(env, issuer) == 0);
-
4549  BEAST_EXPECT(nftCount(env, buyer1) == 0);
-
4550  BEAST_EXPECT(nftCount(env, buyer2) == 1);
+
4548  BEAST_EXPECT(nftCount(env, issuer) == 0);
+
4549  BEAST_EXPECT(nftCount(env, buyer1) == 0);
+
4550  BEAST_EXPECT(nftCount(env, buyer2) == 1);
4551 
4552  // All of the NFTokenOffers are now consumed.
4553  BEAST_EXPECT(nftBuyOfferCount(nftId) == 0);
4554  }
4555 
4556  void
-
4557  testNFTokenWithTickets(FeatureBitset features)
+
4557  testNFTokenWithTickets(FeatureBitset features)
4558  {
4559  // Make sure all NFToken transactions work with tickets.
4560  testcase("NFToken transactions with tickets");
@@ -4646,40 +4646,40 @@ $(function() {
4575  env(ticket::create(issuer, 10));
4576  env.close();
4577  std::uint32_t const issuerSeq{env.seq(issuer)};
-
4578  BEAST_EXPECT(ticketCount(env, issuer) == 10);
+
4578  BEAST_EXPECT(ticketCount(env, issuer) == 10);
4579 
4580  std::uint32_t buyerTicketSeq{env.seq(buyer) + 1};
4581  env(ticket::create(buyer, 10));
4582  env.close();
4583  std::uint32_t const buyerSeq{env.seq(buyer)};
-
4584  BEAST_EXPECT(ticketCount(env, buyer) == 10);
+
4584  BEAST_EXPECT(ticketCount(env, buyer) == 10);
4585 
4586  // NFTokenMint
-
4587  BEAST_EXPECT(ownerCount(env, issuer) == 10);
+
4587  BEAST_EXPECT(ownerCount(env, issuer) == 10);
4588  uint256 const nftId{token::getNextID(env, issuer, 0u, tfTransferable)};
4589  env(token::mint(issuer, 0u),
4590  txflags(tfTransferable),
4591  ticket::use(issuerTicketSeq++));
4592  env.close();
-
4593  BEAST_EXPECT(ownerCount(env, issuer) == 10);
-
4594  BEAST_EXPECT(ticketCount(env, issuer) == 9);
+
4593  BEAST_EXPECT(ownerCount(env, issuer) == 10);
+
4594  BEAST_EXPECT(ticketCount(env, issuer) == 9);
4595 
4596  // NFTokenCreateOffer
-
4597  BEAST_EXPECT(ownerCount(env, buyer) == 10);
+
4597  BEAST_EXPECT(ownerCount(env, buyer) == 10);
4598  uint256 const offerIndex0 = keylet::nftoffer(buyer, buyerTicketSeq).key;
4599  env(token::createOffer(buyer, nftId, XRP(1)),
4600  token::owner(issuer),
4601  ticket::use(buyerTicketSeq++));
4602  env.close();
-
4603  BEAST_EXPECT(ownerCount(env, buyer) == 10);
-
4604  BEAST_EXPECT(ticketCount(env, buyer) == 9);
+
4603  BEAST_EXPECT(ownerCount(env, buyer) == 10);
+
4604  BEAST_EXPECT(ticketCount(env, buyer) == 9);
4605 
4606  // NFTokenCancelOffer
4607  env(token::cancelOffer(buyer, {offerIndex0}),
4608  ticket::use(buyerTicketSeq++));
4609  env.close();
-
4610  BEAST_EXPECT(ownerCount(env, buyer) == 8);
-
4611  BEAST_EXPECT(ticketCount(env, buyer) == 8);
+
4610  BEAST_EXPECT(ownerCount(env, buyer) == 8);
+
4611  BEAST_EXPECT(ticketCount(env, buyer) == 8);
4612 
4613  // NFTokenCreateOffer. buyer tries again.
4614  uint256 const offerIndex1 = keylet::nftoffer(buyer, buyerTicketSeq).key;
@@ -4687,23 +4687,23 @@ $(function() {
4616  token::owner(issuer),
4617  ticket::use(buyerTicketSeq++));
4618  env.close();
-
4619  BEAST_EXPECT(ownerCount(env, buyer) == 8);
-
4620  BEAST_EXPECT(ticketCount(env, buyer) == 7);
+
4619  BEAST_EXPECT(ownerCount(env, buyer) == 8);
+
4620  BEAST_EXPECT(ticketCount(env, buyer) == 7);
4621 
4622  // NFTokenAcceptOffer. issuer accepts buyer's offer.
4623  env(token::acceptBuyOffer(issuer, offerIndex1),
4624  ticket::use(issuerTicketSeq++));
4625  env.close();
-
4626  BEAST_EXPECT(ownerCount(env, issuer) == 8);
-
4627  BEAST_EXPECT(ownerCount(env, buyer) == 8);
-
4628  BEAST_EXPECT(ticketCount(env, issuer) == 8);
+
4626  BEAST_EXPECT(ownerCount(env, issuer) == 8);
+
4627  BEAST_EXPECT(ownerCount(env, buyer) == 8);
+
4628  BEAST_EXPECT(ticketCount(env, issuer) == 8);
4629 
4630  // NFTokenBurn. buyer burns the token they just bought.
4631  env(token::burn(buyer, nftId), ticket::use(buyerTicketSeq++));
4632  env.close();
-
4633  BEAST_EXPECT(ownerCount(env, issuer) == 8);
-
4634  BEAST_EXPECT(ownerCount(env, buyer) == 6);
-
4635  BEAST_EXPECT(ticketCount(env, buyer) == 6);
+
4633  BEAST_EXPECT(ownerCount(env, issuer) == 8);
+
4634  BEAST_EXPECT(ownerCount(env, buyer) == 6);
+
4635  BEAST_EXPECT(ticketCount(env, buyer) == 6);
4636 
4637  // Verify that the account sequence numbers did not advance.
4638  BEAST_EXPECT(env.seq(issuer) == issuerSeq);
@@ -4711,7 +4711,7 @@ $(function() {
4640  }
4641 
4642  void
-
4643  testNFTokenDeleteAccount(FeatureBitset features)
+
4643  testNFTokenDeleteAccount(FeatureBitset features)
4644  {
4645  // Account deletion rules with NFTs:
4646  // 1. An account holding one or more NFT offers may be deleted.
@@ -4804,7 +4804,7 @@ $(function() {
4733  }
4734 
4735  void
-
4736  testNftXxxOffers(FeatureBitset features)
+
4736  testNftXxxOffers(FeatureBitset features)
4737  {
4738  testcase("nft_buy_offers and nft_sell_offers");
4739 
@@ -5033,7 +5033,7 @@ $(function() {
4962  }
4963 
4964  void
-
4965  testFixNFTokenNegOffer(FeatureBitset features)
+
4965  testFixNFTokenNegOffer(FeatureBitset features)
4966  {
4967  // Exercise changes introduced by fixNFTokenNegOffer.
4968  using namespace test::jtx;
@@ -5277,7 +5277,7 @@ $(function() {
5206  }
5207 
5208  void
-
5209  testIOUWithTransferFee(FeatureBitset features)
+
5209  testIOUWithTransferFee(FeatureBitset features)
5210  {
5211  using namespace test::jtx;
5212 
@@ -6029,7 +6029,7 @@ $(function() {
5958  }
5959 
5960  void
-
5961  testBrokeredSaleToSelf(FeatureBitset features)
+
5961  testBrokeredSaleToSelf(FeatureBitset features)
5962  {
5963  // There was a bug that if an account had...
5964  //
@@ -6104,7 +6104,7 @@ $(function() {
6033 
6034  // bob now has a buy offer and a sell offer on the books. A broker
6035  // spots this and swoops in to make a profit.
-
6036  BEAST_EXPECT(nftCount(env, bob) == 1);
+
6036  BEAST_EXPECT(nftCount(env, bob) == 1);
6037  auto const bobsPriorBalance = env.balance(bob);
6038  auto const brokersPriorBalance = env.balance(broker);
6039  TER expectTer = features[fixNonFungibleTokensV1_2]
@@ -6120,7 +6120,7 @@ $(function() {
6049  // bob should still have the NFT from alice, but be XRP(1) poorer.
6050  // broker should be almost XRP(1) richer because they also paid a
6051  // transaction fee.
-
6052  BEAST_EXPECT(nftCount(env, bob) == 1);
+
6052  BEAST_EXPECT(nftCount(env, bob) == 1);
6053  BEAST_EXPECT(env.balance(bob) == bobsPriorBalance - XRP(1));
6054  BEAST_EXPECT(
6055  env.balance(broker) ==
@@ -6130,7 +6130,7 @@ $(function() {
6059  {
6060  // A tec result was returned, so no state should change other
6061  // than the broker burning their transaction fee.
-
6062  BEAST_EXPECT(nftCount(env, bob) == 1);
+
6062  BEAST_EXPECT(nftCount(env, bob) == 1);
6063  BEAST_EXPECT(env.balance(bob) == bobsPriorBalance);
6064  BEAST_EXPECT(
6065  env.balance(broker) == brokersPriorBalance - drops(10));
@@ -6138,7 +6138,7 @@ $(function() {
6067  }
6068 
6069  void
-
6070  testFixNFTokenRemint(FeatureBitset features)
+
6070  testFixNFTokenRemint(FeatureBitset features)
6071  {
6072  using namespace test::jtx;
6073 
@@ -6393,8 +6393,8 @@ $(function() {
6322  env(ticket::create(alice, 100));
6323  env.close();
6324 
-
6325  BEAST_EXPECT(ticketCount(env, alice) == 100);
-
6326  BEAST_EXPECT(ownerCount(env, alice) == 100);
+
6325  BEAST_EXPECT(ticketCount(env, alice) == 100);
+
6326  BEAST_EXPECT(ownerCount(env, alice) == 100);
6327 
6328  // alice mints 50 NFTs using tickets
6329  std::vector<uint256> nftIDs;
@@ -6414,7 +6414,7 @@ $(function() {
6343  }
6344  env.close();
6345 
-
6346  BEAST_EXPECT(ticketCount(env, alice) == 0);
+
6346  BEAST_EXPECT(ticketCount(env, alice) == 0);
6347 
6348  // Increment ledger sequence to the number that is
6349  // enforced by the featureDeletableAccounts amendment
@@ -6547,8 +6547,8 @@ $(function() {
6476  env(ticket::create(minter, 100));
6477  env.close();
6478 
-
6479  BEAST_EXPECT(ticketCount(env, minter) == 100);
-
6480  BEAST_EXPECT(ownerCount(env, minter) == 100);
+
6479  BEAST_EXPECT(ticketCount(env, minter) == 100);
+
6480  BEAST_EXPECT(ownerCount(env, minter) == 100);
6481 
6482  // minter mints 50 NFTs for alice using tickets
6483  std::vector<uint256> nftIDs;
@@ -6571,7 +6571,7 @@ $(function() {
6500  }
6501  env.close();
6502 
-
6503  BEAST_EXPECT(ticketCount(env, minter) == 0);
+
6503  BEAST_EXPECT(ticketCount(env, minter) == 0);
6504 
6505  // Increment ledger sequence to the number that is
6506  // enforced by the featureDeletableAccounts amendment
@@ -6638,7 +6638,7 @@ $(function() {
6567  }
6568 
6569  void
-
6570  testTxJsonMetaFields(FeatureBitset features)
+
6570  testTxJsonMetaFields(FeatureBitset features)
6571  {
6572  // `nftoken_id` is added in the `tx` response for NFTokenMint and
6573  // NFTokenAcceptOffer.
@@ -6870,43 +6870,43 @@ $(function() {
6799  }
6800 
6801  void
-
6802  testWithFeats(FeatureBitset features)
+
6802  testWithFeats(FeatureBitset features)
6803  {
-
6804  testEnabled(features);
-
6805  testMintReserve(features);
-
6806  testMintMaxTokens(features);
-
6807  testMintInvalid(features);
-
6808  testBurnInvalid(features);
-
6809  testCreateOfferInvalid(features);
-
6810  testCancelOfferInvalid(features);
-
6811  testAcceptOfferInvalid(features);
-
6812  testMintFlagBurnable(features);
-
6813  testMintFlagOnlyXRP(features);
-
6814  testMintFlagCreateTrustLine(features);
-
6815  testMintFlagTransferable(features);
-
6816  testMintTransferFee(features);
-
6817  testMintTaxon(features);
-
6818  testMintURI(features);
-
6819  testCreateOfferDestination(features);
-
6820  testCreateOfferDestinationDisallowIncoming(features);
-
6821  testCreateOfferExpiration(features);
-
6822  testCancelOffers(features);
-
6823  testCancelTooManyOffers(features);
-
6824  testBrokeredAccept(features);
-
6825  testNFTokenOfferOwner(features);
-
6826  testNFTokenWithTickets(features);
-
6827  testNFTokenDeleteAccount(features);
-
6828  testNftXxxOffers(features);
-
6829  testFixNFTokenNegOffer(features);
-
6830  testIOUWithTransferFee(features);
-
6831  testBrokeredSaleToSelf(features);
-
6832  testFixNFTokenRemint(features);
-
6833  testTxJsonMetaFields(features);
+
6804  testEnabled(features);
+
6805  testMintReserve(features);
+
6806  testMintMaxTokens(features);
+
6807  testMintInvalid(features);
+
6808  testBurnInvalid(features);
+
6809  testCreateOfferInvalid(features);
+
6810  testCancelOfferInvalid(features);
+
6811  testAcceptOfferInvalid(features);
+
6812  testMintFlagBurnable(features);
+
6813  testMintFlagOnlyXRP(features);
+
6814  testMintFlagCreateTrustLine(features);
+
6815  testMintFlagTransferable(features);
+
6816  testMintTransferFee(features);
+
6817  testMintTaxon(features);
+
6818  testMintURI(features);
+
6819  testCreateOfferDestination(features);
+
6820  testCreateOfferDestinationDisallowIncoming(features);
+
6821  testCreateOfferExpiration(features);
+
6822  testCancelOffers(features);
+
6823  testCancelTooManyOffers(features);
+
6824  testBrokeredAccept(features);
+
6825  testNFTokenOfferOwner(features);
+
6826  testNFTokenWithTickets(features);
+
6827  testNFTokenDeleteAccount(features);
+
6828  testNftXxxOffers(features);
+
6829  testFixNFTokenNegOffer(features);
+
6830  testIOUWithTransferFee(features);
+
6831  testBrokeredSaleToSelf(features);
+
6832  testFixNFTokenRemint(features);
+
6833  testTxJsonMetaFields(features);
6834  }
6835 
6836 public:
6837  void
-
6838  run(std::uint32_t instance, bool last = false)
+
6838  run(std::uint32_t instance, bool last = false)
6839  {
6840  using namespace test::jtx;
6841  static FeatureBitset const all{supported_amendments()};
@@ -6914,7 +6914,7 @@ $(function() {
6843 
6844  static std::array<FeatureBitset, 5> const feats{
6845  all - fixNFTDir - fixNonFungibleTokensV1_2 - fixNFTokenRemint,
-
6846  all - disallowIncoming - fixNonFungibleTokensV1_2 -
+
6846  all - disallowIncoming - fixNonFungibleTokensV1_2 -
6847  fixNFTokenRemint,
6848  all - fixNonFungibleTokensV1_2 - fixNFTokenRemint,
6849  all - fixNFTokenRemint,
@@ -6922,65 +6922,65 @@ $(function() {
6851 
6852  if (BEAST_EXPECT(instance < feats.size()))
6853  {
-
6854  testWithFeats(feats[instance]);
+
6854  testWithFeats(feats[instance]);
6855  }
6856  BEAST_EXPECT(!last || instance == feats.size() - 1);
6857  }
6858 
6859  void
-
6860  run() override
+
6860  run() override
6861  {
-
6862  run(0);
+
6862  run(0);
6863  }
6864 };
6865 
-
6866 class NFToken1_test : public NFToken0_test
+
6866 class NFTokenDisallowIncoming_test : public NFTokenBaseUtil_test
6867 {
6868  void
-
6869  run() override
+
6869  run() override
6870  {
-
6871  NFToken0_test::run(1);
+
6871  NFTokenBaseUtil_test::run(1);
6872  }
6873 };
6874 
-
6875 class NFToken2_test : public NFToken0_test
+
6875 class NFTokenWOfixV1_test : public NFTokenBaseUtil_test
6876 {
6877  void
-
6878  run() override
+
6878  run() override
6879  {
-
6880  NFToken0_test::run(2);
+
6880  NFTokenBaseUtil_test::run(2);
6881  }
6882 };
6883 
-
6884 class NFToken3_test : public NFToken0_test
+
6884 class NFTokenWOTokenRemint_test : public NFTokenBaseUtil_test
6885 {
6886  void
-
6887  run() override
+
6887  run() override
6888  {
-
6889  NFToken0_test::run(3);
+
6889  NFTokenBaseUtil_test::run(3);
6890  }
6891 };
6892 
-
6893 class NFToken4_test : public NFToken0_test
+
6893 class NFTokenAllFeatures_test : public NFTokenBaseUtil_test
6894 {
6895  void
-
6896  run() override
+
6896  run() override
6897  {
-
6898  NFToken0_test::run(4, true);
+
6898  NFTokenBaseUtil_test::run(4, true);
6899  }
6900 };
6901 
-
6902 BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2);
-
6903 BEAST_DEFINE_TESTSUITE_PRIO(NFToken1, tx, ripple, 2);
-
6904 BEAST_DEFINE_TESTSUITE_PRIO(NFToken2, tx, ripple, 2);
-
6905 BEAST_DEFINE_TESTSUITE_PRIO(NFToken3, tx, ripple, 2);
-
6906 BEAST_DEFINE_TESTSUITE_PRIO(NFToken4, tx, ripple, 2);
+
6902 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2);
+
6903 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenDisallowIncoming, tx, ripple, 2);
+
6904 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOfixV1, tx, ripple, 2);
+
6905 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenWOTokenRemint, tx, ripple, 2);
+
6906 BEAST_DEFINE_TESTSUITE_PRIO(NFTokenAllFeatures, tx, ripple, 2);
6907 
6908 } // namespace ripple
-
ripple::NFToken0_test::testMintTransferFee
void testMintTransferFee(FeatureBitset features)
Definition: NFToken_test.cpp:2092
ripple::tecUNFUNDED_OFFER
@ tecUNFUNDED_OFFER
Definition: TER.h:264
ripple::maxTransferFee
constexpr std::uint16_t maxTransferFee
The maximum token transfer fee allowed.
Definition: Protocol.h:81
+
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFTokenBaseUtil, tx, ripple, 2)
ripple::sfOwnerCount
const SF_UINT32 sfOwnerCount
ripple::fixRemoveNFTokenAutoTrustLine
const uint256 fixRemoveNFTokenAutoTrustLine
ripple::sfFirstNFTokenSequence
const SF_UINT32 sfFirstNFTokenSequence
@@ -6988,73 +6988,70 @@ $(function() {
ripple::tecFROZEN
@ tecFROZEN
Definition: TER.h:283
ripple::tfTransferable
constexpr const std::uint32_t tfTransferable
Definition: TxFlags.h:131
ripple::fixNFTokenNegOffer
const uint256 fixNFTokenNegOffer
+
ripple::NFTokenBaseUtil_test::testMintTransferFee
void testMintTransferFee(FeatureBitset features)
Definition: NFToken_test.cpp:2092
+
ripple::NFTokenBaseUtil_test::testMintFlagOnlyXRP
void testMintFlagOnlyXRP(FeatureBitset features)
Definition: NFToken_test.cpp:1516
ripple::Keylet
A pair of SHAMap key and LedgerEntryType.
Definition: Keylet.h:38
-
ripple::NFToken0_test::testBrokeredSaleToSelf
void testBrokeredSaleToSelf(FeatureBitset features)
Definition: NFToken_test.cpp:5961
+
ripple::NFTokenBaseUtil_test::testMintFlagTransferable
void testMintFlagTransferable(FeatureBitset features)
Definition: NFToken_test.cpp:1802
std::string
STL class.
ripple::temBAD_OFFER
@ temBAD_OFFER
Definition: TER.h:94
ripple::STAmount::cMinValue
static const std::uint64_t cMinValue
Definition: STAmount.h:67
-
ripple::NFToken0_test::testAcceptOfferInvalid
void testAcceptOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:1034
+
ripple::NFTokenBaseUtil_test::lastClose
std::uint32_t lastClose(test::jtx::Env &env)
Definition: NFToken_test.cpp:87
+
ripple::NFTokenBaseUtil_test::testMintFlagCreateTrustLine
void testMintFlagCreateTrustLine(FeatureBitset features)
Definition: NFToken_test.cpp:1610
+
ripple::NFTokenBaseUtil_test::testCreateOfferDestination
void testCreateOfferDestination(FeatureBitset features)
Definition: NFToken_test.cpp:2714
+
ripple::NFTokenBaseUtil_test::testFixNFTokenNegOffer
void testFixNFTokenNegOffer(FeatureBitset features)
Definition: NFToken_test.cpp:4965
ripple::test::jtx::Env::rpc
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:711
-
ripple::NFToken0_test::testTxJsonMetaFields
void testTxJsonMetaFields(FeatureBitset features)
Definition: NFToken_test.cpp:6570
-
ripple::NFToken0_test::testMintFlagTransferable
void testMintFlagTransferable(FeatureBitset features)
Definition: NFToken_test.cpp:1802
-
ripple::NFToken0_test::testMintFlagOnlyXRP
void testMintFlagOnlyXRP(FeatureBitset features)
Definition: NFToken_test.cpp:1516
+
ripple::NFTokenBaseUtil_test::testMintInvalid
void testMintInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:525
ripple::sfNFTokenOffers
const SF_VECTOR256 sfNFTokenOffers
-
ripple::NFToken0_test::disallowIncoming
const FeatureBitset disallowIncoming
Definition: NFToken_test.cpp:32
+
ripple::NFTokenBaseUtil_test::ticketCount
static std::uint32_t ticketCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:77
+
ripple::NFTokenAllFeatures_test
Definition: NFToken_test.cpp:6893
+
ripple::NFTokenBaseUtil_test::testBrokeredSaleToSelf
void testBrokeredSaleToSelf(FeatureBitset features)
Definition: NFToken_test.cpp:5961
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
ripple::tecINSUFFICIENT_FUNDS
@ tecINSUFFICIENT_FUNDS
Definition: TER.h:305
-
ripple::NFToken0_test::testCreateOfferDestinationDisallowIncoming
void testCreateOfferDestinationDisallowIncoming(FeatureBitset features)
Definition: NFToken_test.cpp:3048
std::string::reserve
T reserve(T... args)
-
ripple::NFToken4_test
Definition: NFToken_test.cpp:6893
ripple::TxSearched::all
@ all
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
-
ripple::NFToken0_test::testWithFeats
void testWithFeats(FeatureBitset features)
Definition: NFToken_test.cpp:6802
+
ripple::NFTokenBaseUtil_test::testEnabled
void testEnabled(FeatureBitset features)
Definition: NFToken_test.cpp:93
+
ripple::NFTokenBaseUtil_test::testMintMaxTokens
void testMintMaxTokens(FeatureBitset features)
Definition: NFToken_test.cpp:455
std::vector
STL class.
std::find
T find(T... args)
std::set::size
T size(T... args)
+
ripple::NFTokenBaseUtil_test::testBrokeredAccept
void testBrokeredAccept(FeatureBitset features)
Definition: NFToken_test.cpp:3884
ripple::STAmount::getJson
Json::Value getJson(JsonOptions) const override
Definition: STAmount.cpp:653
std::back_inserter
T back_inserter(T... args)
ripple::sfMintedNFTokens
const SF_UINT32 sfMintedNFTokens
-
ripple::NFToken0_test::testNFTokenWithTickets
void testNFTokenWithTickets(FeatureBitset features)
Definition: NFToken_test.cpp:4557
ripple::keylet::nftoffer
Keylet nftoffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
Definition: Indexes.cpp:364
-
ripple::NFToken0_test::lastClose
std::uint32_t lastClose(test::jtx::Env &env)
Definition: NFToken_test.cpp:87
ripple::test::jtx::Account::human
std::string const & human() const
Returns the human readable public key.
Definition: Account.h:113
std::stringstream
STL class.
-
ripple::NFToken0_test::run
void run() override
Definition: NFToken_test.cpp:6860
ripple::STAmount::cMinOffset
static const int cMinOffset
Definition: STAmount.h:63
-
ripple::NFToken1_test::run
void run() override
Definition: NFToken_test.cpp:6869
-
ripple::NFToken2_test::run
void run() override
Definition: NFToken_test.cpp:6878
-
ripple::NFToken0_test::testCancelOffers
void testCancelOffers(FeatureBitset features)
Definition: NFToken_test.cpp:3651
ripple::tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
@ tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
Definition: TER.h:304
ripple::nft::toTaxon
Taxon toTaxon(std::uint32_t i)
Definition: nft.h:42
-
ripple::NFToken0_test::testMintMaxTokens
void testMintMaxTokens(FeatureBitset features)
Definition: NFToken_test.cpp:455
-
ripple::NFToken0_test::testNFTokenDeleteAccount
void testNFTokenDeleteAccount(FeatureBitset features)
Definition: NFToken_test.cpp:4643
ripple::SField::jsonName
const Json::StaticString jsonName
Definition: SField.h:163
std::sort
T sort(T... args)
-
ripple::NFToken1_test
Definition: NFToken_test.cpp:6866
std::string::clear
T clear(T... args)
-
ripple::NFToken0_test::testEnabled
void testEnabled(FeatureBitset features)
Definition: NFToken_test.cpp:93
+
ripple::NFTokenAllFeatures_test::run
void run() override
Definition: NFToken_test.cpp:6896
+
ripple::NFTokenBaseUtil_test::nftCount
static std::uint32_t nftCount(test::jtx::Env &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:66
ripple::fixNFTokenRemint
const uint256 fixNFTokenRemint
-
ripple::NFToken0_test::testBurnInvalid
void testBurnInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:601
+
ripple::NFTokenBaseUtil_test::testNFTokenWithTickets
void testNFTokenWithTickets(FeatureBitset features)
Definition: NFToken_test.cpp:4557
std::string::push_back
T push_back(T... args)
ripple::Keylet::key
uint256 key
Definition: Keylet.h:40
ripple::base_uint< 256 >
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:110
-
ripple::NFToken0_test::testMintInvalid
void testMintInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:525
ripple::tecNFTOKEN_OFFER_TYPE_MISMATCH
@ tecNFTOKEN_OFFER_TYPE_MISMATCH
Definition: TER.h:303
+
ripple::NFTokenBaseUtil_test::testMintURI
void testMintURI(FeatureBitset features)
Definition: NFToken_test.cpp:2604
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
-
ripple::NFToken0_test::ownerCount
static std::uint32_t ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:36
+
ripple::NFTokenBaseUtil_test::testCancelOffers
void testCancelOffers(FeatureBitset features)
Definition: NFToken_test.cpp:3651
ripple::rand_int
std::enable_if_t< std::is_integral< Integral >::value &&detail::is_engine< Engine >::value, Integral > rand_int(Engine &engine, Integral min, Integral max)
Return a uniformly distributed random integer.
Definition: ripple/basics/random.h:115
ripple::tfBurnable
constexpr const std::uint32_t tfBurnable
Definition: TxFlags.h:128
-
ripple::NFToken0_test::testMintTaxon
void testMintTaxon(FeatureBitset features)
Definition: NFToken_test.cpp:2529
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:142
ripple::tefNFTOKEN_IS_NOT_TRANSFERABLE
@ tefNFTOKEN_IS_NOT_TRANSFERABLE
Definition: TER.h:180
ripple::featureDisallowIncoming
const uint256 featureDisallowIncoming
ripple::sfNFTokenMinter
const SF_ACCOUNT sfNFTokenMinter
+
ripple::NFTokenBaseUtil_test::testCreateOfferDestinationDisallowIncoming
void testCreateOfferDestinationDisallowIncoming(FeatureBitset features)
Definition: NFToken_test.cpp:3048
+
ripple::NFTokenBaseUtil_test::testWithFeats
void testWithFeats(FeatureBitset features)
Definition: NFToken_test.cpp:6802
+
ripple::NFTokenBaseUtil_test::testCreateOfferExpiration
void testCreateOfferExpiration(FeatureBitset features)
Definition: NFToken_test.cpp:3177
ripple::TERSubset< CanCvtToTER >
-
ripple::NFToken3_test
Definition: NFToken_test.cpp:6884
-
ripple::NFToken0_test::testMintReserve
void testMintReserve(FeatureBitset features)
Definition: NFToken_test.cpp:206
-
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken0, tx, ripple, 2)
-
ripple::NFToken0_test::mintedCount
static std::uint32_t mintedCount(test::jtx::Env const &env, test::jtx::Account const &issuer)
Definition: NFToken_test.cpp:46
+
ripple::NFTokenBaseUtil_test::testAcceptOfferInvalid
void testAcceptOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:1034
+
ripple::NFTokenBaseUtil_test::testCancelTooManyOffers
void testCancelTooManyOffers(FeatureBitset features)
Definition: NFToken_test.cpp:3765
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:607
std::to_string
T to_string(T... args)
ripple::rand_byte
std::enable_if_t<(std::is_same< Byte, unsigned char >::value||std::is_same< Byte, std::uint8_t >::value) &&detail::is_engine< Engine >::value, Byte > rand_byte(Engine &engine)
Return a random byte.
Definition: ripple/basics/random.h:173
@@ -7065,51 +7062,60 @@ $(function() {
Json::Value::size
UInt size() const
Number of values in array or object.
Definition: json_value.cpp:706
ripple::tecINTERNAL
@ tecINTERNAL
Definition: TER.h:290
ripple::tfSellNFToken
constexpr const std::uint32_t tfSellNFToken
Definition: TxFlags.h:153
-
ripple::NFToken0_test
Definition: NFToken_test.cpp:30
-
ripple::NFToken0_test::testIOUWithTransferFee
void testIOUWithTransferFee(FeatureBitset features)
Definition: NFToken_test.cpp:5209
+
ripple::NFTokenBaseUtil_test::testMintTaxon
void testMintTaxon(FeatureBitset features)
Definition: NFToken_test.cpp:2529
+
ripple::NFTokenBaseUtil_test::disallowIncoming
const FeatureBitset disallowIncoming
Definition: NFToken_test.cpp:32
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:88
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::maxTokenOfferCancelCount
constexpr std::size_t maxTokenOfferCancelCount
The maximum number of token offers that can be canceled at once.
Definition: Protocol.h:67
std::uint32_t
-
ripple::NFToken3_test::run
void run() override
Definition: NFToken_test.cpp:6887
-
ripple::NFToken0_test::testCancelTooManyOffers
void testCancelTooManyOffers(FeatureBitset features)
Definition: NFToken_test.cpp:3765
+
ripple::NFTokenDisallowIncoming_test
Definition: NFToken_test.cpp:6866
ripple::fixNFTokenDirV1
const uint256 fixNFTokenDirV1
ripple::temBAD_FEE
@ temBAD_FEE
Definition: TER.h:91
std::transform
T transform(T... args)
ripple::maxTokenURILength
constexpr std::size_t maxTokenURILength
The maximum length of a URI inside an NFT.
Definition: Protocol.h:84
-
ripple::NFToken0_test::testCreateOfferInvalid
void testCreateOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:662
+
ripple::NFTokenBaseUtil_test::run
void run() override
Definition: NFToken_test.cpp:6860
+
ripple::NFTokenBaseUtil_test::testBurnInvalid
void testBurnInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:601
+
ripple::NFTokenBaseUtil_test::testTxJsonMetaFields
void testTxJsonMetaFields(FeatureBitset features)
Definition: NFToken_test.cpp:6570
ripple::tecTOO_SOON
@ tecTOO_SOON
Definition: TER.h:298
+
ripple::NFTokenBaseUtil_test::run
void run(std::uint32_t instance, bool last=false)
Definition: NFToken_test.cpp:6838
ripple::sfURI
const SF_VL sfURI
std::vector::emplace_back
T emplace_back(T... args)
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::NFToken0_test::testMintURI
void testMintURI(FeatureBitset features)
Definition: NFToken_test.cpp:2604
+
ripple::NFTokenBaseUtil_test::testCreateOfferInvalid
void testCreateOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:662
ripple::featureNonFungibleTokensV1
const uint256 featureNonFungibleTokensV1
ripple::JsonOptions::none
@ none
Definition: STBase.h:42
+
ripple::NFTokenBaseUtil_test
Definition: NFToken_test.cpp:30
Json::Value::removeMember
Value removeMember(const char *key)
Remove and return the named member.
Definition: json_value.cpp:907
ripple::tecNFTOKEN_BUY_SELL_MISMATCH
@ tecNFTOKEN_BUY_SELL_MISMATCH
Definition: TER.h:302
ripple::tecINSUFFICIENT_PAYMENT
@ tecINSUFFICIENT_PAYMENT
Definition: TER.h:307
+
ripple::NFTokenBaseUtil_test::burnedCount
static std::uint32_t burnedCount(test::jtx::Env const &env, test::jtx::Account const &issuer)
Definition: NFToken_test.cpp:56
ripple::tfSetFreeze
constexpr std::uint32_t tfSetFreeze
Definition: TxFlags.h:112
ripple::tecNO_LINE
@ tecNO_LINE
Definition: TER.h:281
ripple::tecEXPIRED
@ tecEXPIRED
Definition: TER.h:294
ripple::lsfDisallowIncomingNFTokenOffer
@ lsfDisallowIncomingNFTokenOffer
Definition: LedgerFormats.h:269
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:113
+
ripple::NFTokenBaseUtil_test::testIOUWithTransferFee
void testIOUWithTransferFee(FeatureBitset features)
Definition: NFToken_test.cpp:5209
std::vector::begin
T begin(T... args)
-
ripple::NFToken0_test::testMintFlagCreateTrustLine
void testMintFlagCreateTrustLine(FeatureBitset features)
Definition: NFToken_test.cpp:1610
+
ripple::NFTokenWOTokenRemint_test::run
void run() override
Definition: NFToken_test.cpp:6887
std::set::insert
T insert(T... args)
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:216
ripple::tecNO_ISSUER
@ tecNO_ISSUER
Definition: TER.h:279
-
ripple::NFToken0_test::testCreateOfferExpiration
void testCreateOfferExpiration(FeatureBitset features)
Definition: NFToken_test.cpp:3177
+
ripple::NFTokenBaseUtil_test::testMintFlagBurnable
void testMintFlagBurnable(FeatureBitset features)
Definition: NFToken_test.cpp:1398
ripple::featureNonFungibleTokensV1_1
const uint256 featureNonFungibleTokensV1_1
-
ripple::NFToken0_test::testNftXxxOffers
void testNftXxxOffers(FeatureBitset features)
Definition: NFToken_test.cpp:4736
ripple::fixUniversalNumber
const uint256 fixUniversalNumber
ripple::tecHAS_OBLIGATIONS
@ tecHAS_OBLIGATIONS
Definition: TER.h:297
ripple::tecNO_PERMISSION
@ tecNO_PERMISSION
Definition: TER.h:285
-
ripple::NFToken0_test::ticketCount
static std::uint32_t ticketCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:77
-
ripple::NFToken0_test::testBrokeredAccept
void testBrokeredAccept(FeatureBitset features)
Definition: NFToken_test.cpp:3884
+
ripple::NFTokenWOfixV1_test
Definition: NFToken_test.cpp:6875
+
ripple::NFTokenBaseUtil_test::testMintReserve
void testMintReserve(FeatureBitset features)
Definition: NFToken_test.cpp:206
+
ripple::NFTokenBaseUtil_test::testNFTokenOfferOwner
void testNFTokenOfferOwner(FeatureBitset features)
Definition: NFToken_test.cpp:4476
ripple::FeatureBitset
Definition: Feature.h:113
+
ripple::NFTokenWOTokenRemint_test
Definition: NFToken_test.cpp:6884
ripple::tecINSUFFICIENT_RESERVE
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:287
std::string::empty
T empty(T... args)
+
ripple::NFTokenBaseUtil_test::testCancelOfferInvalid
void testCancelOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:914
+
ripple::NFTokenBaseUtil_test::testFixNFTokenRemint
void testFixNFTokenRemint(FeatureBitset features)
Definition: NFToken_test.cpp:6070
+
ripple::NFTokenBaseUtil_test::testNFTokenDeleteAccount
void testNFTokenDeleteAccount(FeatureBitset features)
Definition: NFToken_test.cpp:4643
ripple::OpenView::read
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition: OpenView.cpp:171
ripple::tfTrustLine
constexpr const std::uint32_t tfTrustLine
Definition: TxFlags.h:130
std::optional< int >
@@ -7117,6 +7123,7 @@ $(function() {
std::size_t
ripple::tfClearFreeze
constexpr std::uint32_t tfClearFreeze
Definition: TxFlags.h:113
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:41
+
ripple::NFTokenDisallowIncoming_test::run
void run() override
Definition: NFToken_test.cpp:6869
ripple::tfOnlyXRP
constexpr const std::uint32_t tfOnlyXRP
Definition: TxFlags.h:129
ripple::sfNFTokenTaxon
const SF_UINT32 sfNFTokenTaxon
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition: Account.h:37
@@ -7124,36 +7131,29 @@ $(function() {
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:286
std::vector::end
T end(T... args)
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:86
+
ripple::NFTokenWOfixV1_test::run
void run() override
Definition: NFToken_test.cpp:6878
ripple::tagged_integer
A type-safe wrap around standard integral types.
Definition: tagged_integer.h:44
-
ripple::NFToken4_test::run
void run() override
Definition: NFToken_test.cpp:6896
ripple::fixNonFungibleTokensV1_2
const uint256 fixNonFungibleTokensV1_2
-
ripple::NFToken0_test::run
void run(std::uint32_t instance, bool last=false)
Definition: NFToken_test.cpp:6838
+
ripple::NFTokenBaseUtil_test::mintedCount
static std::uint32_t mintedCount(test::jtx::Env const &env, test::jtx::Account const &issuer)
Definition: NFToken_test.cpp:46
ripple::base_uint::parseHex
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:496
ripple::temBAD_EXPIRATION
@ temBAD_EXPIRATION
Definition: TER.h:90
ripple::sfBurnedNFTokens
const SF_UINT32 sfBurnedNFTokens
ripple::keylet::check
Keylet check(AccountID const &id, std::uint32_t seq) noexcept
A Check.
Definition: Indexes.cpp:290
-
ripple::NFToken0_test::testCancelOfferInvalid
void testCancelOfferInvalid(FeatureBitset features)
Definition: NFToken_test.cpp:914
ripple::nft::getTaxon
Taxon getTaxon(uint256 const &id)
Definition: nft.h:107
+
ripple::NFTokenBaseUtil_test::testNftXxxOffers
void testNftXxxOffers(FeatureBitset features)
Definition: NFToken_test.cpp:4736
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:235
ripple::temBAD_NFTOKEN_TRANSFER_FEE
@ temBAD_NFTOKEN_TRANSFER_FEE
Definition: TER.h:126
std::set< std::string >
ripple::sfNFTokenSellOffer
const SF_UINT256 sfNFTokenSellOffer
ripple::test::jtx::Env::current
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:311
-
ripple::NFToken0_test::testCreateOfferDestination
void testCreateOfferDestination(FeatureBitset features)
Definition: NFToken_test.cpp:2714
-
ripple::NFToken0_test::testNFTokenOfferOwner
void testNFTokenOfferOwner(FeatureBitset features)
Definition: NFToken_test.cpp:4476
-
ripple::NFToken0_test::nftCount
static std::uint32_t nftCount(test::jtx::Env &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:66
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
-
ripple::NFToken0_test::testFixNFTokenRemint
void testFixNFTokenRemint(FeatureBitset features)
Definition: NFToken_test.cpp:6070
ripple::asfDisallowIncomingNFTokenOffer
constexpr std::uint32_t asfDisallowIncomingNFTokenOffer
Definition: TxFlags.h:87
-
ripple::NFToken0_test::testMintFlagBurnable
void testMintFlagBurnable(FeatureBitset features)
Definition: NFToken_test.cpp:1398
ripple::tecNO_DST
@ tecNO_DST
Definition: TER.h:270
ripple::sfNFTokenBrokerFee
const SF_AMOUNT sfNFTokenBrokerFee
Json::Value
Represents a JSON value.
Definition: json_value.h:145
-
ripple::NFToken2_test
Definition: NFToken_test.cpp:6875
-
ripple::NFToken0_test::burnedCount
static std::uint32_t burnedCount(test::jtx::Env const &env, test::jtx::Account const &issuer)
Definition: NFToken_test.cpp:56
-
ripple::NFToken0_test::testFixNFTokenNegOffer
void testFixNFTokenNegOffer(FeatureBitset features)
Definition: NFToken_test.cpp:4965
initializer_list
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
+
ripple::NFTokenBaseUtil_test::ownerCount
static std::uint32_t ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)
Definition: NFToken_test.cpp:36