diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html index a837f1e2ab..9005f748f2 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -534,36 +534,42 @@ $(function() {
463  std::vector<std::string> const& args,
464  std::unordered_map<std::string, std::string> const& headers)
465 {
-
466  return rpcClient(args, app().config(), app().logs(), headers).second;
-
467 }
-
468 
-
469 void
-
470 Env::enableFeature(uint256 const feature)
-
471 {
-
472  // Env::close() must be called for feature
-
473  // enable to take place.
-
474  app().config().features.insert(feature);
-
475 }
-
476 
-
477 void
-
478 Env::disableFeature(uint256 const feature)
-
479 {
-
480  // Env::close() must be called for feature
-
481  // enable to take place.
-
482  app().config().features.erase(feature);
-
483 }
-
484 
-
485 } // namespace jtx
-
486 
-
487 } // namespace test
-
488 } // namespace ripple
+
466  return rpcClient(
+
467  args,
+
468  app().config(),
+
469  app().logs(),
+
470  RPC::apiMaximumSupportedVersion,
+
471  headers)
+
472  .second;
+
473 }
+
474 
+
475 void
+
476 Env::enableFeature(uint256 const feature)
+
477 {
+
478  // Env::close() must be called for feature
+
479  // enable to take place.
+
480  app().config().features.insert(feature);
+
481 }
+
482 
+
483 void
+
484 Env::disableFeature(uint256 const feature)
+
485 {
+
486  // Env::close() must be called for feature
+
487  // enable to take place.
+
488  app().config().features.erase(feature);
+
489 }
+
490 
+
491 } // namespace jtx
+
492 
+
493 } // namespace test
+
494 } // namespace ripple
ripple::test::jtx::Env::AppBundle::app
Application * app
Definition: Env.h:127
ripple::Application::setup
virtual bool setup(boost::program_options::variables_map const &options)=0
ripple::test::jtx::Account::name
std::string const & name() const
Return the name.
Definition: Account.h:82
ripple::test::jtx::Env::autofill_sig
void autofill_sig(JTx &jt)
Definition: Env.cpp:388
ripple::test::jtx::XRP
const XRP_t XRP
Converts to XRP Issue or STAmount.
Definition: amount.cpp:105
-
ripple::test::jtx::parse_error
Thrown when parse fails.
Definition: utility.h:34
+
ripple::test::jtx::parse_error
Thrown when parse fails.
Definition: utility.h:35
ripple::Keylet
A pair of SHAMap key and LedgerEntryType.
Definition: Keylet.h:38
ripple::Application::start
virtual void start(bool withTimers)=0
ripple::Issue
A currency issued by an account.
Definition: Issue.h:35
@@ -587,14 +593,14 @@ $(function() {
ripple::test::jtx::balance
A balance matches.
Definition: balance.h:38
ripple::test::jtx::Env::AppBundle::AppBundle
AppBundle()=default
std::vector< std::string >
-
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:470
+
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:476
ripple::test::jtx::Env::AppBundle::timeKeeper
ManualTimeKeeper * timeKeeper
Definition: Env.h:129
ripple::test::jtx::trust
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition: trust.cpp:30
ripple::test::jtx::Env::txid_
uint256 txid_
Definition: Env.h:653
ripple::test::jtx::Env::AppBundle::~AppBundle
~AppBundle()
Definition: Env.cpp:95
ripple::test::jtx::JTx::stx
std::shared_ptr< STTx const > stx
Definition: JTx.h:50
ripple::test::jtx::Env::jt
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:440
-
ripple::test::jtx::fill_seq
void fill_seq(Json::Value &jv, ReadView const &view)
Set the sequence number automatically.
Definition: utility.cpp:63
+
ripple::test::jtx::fill_seq
void fill_seq(Json::Value &jv, ReadView const &view)
Set the sequence number automatically.
Definition: utility.cpp:65
ripple::Issue::currency
Currency currency
Definition: Issue.h:38
ripple::Application::signalStop
virtual void signalStop(std::string msg="")=0
ripple::transToken
std::string transToken(TER code)
Definition: TER.cpp:241
@@ -607,7 +613,7 @@ $(function() {
ripple::test::jtx::Env::balance
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:183
Json::Value::isNull
bool isNull() const
isNull() tests to see if this field is null.
Definition: json_value.cpp:967
ripple::test::jtx::JTx::require
requires_t require
Definition: JTx.h:45
-
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:44
+
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:46
ripple::test::jtx::Env::ter
TER ter() const
Return the TER for the last JTx.
Definition: Env.h:526
ripple::isTecClaim
bool isTecClaim(TER x)
Definition: TER.h:643
ripple::test::jtx::Env::trust
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:259
@@ -615,6 +621,7 @@ $(function() {
ripple::Application::getOPs
virtual NetworkOPs & getOPs()=0
ripple::test::jtx::autofill
static const autofill_t autofill
Definition: tags.h:42
ripple::test::jtx::Env::st
std::shared_ptr< STTx const > st(JTx const &jt)
Create a STTx from a JTx The framework requires that JSON is valid.
Definition: Env.cpp:436
+
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1517
ripple::test::jtx::Env::parseResult
static std::pair< TER, bool > parseResult(Json::Value const &jr)
Gets the TER result and didApply flag from a RPC Json result object.
Definition: Env.cpp:276
std::tie
T tie(T... args)
std::cout
@@ -631,7 +638,7 @@ $(function() {
ripple::test::jtx::JTx
Execution context for applying a JSON transaction.
Definition: JTx.h:42
ripple::setDebugLogSink
std::unique_ptr< beast::Journal::Sink > setDebugLogSink(std::unique_ptr< beast::Journal::Sink > sink)
Set the sink for the debug journal.
Definition: Log.cpp:446
ripple::test::jtx::JTx::jv
Json::Value jv
Definition: JTx.h:44
-
ripple::test::jtx::fill_fee
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition: utility.cpp:55
+
ripple::test::jtx::fill_fee
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition: utility.cpp:57
ripple::test::jtx::fset
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition: flags.cpp:28
std::to_string
T to_string(T... args)
ripple::Application::getJobQueue
virtual JobQueue & getJobQueue()=0
@@ -676,15 +683,15 @@ $(function() {
ripple::test::jtx::Env::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:228
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:216
ripple::asfDefaultRipple
constexpr std::uint32_t asfDefaultRipple
Definition: TxFlags.h:81
-
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1545
ripple::test::jtx::Env::AppBundle::owned
std::unique_ptr< Application > owned
Definition: Env.h:128
ripple::test::jtx::Env::master
Account const & master
Definition: Env.h:122
+
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
ripple::sfBalance
const SF_AMOUNT sfBalance
ripple::NetworkOPs::acceptLedger
virtual std::uint32_t acceptLedger(std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)=0
Accepts the current transaction tree, return the new ledger's sequence.
ripple::test::jtx::pay
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition: pay.cpp:29
ripple::test::jtx::nflags
Match clear account flags.
Definition: flags.h:128
std::optional< std::chrono::milliseconds >
-
ripple::test::jtx::Env::disableFeature
void disableFeature(uint256 const feature)
Definition: Env.cpp:478
+
ripple::test::jtx::Env::disableFeature
void disableFeature(uint256 const feature)
Definition: Env.cpp:484
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition: Account.h:37
std::make_pair
T make_pair(T... args)
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
@@ -692,7 +699,7 @@ $(function() {
beast::severities::kFatal
@ kFatal
Definition: Journal.h:39
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::test::ManualTimeKeeper::set
void set(time_point now)
Definition: ManualTimeKeeper.h:44
-
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:35
+
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:37
ripple::test::jtx::Env::memoize
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
std::unique_ptr
STL class.
ripple::test::jtx::JTx::fill_fee
bool fill_fee
Definition: JTx.h:47
diff --git a/Env_8h_source.html b/Env_8h_source.html index 37e99516ea..dd16f55ad7 100644 --- a/Env_8h_source.html +++ b/Env_8h_source.html @@ -612,7 +612,7 @@ $(function() {
ripple::test::jtx::Env::fund_arg
void fund_arg(STAmount const &amount, std::array< Account, N > const &list)
Definition: Env.h:574
ripple::test::jtx::Env::AppBundle::AppBundle
AppBundle()=default
vector
-
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:470
+
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:476
ripple::test::jtx::Env::AppBundle::timeKeeper
ManualTimeKeeper * timeKeeper
Definition: Env.h:129
ripple::test::jtx::Env::txid_
uint256 txid_
Definition: Env.h:653
ripple::test::jtx::Env::AppBundle::~AppBundle
~AppBundle()
Definition: Env.cpp:95
@@ -696,7 +696,7 @@ $(function() {
ripple::FeatureBitset
Definition: Feature.h:113
ripple::test::jtx::Env::Env
Env(beast::unit_test::suite &suite_)
Create Env with only the current test suite.
Definition: Env.h:235
std::optional< std::chrono::milliseconds >
-
ripple::test::jtx::Env::disableFeature
void disableFeature(uint256 const feature)
Definition: Env.cpp:478
+
ripple::test::jtx::Env::disableFeature
void disableFeature(uint256 const feature)
Definition: Env.cpp:484
ripple::test::jtx::Env::~Env
virtual ~Env()=default
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition: Account.h:37
ripple::test::jtx::Env::fund_arg
void fund_arg(STAmount const &amount, Account const &account)
Definition: Env.h:567
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html index ddbb3753ac..9c4bfba19b 100644 --- a/Main_8cpp_source.html +++ b/Main_8cpp_source.html @@ -965,7 +965,7 @@ $(function() {
ripple::test::multi_runner_parent::any_failed
bool any_failed() const
Definition: multi_runner.cpp:479
std::atomic< bool >
beast::severities::kInfo
@ kInfo
Definition: Journal.h:36
-
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1696
+
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1670
ripple::test::envUseIPv4
std::atomic< bool > envUseIPv4
Definition: envconfig.cpp:36
beast::setCurrentThreadName
void setCurrentThreadName(std::string_view name)
Changes the name of the caller thread.
Definition: CurrentThreadName.cpp:119
std::vector::emplace_back
T emplace_back(T... args)
diff --git a/PayChan__test_8cpp_source.html b/PayChan__test_8cpp_source.html index 78ae033b77..52e3489440 100644 --- a/PayChan__test_8cpp_source.html +++ b/PayChan__test_8cpp_source.html @@ -2201,7 +2201,7 @@ $(function() {
ripple::TxSearched::all
@ all
std::vector
STL class.
std::find
T find(T... args)
-
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:470
+
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:476
std::set::size
T size(T... args)
ripple::test::PayChan_test::testExpiration
void testExpiration(FeatureBitset features)
Definition: PayChan_test.cpp:407
ripple::featureDepositAuth
const uint256 featureDepositAuth
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html index ee31e99daa..70b1ba1151 100644 --- a/RPCCall_8cpp_source.html +++ b/RPCCall_8cpp_source.html @@ -1543,308 +1543,283 @@ $(function() {
1472 //------------------------------------------------------------------------------
1473 
1474 // Used internally by rpcClient.
-
1475 static Json::Value
-
1476 rpcCmdLineToJson(
+
1475 Json::Value
+
1476 rpcCmdToJson(
1477  std::vector<std::string> const& args,
1478  Json::Value& retParams,
-
1479  beast::Journal j)
-
1480 {
-
1481  Json::Value jvRequest(Json::objectValue);
-
1482 
-
1483  RPCParser rpParser(j);
-
1484  Json::Value jvRpcParams(Json::arrayValue);
-
1485 
-
1486  for (int i = 1; i != args.size(); i++)
-
1487  jvRpcParams.append(args[i]);
-
1488 
-
1489  retParams = Json::Value(Json::objectValue);
-
1490 
-
1491  retParams[jss::method] = args[0];
-
1492  retParams[jss::params] = jvRpcParams;
-
1493 
-
1494  jvRequest = rpParser.parseCommand(args[0], jvRpcParams, true);
-
1495 
-
1496  auto insert_api_version = [](Json::Value& jr) {
-
1497  if (jr.isObject() && !jr.isMember(jss::error) &&
-
1498  !jr.isMember(jss::api_version))
-
1499  {
-
1500  jr[jss::api_version] = RPC::apiMaximumSupportedVersion;
-
1501  }
-
1502  };
-
1503 
-
1504  if (jvRequest.isObject())
-
1505  insert_api_version(jvRequest);
-
1506  else if (jvRequest.isArray())
-
1507  std::for_each(jvRequest.begin(), jvRequest.end(), insert_api_version);
-
1508 
-
1509  JLOG(j.trace()) << "RPC Request: " << jvRequest << std::endl;
-
1510  return jvRequest;
-
1511 }
-
1512 
-
1513 Json::Value
-
1514 cmdLineToJSONRPC(std::vector<std::string> const& args, beast::Journal j)
-
1515 {
-
1516  Json::Value jv = Json::Value(Json::objectValue);
-
1517  auto const paramsObj = rpcCmdLineToJson(args, jv, j);
-
1518 
-
1519  // Re-use jv to return our formatted result.
-
1520  jv.clear();
-
1521 
-
1522  // Allow parser to rewrite method.
-
1523  jv[jss::method] = paramsObj.isMember(jss::method)
-
1524  ? paramsObj[jss::method].asString()
-
1525  : args[0];
-
1526 
-
1527  // If paramsObj is not empty, put it in a [params] array.
-
1528  if (paramsObj.begin() != paramsObj.end())
-
1529  {
-
1530  auto& paramsArray = Json::setArray(jv, jss::params);
-
1531  paramsArray.append(paramsObj);
-
1532  }
-
1533  if (paramsObj.isMember(jss::jsonrpc))
-
1534  jv[jss::jsonrpc] = paramsObj[jss::jsonrpc];
-
1535  if (paramsObj.isMember(jss::ripplerpc))
-
1536  jv[jss::ripplerpc] = paramsObj[jss::ripplerpc];
-
1537  if (paramsObj.isMember(jss::id))
-
1538  jv[jss::id] = paramsObj[jss::id];
-
1539  return jv;
-
1540 }
-
1541 
-
1542 //------------------------------------------------------------------------------
-
1543 
-
1544 std::pair<int, Json::Value>
-
1545 rpcClient(
-
1546  std::vector<std::string> const& args,
-
1547  Config const& config,
-
1548  Logs& logs,
-
1549  std::unordered_map<std::string, std::string> const& headers)
-
1550 {
-
1551  static_assert(
-
1552  rpcBAD_SYNTAX == 1 && rpcSUCCESS == 0,
-
1553  "Expect specific rpc enum values.");
-
1554  if (args.empty())
-
1555  return {rpcBAD_SYNTAX, {}}; // rpcBAD_SYNTAX = print usage
-
1556 
-
1557  int nRet = rpcSUCCESS;
-
1558  Json::Value jvOutput;
-
1559  Json::Value jvRequest(Json::objectValue);
-
1560 
-
1561  try
-
1562  {
-
1563  Json::Value jvRpc = Json::Value(Json::objectValue);
-
1564  jvRequest = rpcCmdLineToJson(args, jvRpc, logs.journal("RPCParser"));
+
1479  unsigned int apiVersion,
+
1480  beast::Journal j)
+
1481 {
+
1482  Json::Value jvRequest(Json::objectValue);
+
1483 
+
1484  RPCParser rpParser(j);
+
1485  Json::Value jvRpcParams(Json::arrayValue);
+
1486 
+
1487  for (int i = 1; i != args.size(); i++)
+
1488  jvRpcParams.append(args[i]);
+
1489 
+
1490  retParams = Json::Value(Json::objectValue);
+
1491 
+
1492  retParams[jss::method] = args[0];
+
1493  retParams[jss::params] = jvRpcParams;
+
1494 
+
1495  jvRequest = rpParser.parseCommand(args[0], jvRpcParams, true);
+
1496 
+
1497  auto insert_api_version = [apiVersion](Json::Value& jr) {
+
1498  if (jr.isObject() && !jr.isMember(jss::error) &&
+
1499  !jr.isMember(jss::api_version))
+
1500  {
+
1501  jr[jss::api_version] = apiVersion;
+
1502  }
+
1503  };
+
1504 
+
1505  if (jvRequest.isObject())
+
1506  insert_api_version(jvRequest);
+
1507  else if (jvRequest.isArray())
+
1508  std::for_each(jvRequest.begin(), jvRequest.end(), insert_api_version);
+
1509 
+
1510  JLOG(j.trace()) << "RPC Request: " << jvRequest << std::endl;
+
1511  return jvRequest;
+
1512 }
+
1513 
+
1514 //------------------------------------------------------------------------------
+
1515 
+
1516 std::pair<int, Json::Value>
+
1517 rpcClient(
+
1518  std::vector<std::string> const& args,
+
1519  Config const& config,
+
1520  Logs& logs,
+
1521  unsigned int apiVersion,
+
1522  std::unordered_map<std::string, std::string> const& headers)
+
1523 {
+
1524  static_assert(
+
1525  rpcBAD_SYNTAX == 1 && rpcSUCCESS == 0,
+
1526  "Expect specific rpc enum values.");
+
1527  if (args.empty())
+
1528  return {rpcBAD_SYNTAX, {}}; // rpcBAD_SYNTAX = print usage
+
1529 
+
1530  int nRet = rpcSUCCESS;
+
1531  Json::Value jvOutput;
+
1532  Json::Value jvRequest(Json::objectValue);
+
1533 
+
1534  try
+
1535  {
+
1536  Json::Value jvRpc = Json::Value(Json::objectValue);
+
1537  jvRequest =
+
1538  rpcCmdToJson(args, jvRpc, apiVersion, logs.journal("RPCParser"));
+
1539 
+
1540  if (jvRequest.isMember(jss::error))
+
1541  {
+
1542  jvOutput = jvRequest;
+
1543  jvOutput["rpc"] = jvRpc;
+
1544  }
+
1545  else
+
1546  {
+
1547  ServerHandler::Setup setup;
+
1548  try
+
1549  {
+
1550  setup = setup_ServerHandler(
+
1551  config,
+
1552  beast::logstream{logs.journal("HTTPClient").warn()});
+
1553  }
+
1554  catch (std::exception const&)
+
1555  {
+
1556  // ignore any exceptions, so the command
+
1557  // line client works without a config file
+
1558  }
+
1559 
+
1560  if (config.rpc_ip)
+
1561  {
+
1562  setup.client.ip = config.rpc_ip->address().to_string();
+
1563  setup.client.port = config.rpc_ip->port();
+
1564  }
1565 
-
1566  if (jvRequest.isMember(jss::error))
-
1567  {
-
1568  jvOutput = jvRequest;
-
1569  jvOutput["rpc"] = jvRpc;
-
1570  }
-
1571  else
-
1572  {
-
1573  ServerHandler::Setup setup;
-
1574  try
-
1575  {
-
1576  setup = setup_ServerHandler(
-
1577  config,
-
1578  beast::logstream{logs.journal("HTTPClient").warn()});
-
1579  }
-
1580  catch (std::exception const&)
-
1581  {
-
1582  // ignore any exceptions, so the command
-
1583  // line client works without a config file
-
1584  }
-
1585 
-
1586  if (config.rpc_ip)
-
1587  {
-
1588  setup.client.ip = config.rpc_ip->address().to_string();
-
1589  setup.client.port = config.rpc_ip->port();
-
1590  }
-
1591 
-
1592  Json::Value jvParams(Json::arrayValue);
-
1593 
-
1594  if (!setup.client.admin_user.empty())
-
1595  jvRequest["admin_user"] = setup.client.admin_user;
-
1596 
-
1597  if (!setup.client.admin_password.empty())
-
1598  jvRequest["admin_password"] = setup.client.admin_password;
-
1599 
-
1600  if (jvRequest.isObject())
-
1601  jvParams.append(jvRequest);
-
1602  else if (jvRequest.isArray())
-
1603  {
-
1604  for (Json::UInt i = 0; i < jvRequest.size(); ++i)
-
1605  jvParams.append(jvRequest[i]);
+
1566  Json::Value jvParams(Json::arrayValue);
+
1567 
+
1568  if (!setup.client.admin_user.empty())
+
1569  jvRequest["admin_user"] = setup.client.admin_user;
+
1570 
+
1571  if (!setup.client.admin_password.empty())
+
1572  jvRequest["admin_password"] = setup.client.admin_password;
+
1573 
+
1574  if (jvRequest.isObject())
+
1575  jvParams.append(jvRequest);
+
1576  else if (jvRequest.isArray())
+
1577  {
+
1578  for (Json::UInt i = 0; i < jvRequest.size(); ++i)
+
1579  jvParams.append(jvRequest[i]);
+
1580  }
+
1581 
+
1582  {
+
1583  boost::asio::io_service isService;
+
1584  RPCCall::fromNetwork(
+
1585  isService,
+
1586  setup.client.ip,
+
1587  setup.client.port,
+
1588  setup.client.user,
+
1589  setup.client.password,
+
1590  "",
+
1591  jvRequest.isMember(
+
1592  jss::method) // Allow parser to rewrite method.
+
1593  ? jvRequest[jss::method].asString()
+
1594  : jvRequest.isArray() ? "batch" : args[0],
+
1595  jvParams, // Parsed, execute.
+
1596  setup.client.secure != 0, // Use SSL
+
1597  config.quiet(),
+
1598  logs,
+
1599  std::bind(
+
1600  RPCCallImp::callRPCHandler,
+
1601  &jvOutput,
+
1602  std::placeholders::_1),
+
1603  headers);
+
1604  isService.run(); // This blocks until there are no more
+
1605  // outstanding async calls.
1606  }
-
1607 
+
1607  if (jvOutput.isMember("result"))
1608  {
-
1609  boost::asio::io_service isService;
-
1610  RPCCall::fromNetwork(
-
1611  isService,
-
1612  setup.client.ip,
-
1613  setup.client.port,
-
1614  setup.client.user,
-
1615  setup.client.password,
-
1616  "",
-
1617  jvRequest.isMember(
-
1618  jss::method) // Allow parser to rewrite method.
-
1619  ? jvRequest[jss::method].asString()
-
1620  : jvRequest.isArray() ? "batch" : args[0],
-
1621  jvParams, // Parsed, execute.
-
1622  setup.client.secure != 0, // Use SSL
-
1623  config.quiet(),
-
1624  logs,
-
1625  std::bind(
-
1626  RPCCallImp::callRPCHandler,
-
1627  &jvOutput,
-
1628  std::placeholders::_1),
-
1629  headers);
-
1630  isService.run(); // This blocks until there are no more
-
1631  // outstanding async calls.
-
1632  }
-
1633  if (jvOutput.isMember("result"))
-
1634  {
-
1635  // Had a successful JSON-RPC 2.0 call.
-
1636  jvOutput = jvOutput["result"];
-
1637 
-
1638  // jvOutput may report a server side error.
-
1639  // It should report "status".
-
1640  }
-
1641  else
-
1642  {
-
1643  // Transport error.
-
1644  Json::Value jvRpcError = jvOutput;
+
1609  // Had a successful JSON-RPC 2.0 call.
+
1610  jvOutput = jvOutput["result"];
+
1611 
+
1612  // jvOutput may report a server side error.
+
1613  // It should report "status".
+
1614  }
+
1615  else
+
1616  {
+
1617  // Transport error.
+
1618  Json::Value jvRpcError = jvOutput;
+
1619 
+
1620  jvOutput = rpcError(rpcJSON_RPC);
+
1621  jvOutput["result"] = jvRpcError;
+
1622  }
+
1623 
+
1624  // If had an error, supply invocation in result.
+
1625  if (jvOutput.isMember(jss::error))
+
1626  {
+
1627  jvOutput["rpc"] =
+
1628  jvRpc; // How the command was seen as method + params.
+
1629  jvOutput["request_sent"] =
+
1630  jvRequest; // How the command was translated.
+
1631  }
+
1632  }
+
1633 
+
1634  if (jvOutput.isMember(jss::error))
+
1635  {
+
1636  jvOutput[jss::status] = "error";
+
1637  if (jvOutput.isMember(jss::error_code))
+
1638  nRet = std::stoi(jvOutput[jss::error_code].asString());
+
1639  else if (jvOutput[jss::error].isMember(jss::error_code))
+
1640  nRet =
+
1641  std::stoi(jvOutput[jss::error][jss::error_code].asString());
+
1642  else
+
1643  nRet = rpcBAD_SYNTAX;
+
1644  }
1645 
-
1646  jvOutput = rpcError(rpcJSON_RPC);
-
1647  jvOutput["result"] = jvRpcError;
-
1648  }
-
1649 
-
1650  // If had an error, supply invocation in result.
-
1651  if (jvOutput.isMember(jss::error))
-
1652  {
-
1653  jvOutput["rpc"] =
-
1654  jvRpc; // How the command was seen as method + params.
-
1655  jvOutput["request_sent"] =
-
1656  jvRequest; // How the command was translated.
-
1657  }
-
1658  }
-
1659 
-
1660  if (jvOutput.isMember(jss::error))
-
1661  {
-
1662  jvOutput[jss::status] = "error";
-
1663  if (jvOutput.isMember(jss::error_code))
-
1664  nRet = std::stoi(jvOutput[jss::error_code].asString());
-
1665  else if (jvOutput[jss::error].isMember(jss::error_code))
-
1666  nRet =
-
1667  std::stoi(jvOutput[jss::error][jss::error_code].asString());
-
1668  else
-
1669  nRet = rpcBAD_SYNTAX;
-
1670  }
-
1671 
-
1672  // YYY We could have a command line flag for single line output for
-
1673  // scripts. YYY We would intercept output here and simplify it.
-
1674  }
-
1675  catch (RequestNotParseable& e)
-
1676  {
-
1677  jvOutput = rpcError(rpcINVALID_PARAMS);
-
1678  jvOutput["error_what"] = e.what();
-
1679  nRet = rpcINVALID_PARAMS;
-
1680  }
-
1681  catch (std::exception& e)
-
1682  {
-
1683  jvOutput = rpcError(rpcINTERNAL);
-
1684  jvOutput["error_what"] = e.what();
-
1685  nRet = rpcINTERNAL;
-
1686  }
-
1687 
-
1688  return {nRet, std::move(jvOutput)};
-
1689 }
-
1690 
-
1691 //------------------------------------------------------------------------------
-
1692 
-
1693 namespace RPCCall {
-
1694 
-
1695 int
-
1696 fromCommandLine(
-
1697  Config const& config,
-
1698  const std::vector<std::string>& vCmd,
-
1699  Logs& logs)
+
1646  // YYY We could have a command line flag for single line output for
+
1647  // scripts. YYY We would intercept output here and simplify it.
+
1648  }
+
1649  catch (RequestNotParseable& e)
+
1650  {
+
1651  jvOutput = rpcError(rpcINVALID_PARAMS);
+
1652  jvOutput["error_what"] = e.what();
+
1653  nRet = rpcINVALID_PARAMS;
+
1654  }
+
1655  catch (std::exception& e)
+
1656  {
+
1657  jvOutput = rpcError(rpcINTERNAL);
+
1658  jvOutput["error_what"] = e.what();
+
1659  nRet = rpcINTERNAL;
+
1660  }
+
1661 
+
1662  return {nRet, std::move(jvOutput)};
+
1663 }
+
1664 
+
1665 //------------------------------------------------------------------------------
+
1666 
+
1667 namespace RPCCall {
+
1668 
+
1669 int
+
1670 fromCommandLine(
+
1671  Config const& config,
+
1672  const std::vector<std::string>& vCmd,
+
1673  Logs& logs)
+
1674 {
+
1675  auto const result =
+
1676  rpcClient(vCmd, config, logs, RPC::apiMaximumSupportedVersion);
+
1677 
+
1678  std::cout << result.second.toStyledString();
+
1679 
+
1680  return result.first;
+
1681 }
+
1682 
+
1683 //------------------------------------------------------------------------------
+
1684 
+
1685 void
+
1686 fromNetwork(
+
1687  boost::asio::io_service& io_service,
+
1688  std::string const& strIp,
+
1689  const std::uint16_t iPort,
+
1690  std::string const& strUsername,
+
1691  std::string const& strPassword,
+
1692  std::string const& strPath,
+
1693  std::string const& strMethod,
+
1694  Json::Value const& jvParams,
+
1695  const bool bSSL,
+
1696  const bool quiet,
+
1697  Logs& logs,
+
1698  std::function<void(Json::Value const& jvInput)> callbackFuncP,
+
1699  std::unordered_map<std::string, std::string> headers)
1700 {
-
1701  auto const result = rpcClient(vCmd, config, logs);
+
1701  auto j = logs.journal("HTTPClient");
1702 
-
1703  std::cout << result.second.toStyledString();
-
1704 
-
1705  return result.first;
-
1706 }
-
1707 
-
1708 //------------------------------------------------------------------------------
+
1703  // Connect to localhost
+
1704  if (!quiet)
+
1705  {
+
1706  JLOG(j.info()) << (bSSL ? "Securely connecting to " : "Connecting to ")
+
1707  << strIp << ":" << iPort << std::endl;
+
1708  }
1709 
-
1710 void
-
1711 fromNetwork(
-
1712  boost::asio::io_service& io_service,
-
1713  std::string const& strIp,
-
1714  const std::uint16_t iPort,
-
1715  std::string const& strUsername,
-
1716  std::string const& strPassword,
-
1717  std::string const& strPath,
-
1718  std::string const& strMethod,
-
1719  Json::Value const& jvParams,
-
1720  const bool bSSL,
-
1721  const bool quiet,
-
1722  Logs& logs,
-
1723  std::function<void(Json::Value const& jvInput)> callbackFuncP,
-
1724  std::unordered_map<std::string, std::string> headers)
-
1725 {
-
1726  auto j = logs.journal("HTTPClient");
-
1727 
-
1728  // Connect to localhost
-
1729  if (!quiet)
-
1730  {
-
1731  JLOG(j.info()) << (bSSL ? "Securely connecting to " : "Connecting to ")
-
1732  << strIp << ":" << iPort << std::endl;
-
1733  }
-
1734 
-
1735  // HTTP basic authentication
-
1736  headers["Authorization"] =
-
1737  std::string("Basic ") + base64_encode(strUsername + ":" + strPassword);
-
1738 
-
1739  // Send request
-
1740 
-
1741  // Number of bytes to try to receive if no
-
1742  // Content-Length header received
-
1743  constexpr auto RPC_REPLY_MAX_BYTES = megabytes(256);
-
1744 
-
1745  using namespace std::chrono_literals;
-
1746  auto constexpr RPC_NOTIFY = 10min;
-
1747 
-
1748  HTTPClient::request(
-
1749  bSSL,
-
1750  io_service,
-
1751  strIp,
-
1752  iPort,
-
1753  std::bind(
-
1754  &RPCCallImp::onRequest,
-
1755  strMethod,
-
1756  jvParams,
-
1757  headers,
-
1758  strPath,
-
1759  std::placeholders::_1,
-
1760  std::placeholders::_2,
-
1761  j),
-
1762  RPC_REPLY_MAX_BYTES,
-
1763  RPC_NOTIFY,
-
1764  std::bind(
-
1765  &RPCCallImp::onResponse,
-
1766  callbackFuncP,
-
1767  std::placeholders::_1,
-
1768  std::placeholders::_2,
-
1769  std::placeholders::_3,
-
1770  j),
-
1771  j);
-
1772 }
-
1773 
-
1774 } // namespace RPCCall
-
1775 
-
1776 } // namespace ripple
+
1710  // HTTP basic authentication
+
1711  headers["Authorization"] =
+
1712  std::string("Basic ") + base64_encode(strUsername + ":" + strPassword);
+
1713 
+
1714  // Send request
+
1715 
+
1716  // Number of bytes to try to receive if no
+
1717  // Content-Length header received
+
1718  constexpr auto RPC_REPLY_MAX_BYTES = megabytes(256);
+
1719 
+
1720  using namespace std::chrono_literals;
+
1721  auto constexpr RPC_NOTIFY = 10min;
+
1722 
+
1723  HTTPClient::request(
+
1724  bSSL,
+
1725  io_service,
+
1726  strIp,
+
1727  iPort,
+
1728  std::bind(
+
1729  &RPCCallImp::onRequest,
+
1730  strMethod,
+
1731  jvParams,
+
1732  headers,
+
1733  strPath,
+
1734  std::placeholders::_1,
+
1735  std::placeholders::_2,
+
1736  j),
+
1737  RPC_REPLY_MAX_BYTES,
+
1738  RPC_NOTIFY,
+
1739  std::bind(
+
1740  &RPCCallImp::onResponse,
+
1741  callbackFuncP,
+
1742  std::placeholders::_1,
+
1743  std::placeholders::_2,
+
1744  std::placeholders::_3,
+
1745  j),
+
1746  j);
+
1747 }
+
1748 
+
1749 } // namespace RPCCall
+
1750 
+
1751 } // namespace ripple
ripple::RPCParser::parseAsIs
Json::Value parseAsIs(Json::Value const &jvParams)
Definition: RPCCall.cpp:181
ripple::RPCParser::parseServerDefinitions
Json::Value parseServerDefinitions(Json::Value const &jvParams)
Definition: RPCCall.cpp:1199
@@ -1880,6 +1855,7 @@ $(function() {
std::string::size
T size(T... args)
ripple::base64_encode
std::string base64_encode(std::uint8_t const *data, std::size_t len)
Definition: base64.cpp:236
ripple::rpcJSON_RPC
@ rpcJSON_RPC
Definition: ErrorCodes.h:47
+
ripple::rpcCmdToJson
Json::Value rpcCmdToJson(std::vector< std::string > const &args, Json::Value &retParams, unsigned int apiVersion, beast::Journal j)
Definition: RPCCall.cpp:1476
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:104
ripple::RPCParser::parseFetchInfo
Json::Value parseFetchInfo(Json::Value const &jvParams)
Definition: RPCCall.cpp:258
ripple::RPCParser::parseJson2
Json::Value parseJson2(Json::Value const &jvParams)
Definition: RPCCall.cpp:663
@@ -1901,6 +1877,7 @@ $(function() {
ripple::Config::quiet
bool quiet() const
Definition: Config.h:336
ripple::RPCParser::parseSubmitMultiSigned
Json::Value parseSubmitMultiSigned(Json::Value const &jvParams)
Definition: RPCCall.cpp:1043
ripple::RPCParser::j_
const beast::Journal j_
Definition: RPCCall.cpp:94
+
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1517
ripple::RPCParser::parsePeerReservationsAdd
Json::Value parsePeerReservationsAdd(Json::Value const &jvParams)
Definition: RPCCall.cpp:954
ripple::setup_ServerHandler
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
Definition: ServerHandler.cpp:1236
std::cout
@@ -1948,10 +1925,9 @@ $(function() {
ripple::RPCParser::parseValidationCreate
Json::Value parseValidationCreate(Json::Value const &jvParams)
Definition: RPCCall.cpp:1131
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
Json::Value::isArray
bool isArray() const
Definition: json_value.cpp:1015
-
Json::setArray
Json::Value & setArray(Json::Value &, Json::StaticString const &key)
Add a new subarray at a named key in a Json object.
Definition: Object.h:414
ripple::rpcCHANNEL_AMT_MALFORMED
@ rpcCHANNEL_AMT_MALFORMED
Definition: ErrorCodes.h:101
std::ostringstream
STL class.
-
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1696
+
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1670
ripple::RPCParser::parseEvented
Json::Value parseEvented(Json::Value const &jvParams)
Definition: RPCCall.cpp:535
ripple::RPCCallImp::RPCCallImp
RPCCallImp()=default
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
@@ -1960,17 +1936,13 @@ $(function() {
ripple::rpcACT_MALFORMED
@ rpcACT_MALFORMED
Definition: ErrorCodes.h:90
ripple::Logs::journal
beast::Journal journal(std::string const &name)
Definition: Log.cpp:144
ripple::rpcBAD_SYNTAX
@ rpcBAD_SYNTAX
Definition: ErrorCodes.h:46
-
Json::Value::clear
void clear()
Remove all object members and array elements.
Definition: json_value.cpp:753
ripple::rpcUNKNOWN_COMMAND
@ rpcUNKNOWN_COMMAND
Definition: ErrorCodes.h:85
-
ripple::cmdLineToJSONRPC
Json::Value cmdLineToJSONRPC(std::vector< std::string > const &args, beast::Journal j)
Given a rippled command line, return the corresponding JSON.
Definition: RPCCall.cpp:1514
ripple::RPCParser::parseDownloadShard
Json::Value parseDownloadShard(Json::Value const &jvParams)
Definition: RPCCall.cpp:192
ripple::RPCParser::parseDepositAuthorized
Json::Value parseDepositAuthorized(Json::Value const &jvParams)
Definition: RPCCall.cpp:521
ripple::ServerHandler::Setup::client_t::secure
bool secure
Definition: ServerHandler.h:61
-
ripple::rpcCmdLineToJson
static Json::Value rpcCmdLineToJson(std::vector< std::string > const &args, Json::Value &retParams, beast::Journal j)
Definition: RPCCall.cpp:1476
std::string::begin
T begin(T... args)
Json::Value::asUInt
UInt asUInt() const
Definition: json_value.cpp:545
ripple::RPCCallImp::onResponse
static bool onResponse(std::function< void(Json::Value const &jvInput)> callbackFuncP, const boost::system::error_code &ecResult, int iStatus, std::string const &strData, beast::Journal j)
Definition: RPCCall.cpp:1410
-
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1545
ripple::TokenType::AccountPublic
@ AccountPublic
Json::Reader::parse
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
Definition: json_reader.cpp:74
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
@@ -1990,7 +1962,7 @@ $(function() {
Json::Value::asInt
Int asInt() const
Definition: json_value.cpp:503
ripple::RPCParser::isValidJson2
bool isValidJson2(Json::Value const &jv)
Definition: RPCCall.cpp:633
std::string::end
T end(T... args)
-
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1711
+
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1686
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::RPCParser::parseJson
Json::Value parseJson(Json::Value const &jvParams)
Definition: RPCCall.cpp:611
ripple::RPC::make_param_error
Json::Value make_param_error(std::string const &message)
Returns a new json object that indicates invalid parameters.
Definition: ErrorCodes.h:252
diff --git a/RPCCall_8h_source.html b/RPCCall_8h_source.html index 24dd89a23c..4fc57da368 100644 --- a/RPCCall_8h_source.html +++ b/RPCCall_8h_source.html @@ -135,33 +135,38 @@ $(function() {
65  std::unordered_map<std::string, std::string> headers = {});
66 } // namespace RPCCall
67 
-
70 Json::Value
-
71 cmdLineToJSONRPC(std::vector<std::string> const& args, beast::Journal j);
-
72 
-
75 std::pair<int, Json::Value>
-
76 rpcClient(
-
77  std::vector<std::string> const& args,
-
78  Config const& config,
-
79  Logs& logs,
-
80  std::unordered_map<std::string, std::string> const& headers = {});
-
81 
-
82 } // namespace ripple
-
83 
-
84 #endif
+
68 Json::Value
+
69 rpcCmdToJson(
+
70  std::vector<std::string> const& args,
+
71  Json::Value& retParams,
+
72  unsigned int apiVersion,
+
73  beast::Journal j);
+
74 
+
78 std::pair<int, Json::Value>
+
79 rpcClient(
+
80  std::vector<std::string> const& args,
+
81  Config const& config,
+
82  Logs& logs,
+
83  unsigned int apiVersion,
+
84  std::unordered_map<std::string, std::string> const& headers = {});
+
85 
+
86 } // namespace ripple
+
87 
+
88 #endif
std::string
STL class.
utility
functional
std::pair< int, Json::Value >
vector
+
ripple::rpcCmdToJson
Json::Value rpcCmdToJson(std::vector< std::string > const &args, Json::Value &retParams, unsigned int apiVersion, beast::Journal j)
Definition: RPCCall.cpp:1476
std::function
+
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1517
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint16_t
-
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1696
+
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1670
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::cmdLineToJSONRPC
Json::Value cmdLineToJSONRPC(std::vector< std::string > const &args, beast::Journal j)
Given a rippled command line, return the corresponding JSON.
Definition: RPCCall.cpp:1514
-
ripple::rpcClient
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition: RPCCall.cpp:1545
-
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1711
+
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1686
unordered_map
Json::Value
Represents a JSON value.
Definition: json_value.h:145
string
diff --git a/RPCCall__test_8cpp_source.html b/RPCCall__test_8cpp_source.html index 725ff1acbc..4ed6e56c1c 100644 --- a/RPCCall__test_8cpp_source.html +++ b/RPCCall__test_8cpp_source.html @@ -92,6521 +92,6522 @@ $(function() {
21 #include <ripple/protocol/ErrorCodes.h>
22 #include <ripple/rpc/impl/RPCHelpers.h>
23 #include <test/jtx.h>
-
24 
-
25 #include <boost/algorithm/string.hpp>
-
26 #include <initializer_list>
-
27 #include <vector>
-
28 
-
29 namespace ripple {
-
30 namespace test {
-
31 
-
32 struct RPCCallTestData
-
33 {
-
34  char const* const description;
-
35  int const line;
-
36  // List of passed arguments.
-
37  std::vector<char const*> const args;
-
38 
-
39  // If it throws, what does it throw?
-
40  enum Exception { no_exception = 0, bad_cast };
-
41  Exception const throwsWhat;
-
42 
-
43  // Expected JSON response.
-
44  char const* const exp;
-
45 
-
46  RPCCallTestData(
-
47  char const* description_,
-
48  int line_,
-
49  std::initializer_list<char const*> const& args_,
-
50  Exception throwsWhat_,
-
51  char const* exp_)
-
52  : description(description_)
-
53  , line(line_)
-
54  , args(args_)
-
55  , throwsWhat(throwsWhat_)
-
56  , exp(exp_)
-
57  {
-
58  }
-
59 
-
60  RPCCallTestData() = delete;
-
61  RPCCallTestData(RPCCallTestData const&) = delete;
-
62  RPCCallTestData(RPCCallTestData&&) = delete;
-
63  RPCCallTestData&
-
64  operator=(RPCCallTestData const&) = delete;
-
65  RPCCallTestData&
-
66  operator=(RPCCallTestData&&) = delete;
-
67 };
-
68 
-
69 static RPCCallTestData const rpcCallTestArray[] = {
-
70  // account_channels
-
71  // ------------------------------------------------------------
-
72  {"account_channels: minimal.",
-
73  __LINE__,
-
74  {"account_channels", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
75  RPCCallTestData::no_exception,
-
76  R"({
-
77  "method" : "account_channels",
-
78  "params" : [
-
79  {
-
80  "api_version" : %MAX_API_VER%,
-
81  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
82  }
-
83  ]
-
84  })"},
-
85  {"account_channels: account and ledger hash.",
-
86  __LINE__,
-
87  {"account_channels",
-
88  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
89  "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"},
-
90  RPCCallTestData::no_exception,
-
91  R"({
-
92  "method" : "account_channels",
-
93  "params" : [
-
94  {
-
95  "api_version" : %MAX_API_VER%,
-
96  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
97  "destination_account" : "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"
-
98  }
-
99  ]
-
100  })"},
-
101  {"account_channels: account and ledger index.",
-
102  __LINE__,
-
103  {"account_channels",
-
104  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
105  "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"},
-
106  RPCCallTestData::no_exception,
-
107  R"({
-
108  "method" : "account_channels",
-
109  "params" : [
-
110  {
-
111  "api_version" : %MAX_API_VER%,
-
112  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
113  "destination_account" : "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"
-
114  }
-
115  ]
-
116  })"},
-
117  {"account_channels: two accounts.",
-
118  __LINE__,
-
119  {"account_channels",
-
120  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
121  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
-
122  RPCCallTestData::no_exception,
-
123  R"({
-
124  "method" : "account_channels",
-
125  "params" : [
-
126  {
-
127  "api_version" : %MAX_API_VER%,
-
128  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
129  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
130  }
-
131  ]
-
132  })"},
-
133  {"account_channels: two accounts and ledger hash.",
-
134  __LINE__,
-
135  {"account_channels",
-
136  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
137  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
138  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
139  RPCCallTestData::no_exception,
-
140  R"({
-
141  "method" : "account_channels",
-
142  "params" : [
-
143  {
-
144  "api_version" : %MAX_API_VER%,
-
145  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
146  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
147  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
148  }
-
149  ]
-
150  })"},
-
151  {"account_channels: two accounts and ledger index.",
-
152  __LINE__,
-
153  {"account_channels",
-
154  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
155  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
156  "90210"},
-
157  RPCCallTestData::no_exception,
-
158  R"({
-
159  "method" : "account_channels",
-
160  "params" : [
-
161  {
-
162  "api_version" : %MAX_API_VER%,
-
163  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
164  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
165  "ledger_index" : 90210
-
166  }
-
167  ]
-
168  })"},
-
169  {"account_channels: too few arguments.",
-
170  __LINE__,
-
171  {
-
172  "account_channels",
-
173  },
-
174  RPCCallTestData::no_exception,
-
175  R"({
-
176  "method" : "account_channels",
-
177  "params" : [
-
178  {
-
179  "error" : "badSyntax",
-
180  "error_code" : 1,
-
181  "error_message" : "Syntax error."
-
182  }
-
183  ]
-
184  })"},
-
185  {"account_channels: too many arguments.",
-
186  __LINE__,
-
187  {"account_channels",
-
188  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
189  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
190  "current",
-
191  "extra"},
-
192  RPCCallTestData::no_exception,
-
193  R"({
-
194  "method" : "account_channels",
-
195  "params" : [
-
196  {
-
197  "error" : "badSyntax",
-
198  "error_code" : 1,
-
199  "error_message" : "Syntax error."
-
200  }
-
201  ]
-
202  })"},
-
203  {"account_channels: invalid accountID.",
-
204  __LINE__,
-
205  {
-
206  "account_channels",
-
207  "", // Note: very few values are detected as bad!
-
208  },
-
209  RPCCallTestData::no_exception,
-
210  R"({
-
211  "method" : "account_channels",
-
212  "params" : [
-
213  {
-
214  "error" : "actMalformed",
-
215  "error_code" : 35,
-
216  "error_message" : "Account malformed."
-
217  }
-
218  ]
-
219  })"},
-
220 
-
221  // account_currencies
-
222  // ----------------------------------------------------------
-
223  {"account_currencies: minimal 1.",
-
224  __LINE__,
-
225  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
226  RPCCallTestData::no_exception,
-
227  R"({
-
228  "method" : "account_currencies",
-
229  "params" : [
-
230  {
-
231  "api_version" : %MAX_API_VER%,
-
232  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
233  }
-
234  ]
-
235  })"},
-
236  {"account_currencies: minimal 2.",
-
237  __LINE__,
-
238  {"account_currencies", "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"},
-
239  RPCCallTestData::no_exception,
-
240  R"({
-
241  "method" : "account_currencies",
-
242  "params" : [
-
243  {
-
244  "api_version" : %MAX_API_VER%,
-
245  "account" : "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"
-
246  }
-
247  ]
-
248  })"},
-
249  {"account_currencies: ledger index.",
-
250  __LINE__,
-
251  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "42"},
-
252  RPCCallTestData::no_exception,
-
253  R"({
-
254  "method" : "account_currencies",
-
255  "params" : [
-
256  {
-
257  "api_version" : %MAX_API_VER%,
-
258  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
259  "ledger_index" : 42
-
260  }
-
261  ]
-
262  })"},
-
263  {"account_currencies: validated ledger.",
-
264  __LINE__,
-
265  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
266  RPCCallTestData::no_exception,
-
267  R"({
-
268  "method" : "account_currencies",
-
269  "params" : [
-
270  {
-
271  "api_version" : %MAX_API_VER%,
-
272  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
273  "ledger_index" : "validated"
-
274  }
-
275  ]
-
276  })"},
-
277  {"account_currencies: current ledger.",
-
278  __LINE__,
-
279  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "current"},
-
280  RPCCallTestData::no_exception,
-
281  R"({
-
282  "method" : "account_currencies",
-
283  "params" : [
-
284  {
-
285  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
286  "api_version" : %MAX_API_VER%,
-
287  "ledger_index" : "current"
-
288  }
-
289  ]
-
290  })"},
-
291  {"account_currencies: too few arguments.",
-
292  __LINE__,
-
293  {
-
294  "account_currencies",
-
295  },
-
296  RPCCallTestData::no_exception,
-
297  R"({
-
298  "method" : "account_currencies",
-
299  "params" : [
-
300  {
-
301  "error" : "badSyntax",
-
302  "error_code" : 1,
-
303  "error_message" : "Syntax error."
-
304  }
-
305  ]
-
306  })"},
-
307  {"account_currencies: too many arguments.",
-
308  __LINE__,
-
309  {"account_currencies",
-
310  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
311  "current",
-
312  "spare1",
-
313  "spare2"},
-
314  RPCCallTestData::no_exception,
-
315  R"({
-
316  "method" : "account_currencies",
-
317  "params" : [
-
318  {
-
319  "error" : "badSyntax",
-
320  "error_code" : 1,
-
321  "error_message" : "Syntax error."
-
322  }
-
323  ]
-
324  })"},
-
325  {"account_currencies: invalid second argument.",
-
326  __LINE__,
-
327  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "yup"},
-
328  RPCCallTestData::no_exception,
-
329  R"({
-
330  "method" : "account_currencies",
-
331  "params" : [
-
332  {
-
333  "api_version" : %MAX_API_VER%,
-
334  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
335  "ledger_index" : 0
-
336  }
-
337  ]
-
338  })"},
-
339  {
-
340  "account_currencies: invalid accountID.",
-
341  __LINE__,
-
342  {
-
343  "account_currencies",
-
344  "", // Note: very few values are detected as bad!
-
345  },
-
346  RPCCallTestData::no_exception,
-
347  R"({
-
348  "method" : "account_currencies",
-
349  "params" : [
-
350  {
-
351  "error" : "actMalformed",
-
352  "error_code" : 35,
-
353  "error_message" : "Account malformed."
-
354  }
-
355  ]
-
356  })",
-
357  },
-
358 
-
359  // account_info
-
360  // ----------------------------------------------------------------
-
361  {"account_info: minimal.",
-
362  __LINE__,
-
363  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
364  RPCCallTestData::no_exception,
-
365  R"({
-
366  "method" : "account_info",
-
367  "params" : [
-
368  {
-
369  "api_version" : %MAX_API_VER%,
-
370  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
371  }
-
372  ]
-
373  })"},
-
374  {"account_info: with numeric ledger index.",
-
375  __LINE__,
-
376  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
-
377  RPCCallTestData::no_exception,
-
378  R"({
-
379  "method" : "account_info",
-
380  "params" : [
-
381  {
-
382  "api_version" : %MAX_API_VER%,
-
383  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
384  "ledger_index" : 77777
-
385  }
-
386  ]
-
387  })"},
-
388  {"account_info: with text ledger index.",
-
389  __LINE__,
-
390  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
-
391  RPCCallTestData::no_exception,
-
392  R"({
-
393  "method" : "account_info",
-
394  "params" : [
-
395  {
-
396  "api_version" : %MAX_API_VER%,
-
397  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
398  "ledger_index" : "closed"
-
399  }
-
400  ]
-
401  })"},
-
402  {"account_info: with ledger hash.",
-
403  __LINE__,
-
404  {"account_info",
-
405  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
406  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
407  RPCCallTestData::no_exception,
-
408  R"({
-
409  "method" : "account_info",
-
410  "params" : [
-
411  {
-
412  "api_version" : %MAX_API_VER%,
-
413  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
414  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
415  }
-
416  ]
-
417  })"},
-
418  {"account_info: with ledger index.",
-
419  __LINE__,
-
420  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
421  RPCCallTestData::no_exception,
-
422  R"({
-
423  "method" : "account_info",
-
424  "params" : [
-
425  {
-
426  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
427  "api_version" : %MAX_API_VER%,
-
428  "ledger_index" : "validated"
-
429  }
-
430  ]
-
431  })"},
-
432  {"account_info: too few arguments.",
-
433  __LINE__,
-
434  {
-
435  "account_info",
-
436  },
-
437  RPCCallTestData::no_exception,
-
438  R"({
-
439  "method" : "account_info",
-
440  "params" : [
-
441  {
-
442  "error" : "badSyntax",
-
443  "error_code" : 1,
-
444  "error_message" : "Syntax error."
-
445  }
-
446  ]
-
447  })"},
-
448  {"account_info: too many arguments.",
-
449  __LINE__,
-
450  {"account_info",
-
451  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
452  "current",
-
453  "extra1",
-
454  "extra2"},
-
455  RPCCallTestData::no_exception,
-
456  R"({
-
457  "method" : "account_info",
-
458  "params" : [
-
459  {
-
460  "error" : "badSyntax",
-
461  "error_code" : 1,
-
462  "error_message" : "Syntax error."
-
463  }
-
464  ]
-
465  })"},
-
466  {
-
467  "account_info: invalid accountID.",
-
468  __LINE__,
-
469  {
-
470  "account_info",
-
471  "", // Note: very few values are detected as bad!
-
472  },
-
473  RPCCallTestData::no_exception,
-
474  R"({
-
475  "method" : "account_info",
-
476  "params" : [
-
477  {
-
478  "error" : "actMalformed",
-
479  "error_code" : 35,
-
480  "error_message" : "Account malformed."
-
481  }
-
482  ]
-
483  })",
-
484  },
-
485 
-
486  // account_lines
-
487  // ---------------------------------------------------------------
-
488  {"account_lines: minimal.",
-
489  __LINE__,
-
490  {"account_lines", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
491  RPCCallTestData::no_exception,
-
492  R"({
-
493  "method" : "account_lines",
-
494  "params" : [
-
495  {
-
496  "api_version" : %MAX_API_VER%,
-
497  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
498  }
-
499  ]
-
500  })"},
-
501  {"account_lines: peer.",
-
502  __LINE__,
-
503  {"account_lines",
-
504  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
505  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
-
506  RPCCallTestData::no_exception,
-
507  R"({
-
508  "method" : "account_lines",
-
509  "params" : [
-
510  {
-
511  "api_version" : %MAX_API_VER%,
-
512  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
513  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
514  }
-
515  ]
-
516  })"},
-
517  {"account_lines: peer and numeric ledger index.",
-
518  __LINE__,
-
519  {"account_lines",
-
520  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
521  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
522  "888888888"},
-
523  RPCCallTestData::no_exception,
-
524  R"({
-
525  "method" : "account_lines",
-
526  "params" : [
-
527  {
-
528  "api_version" : %MAX_API_VER%,
-
529  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
530  "ledger_index" : 888888888,
-
531  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
532  }
-
533  ]
-
534  })"},
-
535  {"account_lines: peer and text ledger index.",
-
536  __LINE__,
-
537  {"account_lines",
-
538  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
539  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
540  "closed"},
-
541  RPCCallTestData::no_exception,
-
542  R"({
-
543  "method" : "account_lines",
-
544  "params" : [
-
545  {
-
546  "api_version" : %MAX_API_VER%,
-
547  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
548  "ledger_index" : "closed",
-
549  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
550  }
-
551  ]
-
552  })"},
-
553  {"account_lines: peer and ledger hash.",
-
554  __LINE__,
-
555  {"account_lines",
-
556  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
557  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
558  "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000"},
-
559  RPCCallTestData::no_exception,
-
560  R"({
-
561  "method" : "account_lines",
-
562  "params" : [
-
563  {
-
564  "api_version" : %MAX_API_VER%,
-
565  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
566  "ledger_hash" : "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000",
-
567  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
568  }
-
569  ]
-
570  })"},
-
571  {"account_lines: too few arguments.",
-
572  __LINE__,
-
573  {
-
574  "account_lines",
-
575  },
-
576  RPCCallTestData::no_exception,
-
577  R"({
-
578  "method" : "account_lines",
-
579  "params" : [
-
580  {
-
581  "error" : "badSyntax",
-
582  "error_code" : 1,
-
583  "error_message" : "Syntax error."
-
584  }
-
585  ]
-
586  })"},
-
587  {// Note: I believe this _ought_ to be detected as too many arguments.
-
588  "account_lines: four arguments.",
-
589  __LINE__,
-
590  {"account_lines",
-
591  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
592  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
593  "12345678",
-
594  "current"},
-
595  RPCCallTestData::no_exception,
-
596  R"({
-
597  "method" : "account_lines",
-
598  "params" : [
-
599  {
-
600  "api_version" : %MAX_API_VER%,
-
601  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
602  "ledger_index" : 12345678,
-
603  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
604  }
-
605  ]
-
606  })"},
-
607  {// Note: I believe this _ought_ to be detected as too many arguments.
-
608  "account_lines: five arguments.",
-
609  __LINE__,
-
610  {"account_lines",
-
611  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
612  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
613  "12345678",
-
614  "current",
-
615  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
616  RPCCallTestData::no_exception,
-
617  R"({
-
618  "method" : "account_lines",
-
619  "params" : [
-
620  {
-
621  "api_version" : %MAX_API_VER%,
-
622  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
623  "ledger_index" : 12345678,
-
624  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
625  }
-
626  ]
-
627  })"},
-
628  {"account_lines: too many arguments.",
-
629  __LINE__,
-
630  {"account_lines",
-
631  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
632  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
633  "12345678",
-
634  "current",
-
635  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
636  "validated"},
-
637  RPCCallTestData::no_exception,
-
638  R"({
-
639  "method" : "account_lines",
-
640  "params" : [
-
641  {
-
642  "error" : "badSyntax",
-
643  "error_code" : 1,
-
644  "error_message" : "Syntax error."
-
645  }
-
646  ]
-
647  })"},
-
648  {
-
649  "account_lines: first invalid accountID.",
-
650  __LINE__,
-
651  {
-
652  "account_lines",
-
653  "", // Note: very few values are detected as bad!
-
654  },
-
655  RPCCallTestData::no_exception,
-
656  R"({
-
657  "method" : "account_lines",
-
658  "params" : [
-
659  {
-
660  "error" : "actMalformed",
-
661  "error_code" : 35,
-
662  "error_message" : "Account malformed."
-
663  }
-
664  ]
-
665  })",
-
666  },
-
667  {
-
668  "account_lines: second invalid accountID.",
-
669  __LINE__,
-
670  {
-
671  "account_lines",
-
672  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
673  "" // Note: very few values are detected as bad!
-
674  },
-
675  RPCCallTestData::no_exception,
-
676  R"({
-
677  "method" : "account_lines",
-
678  "params" : [
-
679  {
-
680  "api_version" : %MAX_API_VER%,
-
681  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
682  }
-
683  ]
-
684  })",
-
685  },
-
686  {
-
687  "account_lines: invalid ledger selector.",
-
688  __LINE__,
-
689  {"account_lines",
-
690  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
691  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
692  "not_a_ledger"},
-
693  RPCCallTestData::no_exception,
-
694  R"({
-
695  "method" : "account_lines",
-
696  "params" : [
-
697  {
-
698  "api_version" : %MAX_API_VER%,
-
699  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
700  "ledger_index" : 0,
-
701  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
702  }
-
703  ]
-
704  })",
-
705  },
-
706 
-
707  // account_objects
-
708  // -------------------------------------------------------------
-
709  {"account_objects: minimal.",
-
710  __LINE__,
-
711  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
712  RPCCallTestData::no_exception,
-
713  R"({
-
714  "method" : "account_objects",
-
715  "params" : [
-
716  {
-
717  "api_version" : %MAX_API_VER%,
-
718  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
719  }
-
720  ]
-
721  })"},
-
722  {"account_objects: with numeric ledger index.",
-
723  __LINE__,
-
724  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
-
725  RPCCallTestData::no_exception,
-
726  R"({
-
727  "method" : "account_objects",
-
728  "params" : [
-
729  {
-
730  "api_version" : %MAX_API_VER%,
-
731  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
732  "ledger_index" : 77777
-
733  }
-
734  ]
-
735  })"},
-
736  {"account_objects: with text ledger index.",
-
737  __LINE__,
-
738  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
-
739  RPCCallTestData::no_exception,
-
740  R"({
-
741  "method" : "account_objects",
-
742  "params" : [
-
743  {
-
744  "api_version" : %MAX_API_VER%,
-
745  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
746  "ledger_index" : "closed"
-
747  }
-
748  ]
-
749  })"},
-
750  {"account_objects: with ledger hash.",
-
751  __LINE__,
-
752  {"account_objects",
-
753  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
754  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
755  RPCCallTestData::no_exception,
-
756  R"({
-
757  "method" : "account_objects",
-
758  "params" : [
-
759  {
-
760  "api_version" : %MAX_API_VER%,
-
761  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
762  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
763  }
-
764  ]
-
765  })"},
-
766  {"account_objects: with ledger index.",
-
767  __LINE__,
-
768  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
769  RPCCallTestData::no_exception,
-
770  R"({
-
771  "method" : "account_objects",
-
772  "params" : [
-
773  {
-
774  "api_version" : %MAX_API_VER%,
-
775  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
776  "ledger_index" : "validated"
-
777  }
-
778  ]
-
779  })"},
-
780  {"account_objects: too few arguments.",
-
781  __LINE__,
-
782  {
-
783  "account_objects",
-
784  },
-
785  RPCCallTestData::no_exception,
-
786  R"({
-
787  "method" : "account_objects",
-
788  "params" : [
-
789  {
-
790  "error" : "badSyntax",
-
791  "error_code" : 1,
-
792  "error_message" : "Syntax error."
-
793  }
-
794  ]
-
795  })"},
-
796  {// Note: I believe this _ought_ to be detected as too many arguments.
-
797  "account_objects: four arguments.",
-
798  __LINE__,
-
799  {
-
800  "account_objects",
-
801  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
802  "current",
-
803  "extra1",
-
804  "extra2",
-
805  },
-
806  RPCCallTestData::no_exception,
-
807  R"({
-
808  "method" : "account_objects",
-
809  "params" : [
-
810  {
-
811  "api_version" : %MAX_API_VER%,
-
812  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
813  }
-
814  ]
-
815  })"},
-
816  {// Note: I believe this _ought_ to be detected as too many arguments.
-
817  "account_objects: five arguments.",
-
818  __LINE__,
-
819  {
-
820  "account_objects",
-
821  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
822  "current",
-
823  "extra1",
-
824  "extra2",
-
825  "extra3",
-
826  },
-
827  RPCCallTestData::no_exception,
-
828  R"({
-
829  "method" : "account_objects",
-
830  "params" : [
-
831  {
-
832  "api_version" : %MAX_API_VER%,
-
833  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
834  }
-
835  ]
-
836  })"},
-
837  {"account_objects: too many arguments.",
-
838  __LINE__,
-
839  {
-
840  "account_objects",
-
841  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
842  "current",
-
843  "extra1",
-
844  "extra2",
-
845  "extra3",
-
846  "extra4",
-
847  },
-
848  RPCCallTestData::no_exception,
-
849  R"({
-
850  "method" : "account_objects",
-
851  "params" : [
-
852  {
-
853  "error" : "badSyntax",
-
854  "error_code" : 1,
-
855  "error_message" : "Syntax error."
-
856  }
-
857  ]
-
858  })"},
-
859  {
-
860  "account_objects: invalid accountID.",
-
861  __LINE__,
-
862  {
-
863  "account_objects",
-
864  "", // Note: very few values are detected as bad!
-
865  },
-
866  RPCCallTestData::no_exception,
-
867  R"({
-
868  "method" : "account_objects",
-
869  "params" : [
-
870  {
-
871  "error" : "actMalformed",
-
872  "error_code" : 35,
-
873  "error_message" : "Account malformed."
-
874  }
-
875  ]
-
876  })",
-
877  },
-
878  {
-
879  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
880  // cannot currently occur because jvParseLedger() always returns true.
-
881  "account_objects: invalid ledger selection 1.",
-
882  __LINE__,
-
883  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
884  RPCCallTestData::no_exception,
-
885  R"({
-
886  "method" : "account_objects",
-
887  "params" : [
-
888  {
-
889  "api_version" : %MAX_API_VER%,
-
890  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
891  "ledger_index" : 0
-
892  }
-
893  ]
-
894  })",
-
895  },
-
896  {
-
897  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
898  // cannot currently occur because jvParseLedger() always returns true.
-
899  "account_objects: invalid ledger selection 2.",
-
900  __LINE__,
-
901  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
902  RPCCallTestData::no_exception,
-
903  R"({
-
904  "method" : "account_objects",
-
905  "params" : [
-
906  {
-
907  "api_version" : %MAX_API_VER%,
-
908  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
909  "ledger_index" : 0
-
910  }
-
911  ]
-
912  })",
-
913  },
-
914 
-
915  // account_offers
-
916  // --------------------------------------------------------------
-
917  {"account_offers: minimal.",
-
918  __LINE__,
-
919  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
920  RPCCallTestData::no_exception,
-
921  R"({
-
922  "method" : "account_offers",
-
923  "params" : [
-
924  {
-
925  "api_version" : %MAX_API_VER%,
-
926  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
927  }
-
928  ]
-
929  })"},
-
930  {"account_offers: with numeric ledger index.",
-
931  __LINE__,
-
932  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
-
933  RPCCallTestData::no_exception,
-
934  R"({
-
935  "method" : "account_offers",
-
936  "params" : [
-
937  {
-
938  "api_version" : %MAX_API_VER%,
-
939  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
940  "ledger_index" : 987654321
-
941  }
-
942  ]
-
943  })"},
-
944  {"account_offers: with text ledger index.",
-
945  __LINE__,
-
946  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
947  RPCCallTestData::no_exception,
-
948  R"({
-
949  "method" : "account_offers",
-
950  "params" : [
-
951  {
-
952  "api_version" : %MAX_API_VER%,
-
953  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
954  "ledger_index" : "validated"
-
955  }
-
956  ]
-
957  })"},
-
958  {"account_offers: with ledger hash.",
-
959  __LINE__,
-
960  {"account_offers",
-
961  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
962  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
963  RPCCallTestData::no_exception,
-
964  R"({
-
965  "method" : "account_offers",
-
966  "params" : [
-
967  {
-
968  "api_version" : %MAX_API_VER%,
-
969  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
970  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
971  }
-
972  ]
-
973  })"},
-
974  {"account_offers: with ledger index.",
-
975  __LINE__,
-
976  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
977  RPCCallTestData::no_exception,
-
978  R"({
-
979  "method" : "account_offers",
-
980  "params" : [
-
981  {
-
982  "api_version" : %MAX_API_VER%,
-
983  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
984  "ledger_index" : "validated"
-
985  }
-
986  ]
-
987  })"},
-
988  {"account_offers: too few arguments.",
-
989  __LINE__,
-
990  {
-
991  "account_offers",
-
992  },
-
993  RPCCallTestData::no_exception,
-
994  R"({
-
995  "method" : "account_offers",
-
996  "params" : [
-
997  {
-
998  "error" : "badSyntax",
-
999  "error_code" : 1,
-
1000  "error_message" : "Syntax error."
-
1001  }
-
1002  ]
-
1003  })"},
-
1004  {// Note: I believe this _ought_ to be detected as too many arguments.
-
1005  "account_offers: four arguments.",
-
1006  __LINE__,
-
1007  {"account_offers",
-
1008  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1009  "current",
-
1010  "extra"},
-
1011  RPCCallTestData::no_exception,
-
1012  R"({
-
1013  "method" : "account_offers",
-
1014  "params" : [
-
1015  {
-
1016  "api_version" : %MAX_API_VER%,
-
1017  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1018  }
-
1019  ]
-
1020  })"},
-
1021  {"account_offers: too many arguments.",
-
1022  __LINE__,
-
1023  {
-
1024  "account_offers",
-
1025  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1026  "current",
-
1027  "extra1",
-
1028  "extra2",
-
1029  "extra3",
-
1030  },
-
1031  RPCCallTestData::no_exception,
-
1032  R"({
-
1033  "method" : "account_offers",
-
1034  "params" : [
-
1035  {
-
1036  "error" : "badSyntax",
-
1037  "error_code" : 1,
-
1038  "error_message" : "Syntax error."
-
1039  }
-
1040  ]
-
1041  })"},
-
1042  {
-
1043  "account_offers: invalid accountID.",
-
1044  __LINE__,
-
1045  {
-
1046  "account_offers",
-
1047  "", // Note: very few values are detected as bad!
-
1048  },
-
1049  RPCCallTestData::no_exception,
-
1050  R"({
-
1051  "method" : "account_offers",
-
1052  "params" : [
-
1053  {
-
1054  "error" : "actMalformed",
-
1055  "error_code" : 35,
-
1056  "error_message" : "Account malformed."
-
1057  }
-
1058  ]
-
1059  })",
-
1060  },
-
1061  {
-
1062  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
1063  // cannot currently occur because jvParseLedger() always returns true.
-
1064  "account_offers: invalid ledger selection 1.",
-
1065  __LINE__,
-
1066  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
1067  RPCCallTestData::no_exception,
-
1068  R"({
-
1069  "method" : "account_offers",
-
1070  "params" : [
-
1071  {
-
1072  "api_version" : %MAX_API_VER%,
-
1073  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1074  "ledger_index" : 0
-
1075  }
-
1076  ]
-
1077  })",
-
1078  },
-
1079  {
-
1080  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
1081  // cannot currently occur because jvParseLedger() always returns true.
-
1082  "account_offers: invalid ledger selection 2.",
-
1083  __LINE__,
-
1084  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
1085  RPCCallTestData::no_exception,
-
1086  R"({
-
1087  "method" : "account_offers",
-
1088  "params" : [
-
1089  {
-
1090  "api_version" : %MAX_API_VER%,
-
1091  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1092  "ledger_index" : 0
-
1093  }
-
1094  ]
-
1095  })",
-
1096  },
-
1097 
-
1098  // account_tx
-
1099  // ------------------------------------------------------------------
-
1100  {"account_tx: minimal.",
-
1101  __LINE__,
-
1102  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
1103  RPCCallTestData::no_exception,
-
1104  R"({
-
1105  "method" : "account_tx",
-
1106  "params" : [
-
1107  {
-
1108  "api_version" : %MAX_API_VER%,
-
1109  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1110  }
-
1111  ]
-
1112  })"},
-
1113  {"account_tx: ledger_index .",
-
1114  __LINE__,
-
1115  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "444"},
-
1116  RPCCallTestData::no_exception,
-
1117  R"({
-
1118  "method" : "account_tx",
-
1119  "params" : [
-
1120  {
-
1121  "api_version" : %MAX_API_VER%,
-
1122  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1123  "ledger_index" : 444
-
1124  }
-
1125  ]
-
1126  })"},
-
1127  {"account_tx: ledger_index plus trailing params.",
-
1128  __LINE__,
-
1129  {"account_tx",
-
1130  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1131  "707",
-
1132  "descending",
-
1133  "binary",
-
1134  "count"},
-
1135  RPCCallTestData::no_exception,
-
1136  R"({
-
1137  "method" : "account_tx",
-
1138  "params" : [
-
1139  {
-
1140  "api_version" : %MAX_API_VER%,
-
1141  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1142  "count" : true,
-
1143  "binary" : true,
-
1144  "descending" : true,
-
1145  "ledger_index" : 707
-
1146  }
-
1147  ]
-
1148  })"},
-
1149  {"account_tx: ledger_index_min and _max.",
-
1150  __LINE__,
-
1151  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "-1"},
-
1152  RPCCallTestData::no_exception,
-
1153  R"({
-
1154  "method" : "account_tx",
-
1155  "params" : [
-
1156  {
-
1157  "api_version" : %MAX_API_VER%,
-
1158  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1159  "ledger_index_max" : -1,
-
1160  "ledger_index_min" : -1
-
1161  }
-
1162  ]
-
1163  })"},
-
1164  {"account_tx: ledger_index_min and _max plus trailing params.",
-
1165  __LINE__,
-
1166  {"account_tx",
-
1167  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1168  "-1",
-
1169  "413",
-
1170  "binary",
-
1171  "count",
-
1172  "descending"},
-
1173  RPCCallTestData::no_exception,
-
1174  R"({
-
1175  "method" : "account_tx",
-
1176  "params" : [
-
1177  {
-
1178  "api_version" : %MAX_API_VER%,
-
1179  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1180  "binary" : true,
-
1181  "count" : true,
-
1182  "descending" : true,
-
1183  "ledger_index_max" : 413,
-
1184  "ledger_index_min" : -1
-
1185  }
-
1186  ]
-
1187  })"},
-
1188  {"account_tx: ledger_index_min and _max plus limit.",
-
1189  __LINE__,
-
1190  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "247", "-1", "300"},
-
1191  RPCCallTestData::no_exception,
-
1192  R"({
-
1193  "method" : "account_tx",
-
1194  "params" : [
-
1195  {
-
1196  "api_version" : %MAX_API_VER%,
-
1197  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1198  "ledger_index_max" : -1,
-
1199  "ledger_index_min" : 247,
-
1200  "limit" : 300
-
1201  }
-
1202  ]
-
1203  })"},
-
1204  {"account_tx: ledger_index_min and _max, limit, trailing args.",
-
1205  __LINE__,
-
1206  {"account_tx",
-
1207  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1208  "247",
-
1209  "-1",
-
1210  "300",
-
1211  "count",
-
1212  "descending",
-
1213  "binary"},
-
1214  RPCCallTestData::no_exception,
-
1215  R"({
-
1216  "method" : "account_tx",
-
1217  "params" : [
-
1218  {
-
1219  "api_version" : %MAX_API_VER%,
-
1220  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1221  "binary" : true,
-
1222  "count" : true,
-
1223  "descending" : true,
-
1224  "ledger_index_max" : -1,
-
1225  "ledger_index_min" : 247,
-
1226  "limit" : 300
-
1227  }
-
1228  ]
-
1229  })"},
-
1230  {"account_tx: ledger_index_min and _max plus limit and offset.",
-
1231  __LINE__,
-
1232  {"account_tx",
-
1233  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1234  "589",
-
1235  "590",
-
1236  "67",
-
1237  "45"},
-
1238  RPCCallTestData::no_exception,
-
1239  R"({
-
1240  "method" : "account_tx",
-
1241  "params" : [
-
1242  {
-
1243  "api_version" : %MAX_API_VER%,
-
1244  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1245  "ledger_index_max" : 590,
-
1246  "ledger_index_min" : 589,
-
1247  "limit" : 67,
-
1248  "offset" : 45
-
1249  }
-
1250  ]
-
1251  })"},
-
1252  {"account_tx: ledger_index_min and _max, limit, offset, trailing.",
-
1253  __LINE__,
-
1254  {"account_tx",
-
1255  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1256  "589",
-
1257  "590",
-
1258  "67",
-
1259  "45",
-
1260  "descending",
-
1261  "count"},
-
1262  RPCCallTestData::no_exception,
-
1263  R"({
-
1264  "method" : "account_tx",
-
1265  "params" : [
-
1266  {
-
1267  "api_version" : %MAX_API_VER%,
-
1268  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1269  "count" : true,
-
1270  "descending" : true,
-
1271  "ledger_index_max" : 590,
-
1272  "ledger_index_min" : 589,
-
1273  "limit" : 67,
-
1274  "offset" : 45
-
1275  }
-
1276  ]
-
1277  })"},
-
1278  {"account_tx: too few arguments.",
-
1279  __LINE__,
-
1280  {
-
1281  "account_tx",
-
1282  },
-
1283  RPCCallTestData::no_exception,
-
1284  R"({
-
1285  "method" : "account_tx",
-
1286  "params" : [
-
1287  {
-
1288  "error" : "badSyntax",
-
1289  "error_code" : 1,
-
1290  "error_message" : "Syntax error."
-
1291  }
-
1292  ]
-
1293  })"},
-
1294  {"account_tx: too many arguments.",
-
1295  __LINE__,
-
1296  {"account_tx",
-
1297  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1298  "589",
-
1299  "590",
-
1300  "67",
-
1301  "45",
-
1302  "extra",
-
1303  "descending",
-
1304  "count",
-
1305  "binary"},
-
1306  RPCCallTestData::no_exception,
-
1307  R"({
-
1308  "method" : "account_tx",
-
1309  "params" : [
-
1310  {
-
1311  "error" : "badSyntax",
-
1312  "error_code" : 1,
-
1313  "error_message" : "Syntax error."
-
1314  }
-
1315  ]
-
1316  })"},
-
1317  {
-
1318  "account_tx: invalid accountID.",
-
1319  __LINE__,
-
1320  {"account_tx", "rHb9CJAWyB4rj9!VRWn96DkukG4bwdtyTh"},
-
1321  RPCCallTestData::no_exception,
-
1322  R"({
-
1323  "method" : "account_tx",
-
1324  "params" : [
-
1325  {
-
1326  "error" : "actMalformed",
-
1327  "error_code" : 35,
-
1328  "error_message" : "Account malformed."
-
1329  }
-
1330  ]
-
1331  })",
-
1332  },
-
1333  {
-
1334  // Note: not currently detected as bad input.
-
1335  "account_tx: invalid ledger.",
-
1336  __LINE__,
-
1337  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-478.7"},
-
1338  RPCCallTestData::no_exception,
-
1339  R"({
-
1340  "method" : "account_tx",
-
1341  "params" : [
-
1342  {
-
1343  "api_version" : %MAX_API_VER%,
-
1344  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1345  "ledger_index" : 0
-
1346  }
-
1347  ]
-
1348  })",
-
1349  },
-
1350  {
-
1351  "account_tx: max less than min.",
-
1352  __LINE__,
-
1353  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"},
-
1354  RPCCallTestData::no_exception,
-
1355  RPC::apiMaximumSupportedVersion == 1 ?
-
1356  R"({
-
1357  "method" : "account_tx",
-
1358  "params" : [
-
1359  {
-
1360  "error" : "lgrIdxsInvalid",
-
1361  "error_code" : 55,
-
1362  "error_message" : "Ledger indexes invalid."
-
1363  }
-
1364  ]
-
1365  })"
-
1366  :
-
1367  R"({
-
1368  "method" : "account_tx",
-
1369  "params" : [
-
1370  {
-
1371  "error" : "notSynced",
-
1372  "error_code" : 55,
-
1373  "error_message" : "Not synced to the network."
-
1374  }
-
1375  ]
-
1376  })",
-
1377  },
-
1378  {
-
1379  // Note: this really shouldn't throw, but does at the moment.
-
1380  "account_tx: non-integer min.",
-
1381  __LINE__,
-
1382  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Binary", "-1"},
-
1383  RPCCallTestData::bad_cast,
-
1384  R"()",
-
1385  },
-
1386  {
-
1387  // Note: this really shouldn't throw, but does at the moment.
-
1388  "account_tx: non-integer max.",
-
1389  __LINE__,
-
1390  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "counts"},
-
1391  RPCCallTestData::bad_cast,
-
1392  R"()",
-
1393  },
-
1394  {
-
1395  // Note: this really shouldn't throw, but does at the moment.
-
1396  "account_tx: non-integer offset.",
-
1397  __LINE__,
-
1398  {"account_tx",
-
1399  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1400  "-1",
+
24 #include <test/jtx/utility.h>
+
25 
+
26 #include <boost/algorithm/string.hpp>
+
27 #include <initializer_list>
+
28 #include <vector>
+
29 
+
30 namespace ripple {
+
31 namespace test {
+
32 
+
33 struct RPCCallTestData
+
34 {
+
35  char const* const description;
+
36  int const line;
+
37  // List of passed arguments.
+
38  std::vector<char const*> const args;
+
39 
+
40  // If it throws, what does it throw?
+
41  enum Exception { no_exception = 0, bad_cast };
+
42  Exception const throwsWhat;
+
43 
+
44  // Expected JSON response.
+
45  char const* const exp;
+
46 
+
47  RPCCallTestData(
+
48  char const* description_,
+
49  int line_,
+
50  std::initializer_list<char const*> const& args_,
+
51  Exception throwsWhat_,
+
52  char const* exp_)
+
53  : description(description_)
+
54  , line(line_)
+
55  , args(args_)
+
56  , throwsWhat(throwsWhat_)
+
57  , exp(exp_)
+
58  {
+
59  }
+
60 
+
61  RPCCallTestData() = delete;
+
62  RPCCallTestData(RPCCallTestData const&) = delete;
+
63  RPCCallTestData(RPCCallTestData&&) = delete;
+
64  RPCCallTestData&
+
65  operator=(RPCCallTestData const&) = delete;
+
66  RPCCallTestData&
+
67  operator=(RPCCallTestData&&) = delete;
+
68 };
+
69 
+
70 static RPCCallTestData const rpcCallTestArray[] = {
+
71  // account_channels
+
72  // ------------------------------------------------------------
+
73  {"account_channels: minimal.",
+
74  __LINE__,
+
75  {"account_channels", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
76  RPCCallTestData::no_exception,
+
77  R"({
+
78  "method" : "account_channels",
+
79  "params" : [
+
80  {
+
81  "api_version" : %MAX_API_VER%,
+
82  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
83  }
+
84  ]
+
85  })"},
+
86  {"account_channels: account and ledger hash.",
+
87  __LINE__,
+
88  {"account_channels",
+
89  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
90  "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"},
+
91  RPCCallTestData::no_exception,
+
92  R"({
+
93  "method" : "account_channels",
+
94  "params" : [
+
95  {
+
96  "api_version" : %MAX_API_VER%,
+
97  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
98  "destination_account" : "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF"
+
99  }
+
100  ]
+
101  })"},
+
102  {"account_channels: account and ledger index.",
+
103  __LINE__,
+
104  {"account_channels",
+
105  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
106  "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"},
+
107  RPCCallTestData::no_exception,
+
108  R"({
+
109  "method" : "account_channels",
+
110  "params" : [
+
111  {
+
112  "api_version" : %MAX_API_VER%,
+
113  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
114  "destination_account" : "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7"
+
115  }
+
116  ]
+
117  })"},
+
118  {"account_channels: two accounts.",
+
119  __LINE__,
+
120  {"account_channels",
+
121  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
122  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
+
123  RPCCallTestData::no_exception,
+
124  R"({
+
125  "method" : "account_channels",
+
126  "params" : [
+
127  {
+
128  "api_version" : %MAX_API_VER%,
+
129  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
130  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
131  }
+
132  ]
+
133  })"},
+
134  {"account_channels: two accounts and ledger hash.",
+
135  __LINE__,
+
136  {"account_channels",
+
137  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
138  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
139  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
140  RPCCallTestData::no_exception,
+
141  R"({
+
142  "method" : "account_channels",
+
143  "params" : [
+
144  {
+
145  "api_version" : %MAX_API_VER%,
+
146  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
147  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
148  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
+
149  }
+
150  ]
+
151  })"},
+
152  {"account_channels: two accounts and ledger index.",
+
153  __LINE__,
+
154  {"account_channels",
+
155  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
156  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
157  "90210"},
+
158  RPCCallTestData::no_exception,
+
159  R"({
+
160  "method" : "account_channels",
+
161  "params" : [
+
162  {
+
163  "api_version" : %MAX_API_VER%,
+
164  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
165  "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
166  "ledger_index" : 90210
+
167  }
+
168  ]
+
169  })"},
+
170  {"account_channels: too few arguments.",
+
171  __LINE__,
+
172  {
+
173  "account_channels",
+
174  },
+
175  RPCCallTestData::no_exception,
+
176  R"({
+
177  "method" : "account_channels",
+
178  "params" : [
+
179  {
+
180  "error" : "badSyntax",
+
181  "error_code" : 1,
+
182  "error_message" : "Syntax error."
+
183  }
+
184  ]
+
185  })"},
+
186  {"account_channels: too many arguments.",
+
187  __LINE__,
+
188  {"account_channels",
+
189  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
190  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
191  "current",
+
192  "extra"},
+
193  RPCCallTestData::no_exception,
+
194  R"({
+
195  "method" : "account_channels",
+
196  "params" : [
+
197  {
+
198  "error" : "badSyntax",
+
199  "error_code" : 1,
+
200  "error_message" : "Syntax error."
+
201  }
+
202  ]
+
203  })"},
+
204  {"account_channels: invalid accountID.",
+
205  __LINE__,
+
206  {
+
207  "account_channels",
+
208  "", // Note: very few values are detected as bad!
+
209  },
+
210  RPCCallTestData::no_exception,
+
211  R"({
+
212  "method" : "account_channels",
+
213  "params" : [
+
214  {
+
215  "error" : "actMalformed",
+
216  "error_code" : 35,
+
217  "error_message" : "Account malformed."
+
218  }
+
219  ]
+
220  })"},
+
221 
+
222  // account_currencies
+
223  // ----------------------------------------------------------
+
224  {"account_currencies: minimal 1.",
+
225  __LINE__,
+
226  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
227  RPCCallTestData::no_exception,
+
228  R"({
+
229  "method" : "account_currencies",
+
230  "params" : [
+
231  {
+
232  "api_version" : %MAX_API_VER%,
+
233  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
234  }
+
235  ]
+
236  })"},
+
237  {"account_currencies: minimal 2.",
+
238  __LINE__,
+
239  {"account_currencies", "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"},
+
240  RPCCallTestData::no_exception,
+
241  R"({
+
242  "method" : "account_currencies",
+
243  "params" : [
+
244  {
+
245  "api_version" : %MAX_API_VER%,
+
246  "account" : "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr"
+
247  }
+
248  ]
+
249  })"},
+
250  {"account_currencies: ledger index.",
+
251  __LINE__,
+
252  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "42"},
+
253  RPCCallTestData::no_exception,
+
254  R"({
+
255  "method" : "account_currencies",
+
256  "params" : [
+
257  {
+
258  "api_version" : %MAX_API_VER%,
+
259  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
260  "ledger_index" : 42
+
261  }
+
262  ]
+
263  })"},
+
264  {"account_currencies: validated ledger.",
+
265  __LINE__,
+
266  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
267  RPCCallTestData::no_exception,
+
268  R"({
+
269  "method" : "account_currencies",
+
270  "params" : [
+
271  {
+
272  "api_version" : %MAX_API_VER%,
+
273  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
274  "ledger_index" : "validated"
+
275  }
+
276  ]
+
277  })"},
+
278  {"account_currencies: current ledger.",
+
279  __LINE__,
+
280  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "current"},
+
281  RPCCallTestData::no_exception,
+
282  R"({
+
283  "method" : "account_currencies",
+
284  "params" : [
+
285  {
+
286  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
287  "api_version" : %MAX_API_VER%,
+
288  "ledger_index" : "current"
+
289  }
+
290  ]
+
291  })"},
+
292  {"account_currencies: too few arguments.",
+
293  __LINE__,
+
294  {
+
295  "account_currencies",
+
296  },
+
297  RPCCallTestData::no_exception,
+
298  R"({
+
299  "method" : "account_currencies",
+
300  "params" : [
+
301  {
+
302  "error" : "badSyntax",
+
303  "error_code" : 1,
+
304  "error_message" : "Syntax error."
+
305  }
+
306  ]
+
307  })"},
+
308  {"account_currencies: too many arguments.",
+
309  __LINE__,
+
310  {"account_currencies",
+
311  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
312  "current",
+
313  "spare1",
+
314  "spare2"},
+
315  RPCCallTestData::no_exception,
+
316  R"({
+
317  "method" : "account_currencies",
+
318  "params" : [
+
319  {
+
320  "error" : "badSyntax",
+
321  "error_code" : 1,
+
322  "error_message" : "Syntax error."
+
323  }
+
324  ]
+
325  })"},
+
326  {"account_currencies: invalid second argument.",
+
327  __LINE__,
+
328  {"account_currencies", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "yup"},
+
329  RPCCallTestData::no_exception,
+
330  R"({
+
331  "method" : "account_currencies",
+
332  "params" : [
+
333  {
+
334  "api_version" : %MAX_API_VER%,
+
335  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
336  "ledger_index" : 0
+
337  }
+
338  ]
+
339  })"},
+
340  {
+
341  "account_currencies: invalid accountID.",
+
342  __LINE__,
+
343  {
+
344  "account_currencies",
+
345  "", // Note: very few values are detected as bad!
+
346  },
+
347  RPCCallTestData::no_exception,
+
348  R"({
+
349  "method" : "account_currencies",
+
350  "params" : [
+
351  {
+
352  "error" : "actMalformed",
+
353  "error_code" : 35,
+
354  "error_message" : "Account malformed."
+
355  }
+
356  ]
+
357  })",
+
358  },
+
359 
+
360  // account_info
+
361  // ----------------------------------------------------------------
+
362  {"account_info: minimal.",
+
363  __LINE__,
+
364  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
365  RPCCallTestData::no_exception,
+
366  R"({
+
367  "method" : "account_info",
+
368  "params" : [
+
369  {
+
370  "api_version" : %MAX_API_VER%,
+
371  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
372  }
+
373  ]
+
374  })"},
+
375  {"account_info: with numeric ledger index.",
+
376  __LINE__,
+
377  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
+
378  RPCCallTestData::no_exception,
+
379  R"({
+
380  "method" : "account_info",
+
381  "params" : [
+
382  {
+
383  "api_version" : %MAX_API_VER%,
+
384  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
385  "ledger_index" : 77777
+
386  }
+
387  ]
+
388  })"},
+
389  {"account_info: with text ledger index.",
+
390  __LINE__,
+
391  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
+
392  RPCCallTestData::no_exception,
+
393  R"({
+
394  "method" : "account_info",
+
395  "params" : [
+
396  {
+
397  "api_version" : %MAX_API_VER%,
+
398  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
399  "ledger_index" : "closed"
+
400  }
+
401  ]
+
402  })"},
+
403  {"account_info: with ledger hash.",
+
404  __LINE__,
+
405  {"account_info",
+
406  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
407  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
408  RPCCallTestData::no_exception,
+
409  R"({
+
410  "method" : "account_info",
+
411  "params" : [
+
412  {
+
413  "api_version" : %MAX_API_VER%,
+
414  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
415  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
+
416  }
+
417  ]
+
418  })"},
+
419  {"account_info: with ledger index.",
+
420  __LINE__,
+
421  {"account_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
422  RPCCallTestData::no_exception,
+
423  R"({
+
424  "method" : "account_info",
+
425  "params" : [
+
426  {
+
427  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
428  "api_version" : %MAX_API_VER%,
+
429  "ledger_index" : "validated"
+
430  }
+
431  ]
+
432  })"},
+
433  {"account_info: too few arguments.",
+
434  __LINE__,
+
435  {
+
436  "account_info",
+
437  },
+
438  RPCCallTestData::no_exception,
+
439  R"({
+
440  "method" : "account_info",
+
441  "params" : [
+
442  {
+
443  "error" : "badSyntax",
+
444  "error_code" : 1,
+
445  "error_message" : "Syntax error."
+
446  }
+
447  ]
+
448  })"},
+
449  {"account_info: too many arguments.",
+
450  __LINE__,
+
451  {"account_info",
+
452  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
453  "current",
+
454  "extra1",
+
455  "extra2"},
+
456  RPCCallTestData::no_exception,
+
457  R"({
+
458  "method" : "account_info",
+
459  "params" : [
+
460  {
+
461  "error" : "badSyntax",
+
462  "error_code" : 1,
+
463  "error_message" : "Syntax error."
+
464  }
+
465  ]
+
466  })"},
+
467  {
+
468  "account_info: invalid accountID.",
+
469  __LINE__,
+
470  {
+
471  "account_info",
+
472  "", // Note: very few values are detected as bad!
+
473  },
+
474  RPCCallTestData::no_exception,
+
475  R"({
+
476  "method" : "account_info",
+
477  "params" : [
+
478  {
+
479  "error" : "actMalformed",
+
480  "error_code" : 35,
+
481  "error_message" : "Account malformed."
+
482  }
+
483  ]
+
484  })",
+
485  },
+
486 
+
487  // account_lines
+
488  // ---------------------------------------------------------------
+
489  {"account_lines: minimal.",
+
490  __LINE__,
+
491  {"account_lines", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
492  RPCCallTestData::no_exception,
+
493  R"({
+
494  "method" : "account_lines",
+
495  "params" : [
+
496  {
+
497  "api_version" : %MAX_API_VER%,
+
498  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
499  }
+
500  ]
+
501  })"},
+
502  {"account_lines: peer.",
+
503  __LINE__,
+
504  {"account_lines",
+
505  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
506  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
+
507  RPCCallTestData::no_exception,
+
508  R"({
+
509  "method" : "account_lines",
+
510  "params" : [
+
511  {
+
512  "api_version" : %MAX_API_VER%,
+
513  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
514  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
515  }
+
516  ]
+
517  })"},
+
518  {"account_lines: peer and numeric ledger index.",
+
519  __LINE__,
+
520  {"account_lines",
+
521  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
522  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
523  "888888888"},
+
524  RPCCallTestData::no_exception,
+
525  R"({
+
526  "method" : "account_lines",
+
527  "params" : [
+
528  {
+
529  "api_version" : %MAX_API_VER%,
+
530  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
531  "ledger_index" : 888888888,
+
532  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
533  }
+
534  ]
+
535  })"},
+
536  {"account_lines: peer and text ledger index.",
+
537  __LINE__,
+
538  {"account_lines",
+
539  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
540  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
541  "closed"},
+
542  RPCCallTestData::no_exception,
+
543  R"({
+
544  "method" : "account_lines",
+
545  "params" : [
+
546  {
+
547  "api_version" : %MAX_API_VER%,
+
548  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
549  "ledger_index" : "closed",
+
550  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
551  }
+
552  ]
+
553  })"},
+
554  {"account_lines: peer and ledger hash.",
+
555  __LINE__,
+
556  {"account_lines",
+
557  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
558  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
559  "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000"},
+
560  RPCCallTestData::no_exception,
+
561  R"({
+
562  "method" : "account_lines",
+
563  "params" : [
+
564  {
+
565  "api_version" : %MAX_API_VER%,
+
566  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
567  "ledger_hash" : "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000",
+
568  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
569  }
+
570  ]
+
571  })"},
+
572  {"account_lines: too few arguments.",
+
573  __LINE__,
+
574  {
+
575  "account_lines",
+
576  },
+
577  RPCCallTestData::no_exception,
+
578  R"({
+
579  "method" : "account_lines",
+
580  "params" : [
+
581  {
+
582  "error" : "badSyntax",
+
583  "error_code" : 1,
+
584  "error_message" : "Syntax error."
+
585  }
+
586  ]
+
587  })"},
+
588  {// Note: I believe this _ought_ to be detected as too many arguments.
+
589  "account_lines: four arguments.",
+
590  __LINE__,
+
591  {"account_lines",
+
592  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
593  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
594  "12345678",
+
595  "current"},
+
596  RPCCallTestData::no_exception,
+
597  R"({
+
598  "method" : "account_lines",
+
599  "params" : [
+
600  {
+
601  "api_version" : %MAX_API_VER%,
+
602  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
603  "ledger_index" : 12345678,
+
604  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
605  }
+
606  ]
+
607  })"},
+
608  {// Note: I believe this _ought_ to be detected as too many arguments.
+
609  "account_lines: five arguments.",
+
610  __LINE__,
+
611  {"account_lines",
+
612  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
613  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
614  "12345678",
+
615  "current",
+
616  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
617  RPCCallTestData::no_exception,
+
618  R"({
+
619  "method" : "account_lines",
+
620  "params" : [
+
621  {
+
622  "api_version" : %MAX_API_VER%,
+
623  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
624  "ledger_index" : 12345678,
+
625  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
626  }
+
627  ]
+
628  })"},
+
629  {"account_lines: too many arguments.",
+
630  __LINE__,
+
631  {"account_lines",
+
632  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
633  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
634  "12345678",
+
635  "current",
+
636  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
637  "validated"},
+
638  RPCCallTestData::no_exception,
+
639  R"({
+
640  "method" : "account_lines",
+
641  "params" : [
+
642  {
+
643  "error" : "badSyntax",
+
644  "error_code" : 1,
+
645  "error_message" : "Syntax error."
+
646  }
+
647  ]
+
648  })"},
+
649  {
+
650  "account_lines: first invalid accountID.",
+
651  __LINE__,
+
652  {
+
653  "account_lines",
+
654  "", // Note: very few values are detected as bad!
+
655  },
+
656  RPCCallTestData::no_exception,
+
657  R"({
+
658  "method" : "account_lines",
+
659  "params" : [
+
660  {
+
661  "error" : "actMalformed",
+
662  "error_code" : 35,
+
663  "error_message" : "Account malformed."
+
664  }
+
665  ]
+
666  })",
+
667  },
+
668  {
+
669  "account_lines: second invalid accountID.",
+
670  __LINE__,
+
671  {
+
672  "account_lines",
+
673  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
674  "" // Note: very few values are detected as bad!
+
675  },
+
676  RPCCallTestData::no_exception,
+
677  R"({
+
678  "method" : "account_lines",
+
679  "params" : [
+
680  {
+
681  "api_version" : %MAX_API_VER%,
+
682  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
683  }
+
684  ]
+
685  })",
+
686  },
+
687  {
+
688  "account_lines: invalid ledger selector.",
+
689  __LINE__,
+
690  {"account_lines",
+
691  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
692  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
693  "not_a_ledger"},
+
694  RPCCallTestData::no_exception,
+
695  R"({
+
696  "method" : "account_lines",
+
697  "params" : [
+
698  {
+
699  "api_version" : %MAX_API_VER%,
+
700  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
701  "ledger_index" : 0,
+
702  "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
703  }
+
704  ]
+
705  })",
+
706  },
+
707 
+
708  // account_objects
+
709  // -------------------------------------------------------------
+
710  {"account_objects: minimal.",
+
711  __LINE__,
+
712  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
713  RPCCallTestData::no_exception,
+
714  R"({
+
715  "method" : "account_objects",
+
716  "params" : [
+
717  {
+
718  "api_version" : %MAX_API_VER%,
+
719  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
720  }
+
721  ]
+
722  })"},
+
723  {"account_objects: with numeric ledger index.",
+
724  __LINE__,
+
725  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "77777"},
+
726  RPCCallTestData::no_exception,
+
727  R"({
+
728  "method" : "account_objects",
+
729  "params" : [
+
730  {
+
731  "api_version" : %MAX_API_VER%,
+
732  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
733  "ledger_index" : 77777
+
734  }
+
735  ]
+
736  })"},
+
737  {"account_objects: with text ledger index.",
+
738  __LINE__,
+
739  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "closed"},
+
740  RPCCallTestData::no_exception,
+
741  R"({
+
742  "method" : "account_objects",
+
743  "params" : [
+
744  {
+
745  "api_version" : %MAX_API_VER%,
+
746  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
747  "ledger_index" : "closed"
+
748  }
+
749  ]
+
750  })"},
+
751  {"account_objects: with ledger hash.",
+
752  __LINE__,
+
753  {"account_objects",
+
754  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
755  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
756  RPCCallTestData::no_exception,
+
757  R"({
+
758  "method" : "account_objects",
+
759  "params" : [
+
760  {
+
761  "api_version" : %MAX_API_VER%,
+
762  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
763  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
+
764  }
+
765  ]
+
766  })"},
+
767  {"account_objects: with ledger index.",
+
768  __LINE__,
+
769  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
770  RPCCallTestData::no_exception,
+
771  R"({
+
772  "method" : "account_objects",
+
773  "params" : [
+
774  {
+
775  "api_version" : %MAX_API_VER%,
+
776  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
777  "ledger_index" : "validated"
+
778  }
+
779  ]
+
780  })"},
+
781  {"account_objects: too few arguments.",
+
782  __LINE__,
+
783  {
+
784  "account_objects",
+
785  },
+
786  RPCCallTestData::no_exception,
+
787  R"({
+
788  "method" : "account_objects",
+
789  "params" : [
+
790  {
+
791  "error" : "badSyntax",
+
792  "error_code" : 1,
+
793  "error_message" : "Syntax error."
+
794  }
+
795  ]
+
796  })"},
+
797  {// Note: I believe this _ought_ to be detected as too many arguments.
+
798  "account_objects: four arguments.",
+
799  __LINE__,
+
800  {
+
801  "account_objects",
+
802  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
803  "current",
+
804  "extra1",
+
805  "extra2",
+
806  },
+
807  RPCCallTestData::no_exception,
+
808  R"({
+
809  "method" : "account_objects",
+
810  "params" : [
+
811  {
+
812  "api_version" : %MAX_API_VER%,
+
813  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
814  }
+
815  ]
+
816  })"},
+
817  {// Note: I believe this _ought_ to be detected as too many arguments.
+
818  "account_objects: five arguments.",
+
819  __LINE__,
+
820  {
+
821  "account_objects",
+
822  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
823  "current",
+
824  "extra1",
+
825  "extra2",
+
826  "extra3",
+
827  },
+
828  RPCCallTestData::no_exception,
+
829  R"({
+
830  "method" : "account_objects",
+
831  "params" : [
+
832  {
+
833  "api_version" : %MAX_API_VER%,
+
834  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
835  }
+
836  ]
+
837  })"},
+
838  {"account_objects: too many arguments.",
+
839  __LINE__,
+
840  {
+
841  "account_objects",
+
842  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
843  "current",
+
844  "extra1",
+
845  "extra2",
+
846  "extra3",
+
847  "extra4",
+
848  },
+
849  RPCCallTestData::no_exception,
+
850  R"({
+
851  "method" : "account_objects",
+
852  "params" : [
+
853  {
+
854  "error" : "badSyntax",
+
855  "error_code" : 1,
+
856  "error_message" : "Syntax error."
+
857  }
+
858  ]
+
859  })"},
+
860  {
+
861  "account_objects: invalid accountID.",
+
862  __LINE__,
+
863  {
+
864  "account_objects",
+
865  "", // Note: very few values are detected as bad!
+
866  },
+
867  RPCCallTestData::no_exception,
+
868  R"({
+
869  "method" : "account_objects",
+
870  "params" : [
+
871  {
+
872  "error" : "actMalformed",
+
873  "error_code" : 35,
+
874  "error_message" : "Account malformed."
+
875  }
+
876  ]
+
877  })",
+
878  },
+
879  {
+
880  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
881  // cannot currently occur because jvParseLedger() always returns true.
+
882  "account_objects: invalid ledger selection 1.",
+
883  __LINE__,
+
884  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
885  RPCCallTestData::no_exception,
+
886  R"({
+
887  "method" : "account_objects",
+
888  "params" : [
+
889  {
+
890  "api_version" : %MAX_API_VER%,
+
891  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
892  "ledger_index" : 0
+
893  }
+
894  ]
+
895  })",
+
896  },
+
897  {
+
898  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
899  // cannot currently occur because jvParseLedger() always returns true.
+
900  "account_objects: invalid ledger selection 2.",
+
901  __LINE__,
+
902  {"account_objects", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
903  RPCCallTestData::no_exception,
+
904  R"({
+
905  "method" : "account_objects",
+
906  "params" : [
+
907  {
+
908  "api_version" : %MAX_API_VER%,
+
909  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
910  "ledger_index" : 0
+
911  }
+
912  ]
+
913  })",
+
914  },
+
915 
+
916  // account_offers
+
917  // --------------------------------------------------------------
+
918  {"account_offers: minimal.",
+
919  __LINE__,
+
920  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
921  RPCCallTestData::no_exception,
+
922  R"({
+
923  "method" : "account_offers",
+
924  "params" : [
+
925  {
+
926  "api_version" : %MAX_API_VER%,
+
927  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
928  }
+
929  ]
+
930  })"},
+
931  {"account_offers: with numeric ledger index.",
+
932  __LINE__,
+
933  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
+
934  RPCCallTestData::no_exception,
+
935  R"({
+
936  "method" : "account_offers",
+
937  "params" : [
+
938  {
+
939  "api_version" : %MAX_API_VER%,
+
940  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
941  "ledger_index" : 987654321
+
942  }
+
943  ]
+
944  })"},
+
945  {"account_offers: with text ledger index.",
+
946  __LINE__,
+
947  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
948  RPCCallTestData::no_exception,
+
949  R"({
+
950  "method" : "account_offers",
+
951  "params" : [
+
952  {
+
953  "api_version" : %MAX_API_VER%,
+
954  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
955  "ledger_index" : "validated"
+
956  }
+
957  ]
+
958  })"},
+
959  {"account_offers: with ledger hash.",
+
960  __LINE__,
+
961  {"account_offers",
+
962  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
963  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
964  RPCCallTestData::no_exception,
+
965  R"({
+
966  "method" : "account_offers",
+
967  "params" : [
+
968  {
+
969  "api_version" : %MAX_API_VER%,
+
970  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
971  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
+
972  }
+
973  ]
+
974  })"},
+
975  {"account_offers: with ledger index.",
+
976  __LINE__,
+
977  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
978  RPCCallTestData::no_exception,
+
979  R"({
+
980  "method" : "account_offers",
+
981  "params" : [
+
982  {
+
983  "api_version" : %MAX_API_VER%,
+
984  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
985  "ledger_index" : "validated"
+
986  }
+
987  ]
+
988  })"},
+
989  {"account_offers: too few arguments.",
+
990  __LINE__,
+
991  {
+
992  "account_offers",
+
993  },
+
994  RPCCallTestData::no_exception,
+
995  R"({
+
996  "method" : "account_offers",
+
997  "params" : [
+
998  {
+
999  "error" : "badSyntax",
+
1000  "error_code" : 1,
+
1001  "error_message" : "Syntax error."
+
1002  }
+
1003  ]
+
1004  })"},
+
1005  {// Note: I believe this _ought_ to be detected as too many arguments.
+
1006  "account_offers: four arguments.",
+
1007  __LINE__,
+
1008  {"account_offers",
+
1009  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1010  "current",
+
1011  "extra"},
+
1012  RPCCallTestData::no_exception,
+
1013  R"({
+
1014  "method" : "account_offers",
+
1015  "params" : [
+
1016  {
+
1017  "api_version" : %MAX_API_VER%,
+
1018  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1019  }
+
1020  ]
+
1021  })"},
+
1022  {"account_offers: too many arguments.",
+
1023  __LINE__,
+
1024  {
+
1025  "account_offers",
+
1026  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1027  "current",
+
1028  "extra1",
+
1029  "extra2",
+
1030  "extra3",
+
1031  },
+
1032  RPCCallTestData::no_exception,
+
1033  R"({
+
1034  "method" : "account_offers",
+
1035  "params" : [
+
1036  {
+
1037  "error" : "badSyntax",
+
1038  "error_code" : 1,
+
1039  "error_message" : "Syntax error."
+
1040  }
+
1041  ]
+
1042  })"},
+
1043  {
+
1044  "account_offers: invalid accountID.",
+
1045  __LINE__,
+
1046  {
+
1047  "account_offers",
+
1048  "", // Note: very few values are detected as bad!
+
1049  },
+
1050  RPCCallTestData::no_exception,
+
1051  R"({
+
1052  "method" : "account_offers",
+
1053  "params" : [
+
1054  {
+
1055  "error" : "actMalformed",
+
1056  "error_code" : 35,
+
1057  "error_message" : "Account malformed."
+
1058  }
+
1059  ]
+
1060  })",
+
1061  },
+
1062  {
+
1063  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
1064  // cannot currently occur because jvParseLedger() always returns true.
+
1065  "account_offers: invalid ledger selection 1.",
+
1066  __LINE__,
+
1067  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
1068  RPCCallTestData::no_exception,
+
1069  R"({
+
1070  "method" : "account_offers",
+
1071  "params" : [
+
1072  {
+
1073  "api_version" : %MAX_API_VER%,
+
1074  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1075  "ledger_index" : 0
+
1076  }
+
1077  ]
+
1078  })",
+
1079  },
+
1080  {
+
1081  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
1082  // cannot currently occur because jvParseLedger() always returns true.
+
1083  "account_offers: invalid ledger selection 2.",
+
1084  __LINE__,
+
1085  {"account_offers", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
1086  RPCCallTestData::no_exception,
+
1087  R"({
+
1088  "method" : "account_offers",
+
1089  "params" : [
+
1090  {
+
1091  "api_version" : %MAX_API_VER%,
+
1092  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1093  "ledger_index" : 0
+
1094  }
+
1095  ]
+
1096  })",
+
1097  },
+
1098 
+
1099  // account_tx
+
1100  // ------------------------------------------------------------------
+
1101  {"account_tx: minimal.",
+
1102  __LINE__,
+
1103  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
1104  RPCCallTestData::no_exception,
+
1105  R"({
+
1106  "method" : "account_tx",
+
1107  "params" : [
+
1108  {
+
1109  "api_version" : %MAX_API_VER%,
+
1110  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1111  }
+
1112  ]
+
1113  })"},
+
1114  {"account_tx: ledger_index .",
+
1115  __LINE__,
+
1116  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "444"},
+
1117  RPCCallTestData::no_exception,
+
1118  R"({
+
1119  "method" : "account_tx",
+
1120  "params" : [
+
1121  {
+
1122  "api_version" : %MAX_API_VER%,
+
1123  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1124  "ledger_index" : 444
+
1125  }
+
1126  ]
+
1127  })"},
+
1128  {"account_tx: ledger_index plus trailing params.",
+
1129  __LINE__,
+
1130  {"account_tx",
+
1131  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1132  "707",
+
1133  "descending",
+
1134  "binary",
+
1135  "count"},
+
1136  RPCCallTestData::no_exception,
+
1137  R"({
+
1138  "method" : "account_tx",
+
1139  "params" : [
+
1140  {
+
1141  "api_version" : %MAX_API_VER%,
+
1142  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1143  "count" : true,
+
1144  "binary" : true,
+
1145  "descending" : true,
+
1146  "ledger_index" : 707
+
1147  }
+
1148  ]
+
1149  })"},
+
1150  {"account_tx: ledger_index_min and _max.",
+
1151  __LINE__,
+
1152  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "-1"},
+
1153  RPCCallTestData::no_exception,
+
1154  R"({
+
1155  "method" : "account_tx",
+
1156  "params" : [
+
1157  {
+
1158  "api_version" : %MAX_API_VER%,
+
1159  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1160  "ledger_index_max" : -1,
+
1161  "ledger_index_min" : -1
+
1162  }
+
1163  ]
+
1164  })"},
+
1165  {"account_tx: ledger_index_min and _max plus trailing params.",
+
1166  __LINE__,
+
1167  {"account_tx",
+
1168  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1169  "-1",
+
1170  "413",
+
1171  "binary",
+
1172  "count",
+
1173  "descending"},
+
1174  RPCCallTestData::no_exception,
+
1175  R"({
+
1176  "method" : "account_tx",
+
1177  "params" : [
+
1178  {
+
1179  "api_version" : %MAX_API_VER%,
+
1180  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1181  "binary" : true,
+
1182  "count" : true,
+
1183  "descending" : true,
+
1184  "ledger_index_max" : 413,
+
1185  "ledger_index_min" : -1
+
1186  }
+
1187  ]
+
1188  })"},
+
1189  {"account_tx: ledger_index_min and _max plus limit.",
+
1190  __LINE__,
+
1191  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "247", "-1", "300"},
+
1192  RPCCallTestData::no_exception,
+
1193  R"({
+
1194  "method" : "account_tx",
+
1195  "params" : [
+
1196  {
+
1197  "api_version" : %MAX_API_VER%,
+
1198  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1199  "ledger_index_max" : -1,
+
1200  "ledger_index_min" : 247,
+
1201  "limit" : 300
+
1202  }
+
1203  ]
+
1204  })"},
+
1205  {"account_tx: ledger_index_min and _max, limit, trailing args.",
+
1206  __LINE__,
+
1207  {"account_tx",
+
1208  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1209  "247",
+
1210  "-1",
+
1211  "300",
+
1212  "count",
+
1213  "descending",
+
1214  "binary"},
+
1215  RPCCallTestData::no_exception,
+
1216  R"({
+
1217  "method" : "account_tx",
+
1218  "params" : [
+
1219  {
+
1220  "api_version" : %MAX_API_VER%,
+
1221  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1222  "binary" : true,
+
1223  "count" : true,
+
1224  "descending" : true,
+
1225  "ledger_index_max" : -1,
+
1226  "ledger_index_min" : 247,
+
1227  "limit" : 300
+
1228  }
+
1229  ]
+
1230  })"},
+
1231  {"account_tx: ledger_index_min and _max plus limit and offset.",
+
1232  __LINE__,
+
1233  {"account_tx",
+
1234  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1235  "589",
+
1236  "590",
+
1237  "67",
+
1238  "45"},
+
1239  RPCCallTestData::no_exception,
+
1240  R"({
+
1241  "method" : "account_tx",
+
1242  "params" : [
+
1243  {
+
1244  "api_version" : %MAX_API_VER%,
+
1245  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1246  "ledger_index_max" : 590,
+
1247  "ledger_index_min" : 589,
+
1248  "limit" : 67,
+
1249  "offset" : 45
+
1250  }
+
1251  ]
+
1252  })"},
+
1253  {"account_tx: ledger_index_min and _max, limit, offset, trailing.",
+
1254  __LINE__,
+
1255  {"account_tx",
+
1256  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1257  "589",
+
1258  "590",
+
1259  "67",
+
1260  "45",
+
1261  "descending",
+
1262  "count"},
+
1263  RPCCallTestData::no_exception,
+
1264  R"({
+
1265  "method" : "account_tx",
+
1266  "params" : [
+
1267  {
+
1268  "api_version" : %MAX_API_VER%,
+
1269  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1270  "count" : true,
+
1271  "descending" : true,
+
1272  "ledger_index_max" : 590,
+
1273  "ledger_index_min" : 589,
+
1274  "limit" : 67,
+
1275  "offset" : 45
+
1276  }
+
1277  ]
+
1278  })"},
+
1279  {"account_tx: too few arguments.",
+
1280  __LINE__,
+
1281  {
+
1282  "account_tx",
+
1283  },
+
1284  RPCCallTestData::no_exception,
+
1285  R"({
+
1286  "method" : "account_tx",
+
1287  "params" : [
+
1288  {
+
1289  "error" : "badSyntax",
+
1290  "error_code" : 1,
+
1291  "error_message" : "Syntax error."
+
1292  }
+
1293  ]
+
1294  })"},
+
1295  {"account_tx: too many arguments.",
+
1296  __LINE__,
+
1297  {"account_tx",
+
1298  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1299  "589",
+
1300  "590",
+
1301  "67",
+
1302  "45",
+
1303  "extra",
+
1304  "descending",
+
1305  "count",
+
1306  "binary"},
+
1307  RPCCallTestData::no_exception,
+
1308  R"({
+
1309  "method" : "account_tx",
+
1310  "params" : [
+
1311  {
+
1312  "error" : "badSyntax",
+
1313  "error_code" : 1,
+
1314  "error_message" : "Syntax error."
+
1315  }
+
1316  ]
+
1317  })"},
+
1318  {
+
1319  "account_tx: invalid accountID.",
+
1320  __LINE__,
+
1321  {"account_tx", "rHb9CJAWyB4rj9!VRWn96DkukG4bwdtyTh"},
+
1322  RPCCallTestData::no_exception,
+
1323  R"({
+
1324  "method" : "account_tx",
+
1325  "params" : [
+
1326  {
+
1327  "error" : "actMalformed",
+
1328  "error_code" : 35,
+
1329  "error_message" : "Account malformed."
+
1330  }
+
1331  ]
+
1332  })",
+
1333  },
+
1334  {
+
1335  // Note: not currently detected as bad input.
+
1336  "account_tx: invalid ledger.",
+
1337  __LINE__,
+
1338  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-478.7"},
+
1339  RPCCallTestData::no_exception,
+
1340  R"({
+
1341  "method" : "account_tx",
+
1342  "params" : [
+
1343  {
+
1344  "api_version" : %MAX_API_VER%,
+
1345  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1346  "ledger_index" : 0
+
1347  }
+
1348  ]
+
1349  })",
+
1350  },
+
1351  {
+
1352  "account_tx: max less than min.",
+
1353  __LINE__,
+
1354  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"},
+
1355  RPCCallTestData::no_exception,
+
1356  RPC::apiMaximumSupportedVersion == 1 ?
+
1357  R"({
+
1358  "method" : "account_tx",
+
1359  "params" : [
+
1360  {
+
1361  "error" : "lgrIdxsInvalid",
+
1362  "error_code" : 55,
+
1363  "error_message" : "Ledger indexes invalid."
+
1364  }
+
1365  ]
+
1366  })"
+
1367  :
+
1368  R"({
+
1369  "method" : "account_tx",
+
1370  "params" : [
+
1371  {
+
1372  "error" : "notSynced",
+
1373  "error_code" : 55,
+
1374  "error_message" : "Not synced to the network."
+
1375  }
+
1376  ]
+
1377  })",
+
1378  },
+
1379  {
+
1380  // Note: this really shouldn't throw, but does at the moment.
+
1381  "account_tx: non-integer min.",
+
1382  __LINE__,
+
1383  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Binary", "-1"},
+
1384  RPCCallTestData::bad_cast,
+
1385  R"()",
+
1386  },
+
1387  {
+
1388  // Note: this really shouldn't throw, but does at the moment.
+
1389  "account_tx: non-integer max.",
+
1390  __LINE__,
+
1391  {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "counts"},
+
1392  RPCCallTestData::bad_cast,
+
1393  R"()",
+
1394  },
+
1395  {
+
1396  // Note: this really shouldn't throw, but does at the moment.
+
1397  "account_tx: non-integer offset.",
+
1398  __LINE__,
+
1399  {"account_tx",
+
1400  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1401  "-1",
-
1402  "decending"},
-
1403  RPCCallTestData::bad_cast,
-
1404  R"()",
-
1405  },
-
1406  {
-
1407  // Note: this really shouldn't throw, but does at the moment.
-
1408  "account_tx: non-integer limit.",
-
1409  __LINE__,
-
1410  {"account_tx",
-
1411  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1412  "-1",
+
1402  "-1",
+
1403  "decending"},
+
1404  RPCCallTestData::bad_cast,
+
1405  R"()",
+
1406  },
+
1407  {
+
1408  // Note: this really shouldn't throw, but does at the moment.
+
1409  "account_tx: non-integer limit.",
+
1410  __LINE__,
+
1411  {"account_tx",
+
1412  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1413  "-1",
-
1414  "300",
-
1415  "false"},
-
1416  RPCCallTestData::bad_cast,
-
1417  R"()",
-
1418  },
-
1419  {// Note: this really shouldn't throw, but does at the moment.
-
1420  "account_tx: RIPD-1570.",
-
1421  __LINE__,
-
1422  {"account_tx",
-
1423  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1424  "-1",
+
1414  "-1",
+
1415  "300",
+
1416  "false"},
+
1417  RPCCallTestData::bad_cast,
+
1418  R"()",
+
1419  },
+
1420  {// Note: this really shouldn't throw, but does at the moment.
+
1421  "account_tx: RIPD-1570.",
+
1422  __LINE__,
+
1423  {"account_tx",
+
1424  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
1425  "-1",
-
1426  "2",
-
1427  "false",
+
1426  "-1",
+
1427  "2",
1428  "false",
-
1429  "false"},
-
1430  RPCCallTestData::bad_cast,
-
1431  R"()"},
-
1432 
-
1433  // book_offers
-
1434  // -----------------------------------------------------------------
-
1435  {"book_offers: minimal no issuer.",
-
1436  __LINE__,
-
1437  {
-
1438  "book_offers",
-
1439  "USD",
-
1440  "EUR",
-
1441  },
-
1442  RPCCallTestData::no_exception,
-
1443  R"({
-
1444  "method" : "book_offers",
-
1445  "params" : [
-
1446  {
-
1447  "api_version" : %MAX_API_VER%,
-
1448  "taker_gets" : {
-
1449  "currency" : "EUR"
-
1450  },
-
1451  "taker_pays" : {
-
1452  "currency" : "USD"
-
1453  }
-
1454  }
-
1455  ]
-
1456  })"},
-
1457  {"book_offers: minimal with currency/issuer",
-
1458  __LINE__,
-
1459  {
-
1460  "book_offers",
-
1461  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1462  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1463  },
-
1464  RPCCallTestData::no_exception,
-
1465  R"({
-
1466  "method" : "book_offers",
-
1467  "params" : [
-
1468  {
-
1469  "api_version" : %MAX_API_VER%,
-
1470  "taker_gets" : {
-
1471  "currency" : "EUR",
-
1472  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1473  },
-
1474  "taker_pays" : {
-
1475  "currency" : "USD",
-
1476  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1477  }
-
1478  }
-
1479  ]
-
1480  })"},
-
1481  {// Note: documentation suggests that "issuer" is the wrong type.
-
1482  // Should it be "taker" instead?
-
1483  "book_offers: add issuer.",
-
1484  __LINE__,
-
1485  {"book_offers", "USD", "EUR", "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
-
1486  RPCCallTestData::no_exception,
-
1487  R"({
-
1488  "method" : "book_offers",
-
1489  "params" : [
-
1490  {
-
1491  "api_version" : %MAX_API_VER%,
-
1492  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1493  "taker_gets" : {
-
1494  "currency" : "EUR"
-
1495  },
-
1496  "taker_pays" : {
-
1497  "currency" : "USD"
-
1498  }
-
1499  }
-
1500  ]
-
1501  })"},
-
1502  {"book_offers: add issuer and numeric ledger index.",
-
1503  __LINE__,
-
1504  {"book_offers",
-
1505  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1506  "EUR",
-
1507  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1508  "666"},
-
1509  RPCCallTestData::no_exception,
-
1510  R"({
-
1511  "method" : "book_offers",
-
1512  "params" : [
-
1513  {
-
1514  "api_version" : %MAX_API_VER%,
-
1515  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1516  "ledger_index" : 666,
-
1517  "taker_gets" : {
-
1518  "currency" : "EUR"
-
1519  },
-
1520  "taker_pays" : {
-
1521  "currency" : "USD",
-
1522  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1523  }
-
1524  }
-
1525  ]
-
1526  })"},
-
1527  {"book_offers: add issuer and text ledger index.",
-
1528  __LINE__,
-
1529  {"book_offers",
-
1530  "USD",
-
1531  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1532  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1533  "current"},
-
1534  RPCCallTestData::no_exception,
-
1535  R"({
-
1536  "method" : "book_offers",
-
1537  "params" : [
-
1538  {
-
1539  "api_version" : %MAX_API_VER%,
-
1540  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1541  "ledger_index" : "current",
-
1542  "taker_gets" : {
-
1543  "currency" : "EUR",
-
1544  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1545  },
-
1546  "taker_pays" : {
-
1547  "currency" : "USD"
-
1548  }
-
1549  }
-
1550  ]
-
1551  })"},
-
1552  {"book_offers: add issuer and ledger hash.",
-
1553  __LINE__,
-
1554  {"book_offers",
-
1555  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1556  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1557  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1558  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
-
1559  RPCCallTestData::no_exception,
-
1560  R"({
-
1561  "method" : "book_offers",
-
1562  "params" : [
-
1563  {
-
1564  "api_version" : %MAX_API_VER%,
-
1565  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1566  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1567  "taker_gets" : {
-
1568  "currency" : "EUR",
-
1569  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1570  },
-
1571  "taker_pays" : {
-
1572  "currency" : "USD",
-
1573  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1574  }
-
1575  }
-
1576  ]
-
1577  })"},
-
1578  {"book_offers: issuer, ledger hash, and limit.",
-
1579  __LINE__,
-
1580  {
-
1581  "book_offers",
-
1582  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1583  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1584  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1585  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1586  "junk", // Note: indexing bug in parseBookOffers() requires junk
-
1587  // param.
-
1588  "200",
-
1589  },
-
1590  RPCCallTestData::no_exception,
-
1591  R"({
-
1592  "method" : "book_offers",
-
1593  "params" : [
-
1594  {
-
1595  "api_version" : %MAX_API_VER%,
-
1596  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1597  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1598  "limit" : 200,
-
1599  "proof" : true,
-
1600  "taker_gets" : {
-
1601  "currency" : "EUR",
-
1602  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1603  },
-
1604  "taker_pays" : {
-
1605  "currency" : "USD",
-
1606  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1607  }
-
1608  }
-
1609  ]
-
1610  })"},
-
1611  {// Note: parser supports "marker", but the docs don't cover it.
-
1612  "book_offers: issuer, ledger hash, limit, and marker.",
-
1613  __LINE__,
-
1614  {"book_offers",
-
1615  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1616  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1617  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1618  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1619  "junk", // Note: indexing bug in parseBookOffers() requires junk param.
-
1620  "200",
-
1621  "MyMarker"},
-
1622  RPCCallTestData::no_exception,
-
1623  R"({
-
1624  "method" : "book_offers",
-
1625  "params" : [
-
1626  {
-
1627  "api_version" : %MAX_API_VER%,
-
1628  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1629  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1630  "limit" : 200,
-
1631  "marker" : "MyMarker",
-
1632  "proof" : true,
-
1633  "taker_gets" : {
-
1634  "currency" : "EUR",
-
1635  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1636  },
-
1637  "taker_pays" : {
-
1638  "currency" : "USD",
-
1639  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
1640  }
-
1641  }
-
1642  ]
-
1643  })"},
-
1644  {"book_offers: too few arguments.",
-
1645  __LINE__,
-
1646  {
-
1647  "book_offers",
-
1648  },
-
1649  RPCCallTestData::no_exception,
-
1650  R"({
-
1651  "method" : "book_offers",
-
1652  "params" : [
-
1653  {
-
1654  "error" : "badSyntax",
-
1655  "error_code" : 1,
-
1656  "error_message" : "Syntax error."
-
1657  }
-
1658  ]
-
1659  })"},
-
1660  {"book_offers: too many arguments.",
-
1661  __LINE__,
-
1662  {"book_offers",
-
1663  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1664  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1665  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1666  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1667  "junk", // Note: indexing bug in parseBookOffers() requires junk param.
-
1668  "200",
-
1669  "MyMarker",
-
1670  "extra"},
-
1671  RPCCallTestData::no_exception,
-
1672  R"({
-
1673  "method" : "book_offers",
-
1674  "params" : [
-
1675  {
-
1676  "error" : "badSyntax",
-
1677  "error_code" : 1,
-
1678  "error_message" : "Syntax error."
-
1679  }
-
1680  ]
-
1681  })"},
-
1682 
-
1683  {"book_offers: taker pays no currency.",
-
1684  __LINE__,
-
1685  {
-
1686  "book_offers",
-
1687  "/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1688  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1689  },
-
1690  RPCCallTestData::no_exception,
-
1691  R"({
-
1692  "method" : "book_offers",
-
1693  "params" : [
-
1694  {
-
1695  "error" : "invalidParams",
-
1696  "error_code" : 31,
-
1697  "error_message" : "Invalid currency/issuer '/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'"
-
1698  }
-
1699  ]
-
1700  })"},
-
1701  {"book_offers: taker gets no currency.",
-
1702  __LINE__,
-
1703  {
-
1704  "book_offers",
-
1705  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1706  "/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1707  },
-
1708  RPCCallTestData::no_exception,
-
1709  R"({
-
1710  "method" : "book_offers",
-
1711  "params" : [
-
1712  {
-
1713  "error" : "invalidParams",
-
1714  "error_code" : 31,
-
1715  "error_message" : "Invalid currency/issuer '/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA'"
-
1716  }
-
1717  ]
-
1718  })"},
-
1719  {"book_offers: invalid issuer.",
-
1720  __LINE__,
-
1721  {"book_offers", "USD", "EUR", "not_a_valid_issuer"},
-
1722  RPCCallTestData::no_exception,
-
1723  R"({
-
1724  "method" : "book_offers",
-
1725  "params" : [
-
1726  {
-
1727  "api_version" : %MAX_API_VER%,
-
1728  "issuer" : "not_a_valid_issuer",
-
1729  "taker_gets" : {
-
1730  "currency" : "EUR"
-
1731  },
-
1732  "taker_pays" : {
-
1733  "currency" : "USD"
-
1734  }
-
1735  }
-
1736  ]
-
1737  })"},
-
1738  {"book_offers: invalid text ledger index.",
-
1739  __LINE__,
-
1740  {"book_offers",
-
1741  "USD",
-
1742  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1743  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1744  "not_a_ledger"},
-
1745  RPCCallTestData::no_exception,
-
1746  R"({
-
1747  "method" : "book_offers",
-
1748  "params" : [
-
1749  {
-
1750  "api_version" : %MAX_API_VER%,
-
1751  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1752  "ledger_index" : 0,
-
1753  "taker_gets" : {
-
1754  "currency" : "EUR",
-
1755  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
-
1756  },
-
1757  "taker_pays" : {
-
1758  "currency" : "USD"
-
1759  }
-
1760  }
-
1761  ]
-
1762  })"},
-
1763  {// Note: this really shouldn't throw, but does at the moment.
-
1764  "book_offers: non-numeric limit.",
-
1765  __LINE__,
-
1766  {
-
1767  "book_offers",
-
1768  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
1769  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1770  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
-
1771  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
1772  "junk", // Note: indexing bug in parseBookOffers() requires junk
-
1773  // param.
-
1774  "not_a_number",
-
1775  },
-
1776  RPCCallTestData::bad_cast,
-
1777  R"()"},
-
1778 
-
1779  // can_delete
-
1780  // ------------------------------------------------------------------
-
1781  {"can_delete: minimal.",
-
1782  __LINE__,
-
1783  {
-
1784  "can_delete",
-
1785  },
-
1786  RPCCallTestData::no_exception,
-
1787  R"({
-
1788  "method" : "can_delete",
-
1789  "params" : [
-
1790  {
-
1791  "api_version" : %MAX_API_VER%,
-
1792  }
-
1793  ]
-
1794  })"},
-
1795  {"can_delete: ledger index.",
-
1796  __LINE__,
-
1797  {
-
1798  "can_delete",
-
1799  "4294967295",
-
1800  },
-
1801  RPCCallTestData::no_exception,
-
1802  R"({
-
1803  "method" : "can_delete",
-
1804  "params" : [
-
1805  {
-
1806  "api_version" : %MAX_API_VER%,
-
1807  "can_delete" : 4294967295
-
1808  }
-
1809  ]
-
1810  })"},
-
1811  {"can_delete: ledger hash.",
-
1812  __LINE__,
-
1813  {
-
1814  "can_delete",
-
1815  "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
-
1816  },
-
1817  RPCCallTestData::no_exception,
-
1818  R"({
-
1819  "method" : "can_delete",
-
1820  "params" : [
-
1821  {
-
1822  "api_version" : %MAX_API_VER%,
-
1823  "can_delete" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210"
-
1824  }
-
1825  ]
-
1826  })"},
-
1827  {"can_delete: always.",
-
1828  __LINE__,
-
1829  {
-
1830  "can_delete",
-
1831  "always",
-
1832  },
-
1833  RPCCallTestData::no_exception,
-
1834  R"({
-
1835  "method" : "can_delete",
-
1836  "params" : [
-
1837  {
-
1838  "api_version" : %MAX_API_VER%,
-
1839  "can_delete" : "always"
-
1840  }
-
1841  ]
-
1842  })"},
-
1843  {"can_delete: never.",
-
1844  __LINE__,
-
1845  {
-
1846  "can_delete",
-
1847  "never",
-
1848  },
-
1849  RPCCallTestData::no_exception,
-
1850  R"({
-
1851  "method" : "can_delete",
-
1852  "params" : [
-
1853  {
-
1854  "api_version" : %MAX_API_VER%,
-
1855  "can_delete" : "never"
-
1856  }
-
1857  ]
-
1858  })"},
-
1859  {"can_delete: now.",
-
1860  __LINE__,
-
1861  {
-
1862  "can_delete",
-
1863  "now",
-
1864  },
-
1865  RPCCallTestData::no_exception,
-
1866  R"({
-
1867  "method" : "can_delete",
-
1868  "params" : [
-
1869  {
-
1870  "api_version" : %MAX_API_VER%,
-
1871  "can_delete" : "now"
-
1872  }
-
1873  ]
-
1874  })"},
-
1875  {"can_delete: too many arguments.",
-
1876  __LINE__,
-
1877  {"can_delete", "always", "never"},
-
1878  RPCCallTestData::no_exception,
-
1879  R"({
-
1880  "method" : "can_delete",
-
1881  "params" : [
-
1882  {
-
1883  "error" : "badSyntax",
-
1884  "error_code" : 1,
-
1885  "error_message" : "Syntax error."
-
1886  }
-
1887  ]
-
1888  })"},
-
1889  {"can_delete: invalid argument.",
-
1890  __LINE__,
-
1891  {"can_delete", "invalid"},
-
1892  RPCCallTestData::no_exception,
-
1893  R"({
-
1894  "method" : "can_delete",
-
1895  "params" : [
-
1896  {
-
1897  "api_version" : %MAX_API_VER%,
-
1898  "can_delete" : "invalid"
-
1899  }
-
1900  ]
-
1901  })"},
-
1902  {// Note: this should return an error but not throw.
-
1903  "can_delete: ledger index > 32 bits.",
-
1904  __LINE__,
-
1905  {
-
1906  "can_delete",
-
1907  "4294967296",
-
1908  },
-
1909  RPCCallTestData::bad_cast,
-
1910  R"()"},
-
1911  {// Note: this really shouldn't throw since it's a legitimate ledger hash.
-
1912  "can_delete: ledger hash with no alphas.",
-
1913  __LINE__,
-
1914  {
-
1915  "can_delete",
-
1916  "0123456701234567012345670123456701234567012345670123456701234567",
-
1917  },
-
1918  RPCCallTestData::bad_cast,
-
1919  R"()"},
-
1920 
-
1921  // channel_authorize
-
1922  // -----------------------------------------------------------
-
1923  {"channel_authorize: minimal.",
-
1924  __LINE__,
-
1925  {"channel_authorize",
-
1926  "secret_can_be_anything",
-
1927  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
1928  "18446744073709551615"},
-
1929  RPCCallTestData::no_exception,
-
1930  R"({
-
1931  "method" : "channel_authorize",
-
1932  "params" : [
-
1933  {
-
1934  "api_version" : %MAX_API_VER%,
-
1935  "amount" : "18446744073709551615",
-
1936  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
1937  "secret" : "secret_can_be_anything"
-
1938  }
-
1939  ]
-
1940  })"},
-
1941  {"channel_authorize: too few arguments.",
-
1942  __LINE__,
-
1943  {
-
1944  "channel_authorize",
-
1945  "secret_can_be_anything",
-
1946  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
1947  },
-
1948  RPCCallTestData::no_exception,
-
1949  R"({
-
1950  "method" : "channel_authorize",
-
1951  "params" : [
-
1952  {
-
1953  "error" : "badSyntax",
-
1954  "error_code" : 1,
-
1955  "error_message" : "Syntax error."
-
1956  }
-
1957  ]
-
1958  })"},
-
1959  {"channel_authorize: too many arguments.",
-
1960  __LINE__,
-
1961  {"channel_authorize",
-
1962  "secp256k1",
-
1963  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
1964  "2000",
-
1965  "whatever",
-
1966  "whenever"},
-
1967  RPCCallTestData::no_exception,
-
1968  R"({
-
1969  "method" : "channel_authorize",
-
1970  "params" : [
-
1971  {
-
1972  "error" : "badSyntax",
-
1973  "error_code" : 1,
-
1974  "error_message" : "Syntax error."
-
1975  }
-
1976  ]
-
1977  })"},
-
1978  {"channel_authorize: bad key type.",
-
1979  __LINE__,
-
1980  {"channel_authorize",
-
1981  "secp257k1",
-
1982  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
1983  "2000",
-
1984  "whatever"},
-
1985  RPCCallTestData::no_exception,
-
1986  R"({
-
1987  "method" : "channel_authorize",
-
1988  "params" : [
-
1989  {
-
1990  "error" : "badKeyType",
-
1991  "error_code" : 1,
-
1992  "error_message" : "Bad key type."
-
1993  }
-
1994  ]
-
1995  })"},
-
1996  {"channel_authorize: channel_id too short.",
-
1997  __LINE__,
-
1998  {"channel_authorize",
-
1999  "secret_can_be_anything",
-
2000  "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2001  "2000"},
-
2002  RPCCallTestData::no_exception,
-
2003  R"({
-
2004  "method" : "channel_authorize",
-
2005  "params" : [
-
2006  {
-
2007  "error" : "channelMalformed",
-
2008  "error_code" : 43,
-
2009  "error_message" : "Payment channel is malformed."
-
2010  }
-
2011  ]
-
2012  })"},
-
2013  {"channel_authorize: channel_id too long.",
-
2014  __LINE__,
-
2015  {"channel_authorize",
-
2016  "secret_can_be_anything",
-
2017  "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2018  "2000"},
-
2019  RPCCallTestData::no_exception,
-
2020  R"({
-
2021  "method" : "channel_authorize",
-
2022  "params" : [
-
2023  {
-
2024  "error" : "channelMalformed",
-
2025  "error_code" : 43,
-
2026  "error_message" : "Payment channel is malformed."
-
2027  }
-
2028  ]
-
2029  })"},
-
2030  {"channel_authorize: channel_id not hex.",
-
2031  __LINE__,
-
2032  {"channel_authorize",
-
2033  "secret_can_be_anything",
-
2034  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEZ",
-
2035  "2000"},
-
2036  RPCCallTestData::no_exception,
-
2037  R"({
-
2038  "method" : "channel_authorize",
-
2039  "params" : [
-
2040  {
-
2041  "error" : "channelMalformed",
-
2042  "error_code" : 43,
-
2043  "error_message" : "Payment channel is malformed."
-
2044  }
-
2045  ]
-
2046  })"},
-
2047  {"channel_authorize: negative amount.",
-
2048  __LINE__,
-
2049  {"channel_authorize",
-
2050  "secret_can_be_anything",
-
2051  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2052  "-1"},
-
2053  RPCCallTestData::no_exception,
-
2054  R"({
-
2055  "method" : "channel_authorize",
-
2056  "params" : [
-
2057  {
-
2058  "error" : "channelAmtMalformed",
-
2059  "error_code" : 44,
-
2060  "error_message" : "Payment channel amount is malformed."
-
2061  }
-
2062  ]
-
2063  })"},
-
2064  {"channel_authorize: amount > 64 bits.",
-
2065  __LINE__,
-
2066  {"channel_authorize",
-
2067  "secret_can_be_anything",
-
2068  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2069  "18446744073709551616"},
-
2070  RPCCallTestData::no_exception,
-
2071  R"({
-
2072  "method" : "channel_authorize",
-
2073  "params" : [
-
2074  {
-
2075  "error" : "channelAmtMalformed",
-
2076  "error_code" : 44,
-
2077  "error_message" : "Payment channel amount is malformed."
-
2078  }
-
2079  ]
-
2080  })"},
-
2081 
-
2082  // channel_verify
-
2083  // --------------------------------------------------------------
-
2084  {"channel_verify: public key.",
-
2085  __LINE__,
-
2086  {"channel_verify",
-
2087  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2088  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2089  "0",
-
2090  "DEADBEEF"},
-
2091  RPCCallTestData::no_exception,
-
2092  R"({
-
2093  "method" : "channel_verify",
-
2094  "params" : [
-
2095  {
-
2096  "api_version" : %MAX_API_VER%,
-
2097  "amount" : "0",
-
2098  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2099  "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2100  "signature" : "DEADBEEF"
-
2101  }
-
2102  ]
-
2103  })"},
-
2104  {"channel_verify: public key hex.",
-
2105  __LINE__,
-
2106  {"channel_verify",
-
2107  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
-
2108  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2109  "18446744073709551615",
-
2110  "DEADBEEF"},
-
2111  RPCCallTestData::no_exception,
-
2112  R"({
-
2113  "method" : "channel_verify",
-
2114  "params" : [
-
2115  {
-
2116  "api_version" : %MAX_API_VER%,
-
2117  "amount" : "18446744073709551615",
-
2118  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2119  "public_key" : "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
-
2120  "signature" : "DEADBEEF"
-
2121  }
-
2122  ]
-
2123  })"},
-
2124  {"channel_verify: too few arguments.",
-
2125  __LINE__,
-
2126  {"channel_verify",
-
2127  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2128  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
2129  RPCCallTestData::no_exception,
-
2130  R"({
-
2131  "method" : "channel_verify",
-
2132  "params" : [
-
2133  {
-
2134  "error" : "badSyntax",
-
2135  "error_code" : 1,
-
2136  "error_message" : "Syntax error."
-
2137  }
-
2138  ]
-
2139  })"},
-
2140  {"channel_verify: too many arguments.",
-
2141  __LINE__,
-
2142  {"channel_verify",
-
2143  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2144  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2145  "2000",
-
2146  "DEADBEEF",
-
2147  "Whatever"},
-
2148  RPCCallTestData::no_exception,
-
2149  R"({
-
2150  "method" : "channel_verify",
-
2151  "params" : [
-
2152  {
-
2153  "error" : "badSyntax",
-
2154  "error_code" : 1,
-
2155  "error_message" : "Syntax error."
-
2156  }
-
2157  ]
-
2158  })"},
-
2159  {"channel_verify: malformed public key.",
-
2160  __LINE__,
-
2161  {"channel_verify",
-
2162  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9GoV",
-
2163  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2164  "2000",
-
2165  "DEADBEEF"},
-
2166  RPCCallTestData::no_exception,
-
2167  R"({
-
2168  "method" : "channel_verify",
-
2169  "params" : [
-
2170  {
-
2171  "error" : "publicMalformed",
-
2172  "error_code" : 60,
-
2173  "error_message" : "Public key is malformed."
-
2174  }
-
2175  ]
-
2176  })"},
-
2177  {"channel_verify: malformed hex public key.",
-
2178  __LINE__,
-
2179  {"channel_verify",
-
2180  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F",
-
2181  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2182  "2000",
-
2183  "DEADBEEF"},
-
2184  RPCCallTestData::no_exception,
-
2185  R"({
-
2186  "method" : "channel_verify",
-
2187  "params" : [
-
2188  {
-
2189  "error" : "publicMalformed",
-
2190  "error_code" : 60,
-
2191  "error_message" : "Public key is malformed."
-
2192  }
-
2193  ]
-
2194  })"},
-
2195  {"channel_verify: invalid channel id.",
-
2196  __LINE__,
-
2197  {"channel_verify",
-
2198  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2199  "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2200  "2000",
-
2201  "DEADBEEF"},
-
2202  RPCCallTestData::no_exception,
-
2203  R"({
-
2204  "method" : "channel_verify",
-
2205  "params" : [
-
2206  {
-
2207  "error" : "channelMalformed",
-
2208  "error_code" : 43,
-
2209  "error_message" : "Payment channel is malformed."
-
2210  }
-
2211  ]
-
2212  })"},
-
2213  {"channel_verify: short channel id.",
-
2214  __LINE__,
-
2215  {"channel_verify",
-
2216  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2217  "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2218  "2000",
-
2219  "DEADBEEF"},
-
2220  RPCCallTestData::no_exception,
-
2221  R"({
-
2222  "method" : "channel_verify",
-
2223  "params" : [
-
2224  {
-
2225  "error" : "channelMalformed",
-
2226  "error_code" : 43,
-
2227  "error_message" : "Payment channel is malformed."
-
2228  }
-
2229  ]
-
2230  })"},
-
2231  {"channel_verify: amount too small.",
-
2232  __LINE__,
-
2233  {"channel_verify",
-
2234  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
-
2235  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2236  "-1",
-
2237  "DEADBEEF"},
-
2238  RPCCallTestData::no_exception,
-
2239  R"({
-
2240  "method" : "channel_verify",
-
2241  "params" : [
-
2242  {
-
2243  "error" : "channelAmtMalformed",
-
2244  "error_code" : 44,
-
2245  "error_message" : "Payment channel amount is malformed."
-
2246  }
-
2247  ]
-
2248  })"},
-
2249  {"channel_verify: amount too large.",
-
2250  __LINE__,
-
2251  {"channel_verify",
-
2252  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
-
2253  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2254  "18446744073709551616",
-
2255  "DEADBEEF"},
-
2256  RPCCallTestData::no_exception,
-
2257  R"({
-
2258  "method" : "channel_verify",
-
2259  "params" : [
-
2260  {
-
2261  "error" : "channelAmtMalformed",
-
2262  "error_code" : 44,
-
2263  "error_message" : "Payment channel amount is malformed."
-
2264  }
-
2265  ]
-
2266  })"},
-
2267  {"channel_verify: non-hex signature.",
-
2268  __LINE__,
-
2269  {"channel_verify",
-
2270  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2271  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2272  "40000000",
-
2273  "ThisIsNotHexadecimal"},
-
2274  RPCCallTestData::no_exception,
-
2275  R"({
-
2276  "method" : "channel_verify",
-
2277  "params" : [
-
2278  {
-
2279  "api_version" : %MAX_API_VER%,
-
2280  "amount" : "40000000",
-
2281  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
-
2282  "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
-
2283  "signature" : "ThisIsNotHexadecimal"
-
2284  }
-
2285  ]
-
2286  })"},
-
2287 
-
2288  // connect
-
2289  // ---------------------------------------------------------------------
-
2290  {"connect: minimal.",
-
2291  __LINE__,
-
2292  {
-
2293  "connect",
-
2294  "ThereIsNoCheckingOnTheIPFormat",
-
2295  },
-
2296  RPCCallTestData::no_exception,
-
2297  R"({
-
2298  "method" : "connect",
-
2299  "params" : [
-
2300  {
-
2301  "api_version" : %MAX_API_VER%,
-
2302  "ip" : "ThereIsNoCheckingOnTheIPFormat"
-
2303  }
-
2304  ]
-
2305  })"},
-
2306  {"connect: ip and port.",
-
2307  __LINE__,
-
2308  {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561"},
-
2309  RPCCallTestData::no_exception,
-
2310  R"({
-
2311  "method" : "connect",
-
2312  "params" : [
-
2313  {
-
2314  "api_version" : %MAX_API_VER%,
-
2315  "ip" : "ThereIsNoCheckingOnTheIPFormat",
-
2316  "port" : 6561
-
2317  }
-
2318  ]
-
2319  })"},
-
2320  {"connect: too few arguments.",
-
2321  __LINE__,
-
2322  {
-
2323  "connect",
-
2324  },
-
2325  RPCCallTestData::no_exception,
-
2326  R"({
-
2327  "method" : "connect",
-
2328  "params" : [
-
2329  {
-
2330  "error" : "badSyntax",
-
2331  "error_code" : 1,
-
2332  "error_message" : "Syntax error."
-
2333  }
-
2334  ]
-
2335  })"},
-
2336  {"connect: too many arguments.",
-
2337  __LINE__,
-
2338  {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561", "extra"},
-
2339  RPCCallTestData::no_exception,
-
2340  R"({
-
2341  "method" : "connect",
-
2342  "params" : [
-
2343  {
-
2344  "error" : "badSyntax",
-
2345  "error_code" : 1,
-
2346  "error_message" : "Syntax error."
-
2347  }
-
2348  ]
-
2349  })"},
-
2350  {// Note: this should return an error but not throw.
-
2351  "connect: port too small.",
-
2352  __LINE__,
-
2353  {
-
2354  "connect",
-
2355  "ThereIsNoCheckingOnTheIPFormat",
-
2356  "-1",
-
2357  },
-
2358  RPCCallTestData::bad_cast,
-
2359  R"()"},
-
2360  {// Note: this should return an error but not throw.
-
2361  "connect: port too large.",
-
2362  __LINE__,
-
2363  {
-
2364  "connect",
-
2365  "ThereIsNoCheckingOnTheIPFormat",
-
2366  "4294967296",
-
2367  },
-
2368  RPCCallTestData::bad_cast,
-
2369  R"()"},
-
2370 
-
2371  // consensus_info
-
2372  // --------------------------------------------------------------
-
2373  {"consensus_info: minimal.",
-
2374  __LINE__,
-
2375  {
-
2376  "consensus_info",
-
2377  },
-
2378  RPCCallTestData::no_exception,
-
2379  R"({
-
2380  "method" : "consensus_info",
-
2381  "params" : [
-
2382  {
-
2383  "api_version" : %MAX_API_VER%
-
2384  }
-
2385  ]
-
2386  })"},
-
2387  {"consensus_info: too many arguments.",
-
2388  __LINE__,
-
2389  {"consensus_info", "whatever"},
-
2390  RPCCallTestData::no_exception,
-
2391  R"({
-
2392  "method" : "consensus_info",
-
2393  "params" : [
-
2394  {
-
2395  "error" : "badSyntax",
-
2396  "error_code" : 1,
-
2397  "error_message" : "Syntax error."
-
2398  }
-
2399  ]
-
2400  })"},
-
2401 
-
2402  // deposit_authorized
-
2403  // ----------------------------------------------------------
-
2404  {"deposit_authorized: minimal.",
-
2405  __LINE__,
-
2406  {
-
2407  "deposit_authorized",
-
2408  "source_account_NotValidated",
-
2409  "destination_account_NotValidated",
-
2410  },
-
2411  RPCCallTestData::no_exception,
-
2412  R"({
-
2413  "method" : "deposit_authorized",
-
2414  "params" : [
-
2415  {
-
2416  "api_version" : %MAX_API_VER%,
-
2417  "destination_account" : "destination_account_NotValidated",
-
2418  "source_account" : "source_account_NotValidated"
-
2419  }
-
2420  ]
-
2421  })"},
-
2422  {"deposit_authorized: with text ledger index.",
-
2423  __LINE__,
-
2424  {"deposit_authorized",
-
2425  "source_account_NotValidated",
-
2426  "destination_account_NotValidated",
-
2427  "validated"},
-
2428  RPCCallTestData::no_exception,
-
2429  R"({
-
2430  "method" : "deposit_authorized",
-
2431  "params" : [
-
2432  {
-
2433  "api_version" : %MAX_API_VER%,
-
2434  "destination_account" : "destination_account_NotValidated",
-
2435  "ledger_index" : "validated",
-
2436  "source_account" : "source_account_NotValidated"
-
2437  }
-
2438  ]
-
2439  })"},
-
2440  {"deposit_authorized: with ledger index.",
-
2441  __LINE__,
-
2442  {"deposit_authorized",
-
2443  "source_account_NotValidated",
-
2444  "destination_account_NotValidated",
-
2445  "4294967295"},
-
2446  RPCCallTestData::no_exception,
-
2447  R"({
-
2448  "method" : "deposit_authorized",
-
2449  "params" : [
-
2450  {
-
2451  "api_version" : %MAX_API_VER%,
-
2452  "destination_account" : "destination_account_NotValidated",
-
2453  "ledger_index" : 4294967295,
-
2454  "source_account" : "source_account_NotValidated"
-
2455  }
-
2456  ]
-
2457  })"},
-
2458  {"deposit_authorized: with ledger hash.",
-
2459  __LINE__,
-
2460  {"deposit_authorized",
-
2461  "source_account_NotValidated",
-
2462  "destination_account_NotValidated",
-
2463  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
-
2464  RPCCallTestData::no_exception,
-
2465  R"({
-
2466  "method" : "deposit_authorized",
-
2467  "params" : [
-
2468  {
-
2469  "api_version" : %MAX_API_VER%,
-
2470  "destination_account" : "destination_account_NotValidated",
-
2471  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
2472  "source_account" : "source_account_NotValidated"
-
2473  }
-
2474  ]
-
2475  })"},
-
2476  {"deposit_authorized: too few arguments.",
-
2477  __LINE__,
-
2478  {
-
2479  "deposit_authorized",
-
2480  "source_account_NotValidated",
-
2481  },
-
2482  RPCCallTestData::no_exception,
-
2483  R"({
-
2484  "method" : "deposit_authorized",
-
2485  "params" : [
-
2486  {
-
2487  "error" : "badSyntax",
-
2488  "error_code" : 1,
-
2489  "error_message" : "Syntax error."
-
2490  }
-
2491  ]
-
2492  })"},
-
2493  {"deposit_authorized: too many arguments.",
-
2494  __LINE__,
-
2495  {"deposit_authorized",
-
2496  "source_account_NotValidated",
-
2497  "destination_account_NotValidated",
-
2498  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
-
2499  "spare"},
-
2500  RPCCallTestData::no_exception,
-
2501  R"({
-
2502  "method" : "deposit_authorized",
-
2503  "params" : [
-
2504  {
-
2505  "error" : "badSyntax",
-
2506  "error_code" : 1,
-
2507  "error_message" : "Syntax error."
-
2508  }
-
2509  ]
-
2510  })"},
-
2511  {"deposit_authorized: invalid ledger selection.",
-
2512  __LINE__,
-
2513  {
-
2514  "deposit_authorized",
-
2515  "source_account_NotValidated",
-
2516  "destination_account_NotValidated",
-
2517  "NotALedger",
-
2518  },
-
2519  RPCCallTestData::no_exception,
-
2520  R"({
-
2521  "method" : "deposit_authorized",
-
2522  "params" : [
-
2523  {
-
2524  "api_version" : %MAX_API_VER%,
-
2525  "destination_account" : "destination_account_NotValidated",
-
2526  "ledger_index" : 0,
-
2527  "source_account" : "source_account_NotValidated"
-
2528  }
-
2529  ]
-
2530  })"},
-
2531 
-
2532  // download_shard
-
2533  // --------------------------------------------------------------
-
2534  {"download_shard: minimal.",
-
2535  __LINE__,
-
2536  {
-
2537  "download_shard",
-
2538  "20",
-
2539  "url_NotValidated",
-
2540  },
-
2541  RPCCallTestData::no_exception,
-
2542  R"({
-
2543  "method" : "download_shard",
-
2544  "params" : [
-
2545  {
-
2546  "api_version" : %MAX_API_VER%,
-
2547  "shards" : [
-
2548  {
-
2549  "index" : 20,
-
2550  "url" : "url_NotValidated"
-
2551  }
-
2552  ]
-
2553  }
-
2554  ]
-
2555  })"},
-
2556  {"download_shard:",
-
2557  __LINE__,
-
2558  {
-
2559  "download_shard",
-
2560  "20",
-
2561  "url_NotValidated",
-
2562  },
-
2563  RPCCallTestData::no_exception,
-
2564  R"({
-
2565  "method" : "download_shard",
-
2566  "params" : [
-
2567  {
-
2568  "api_version" : %MAX_API_VER%,
-
2569  "shards" : [
-
2570  {
-
2571  "index" : 20,
-
2572  "url" : "url_NotValidated"
-
2573  }
-
2574  ]
-
2575  }
-
2576  ]
-
2577  })"},
-
2578  {"download_shard: many shards.",
-
2579  __LINE__,
-
2580  {
-
2581  "download_shard",
-
2582  "200000000",
-
2583  "url_NotValidated0",
-
2584  "199999999",
-
2585  "url_NotValidated1",
-
2586  "199999998",
-
2587  "url_NotValidated2",
-
2588  "199999997",
-
2589  "url_NotValidated3",
-
2590  },
-
2591  RPCCallTestData::no_exception,
-
2592  R"({
-
2593  "method" : "download_shard",
-
2594  "params" : [
-
2595  {
-
2596  "api_version" : %MAX_API_VER%,
-
2597  "shards" : [
-
2598  {
-
2599  "index" : 200000000,
-
2600  "url" : "url_NotValidated0"
-
2601  },
-
2602  {
-
2603  "index" : 199999999,
-
2604  "url" : "url_NotValidated1"
-
2605  },
-
2606  {
-
2607  "index" : 199999998,
-
2608  "url" : "url_NotValidated2"
-
2609  },
-
2610  {
-
2611  "index" : 199999997,
-
2612  "url" : "url_NotValidated3"
-
2613  }
-
2614  ]
-
2615  }
-
2616  ]
-
2617  })"},
-
2618  {"download_shard: many shards.",
-
2619  __LINE__,
-
2620  {
-
2621  "download_shard",
-
2622  "2000000",
-
2623  "url_NotValidated0",
-
2624  "2000001",
-
2625  "url_NotValidated1",
-
2626  "2000002",
-
2627  "url_NotValidated2",
-
2628  "2000003",
-
2629  "url_NotValidated3",
-
2630  "2000004",
-
2631  "url_NotValidated4",
-
2632  },
-
2633  RPCCallTestData::no_exception,
-
2634  R"({
-
2635  "method" : "download_shard",
-
2636  "params" : [
-
2637  {
-
2638  "api_version" : %MAX_API_VER%,
-
2639  "shards" : [
-
2640  {
-
2641  "index" : 2000000,
-
2642  "url" : "url_NotValidated0"
-
2643  },
-
2644  {
-
2645  "index" : 2000001,
-
2646  "url" : "url_NotValidated1"
-
2647  },
-
2648  {
-
2649  "index" : 2000002,
-
2650  "url" : "url_NotValidated2"
-
2651  },
-
2652  {
-
2653  "index" : 2000003,
-
2654  "url" : "url_NotValidated3"
-
2655  },
-
2656  {
-
2657  "index" : 2000004,
-
2658  "url" : "url_NotValidated4"
-
2659  }
-
2660  ]
-
2661  }
-
2662  ]
-
2663  })"},
-
2664  {"download_shard: too few arguments.",
-
2665  __LINE__,
-
2666  {"download_shard", "20"},
-
2667  RPCCallTestData::no_exception,
-
2668  R"({
-
2669  "method" : "download_shard",
-
2670  "params" : [
-
2671  {
-
2672  "error" : "badSyntax",
-
2673  "error_code" : 1,
-
2674  "error_message" : "Syntax error."
-
2675  }
-
2676  ]
-
2677  })"},
-
2678  {// Note: this should return an error but not throw.
-
2679  "download_shard: novalidate too few arguments.",
-
2680  __LINE__,
-
2681  {"download_shard", "novalidate", "20"},
-
2682  RPCCallTestData::bad_cast,
-
2683  R"()"},
-
2684  {"download_shard: novalidate at end.",
-
2685  __LINE__,
-
2686  {
-
2687  "download_shard",
-
2688  "20",
-
2689  "url_NotValidated",
-
2690  "novalidate",
-
2691  },
-
2692  RPCCallTestData::no_exception,
-
2693  R"({
-
2694  "method" : "download_shard",
-
2695  "params" : [
-
2696  {
-
2697  "api_version" : %MAX_API_VER%,
-
2698  "shards" : [
-
2699  {
-
2700  "index" : 20,
-
2701  "url" : "url_NotValidated"
-
2702  }
-
2703  ]
-
2704  }
-
2705  ]
-
2706  })"},
-
2707  {"download_shard: novalidate in middle.",
-
2708  __LINE__,
-
2709  {
-
2710  "download_shard",
-
2711  "20",
-
2712  "url_NotValidated20",
-
2713  "novalidate",
-
2714  "200",
-
2715  "url_NotValidated200",
-
2716  },
-
2717  RPCCallTestData::no_exception,
-
2718  R"({
-
2719  "method" : "download_shard",
-
2720  "params" : [
-
2721  {
-
2722  "error" : "invalidParams",
-
2723  "error_code" : 31,
-
2724  "error_message" : "Invalid parameters."
-
2725  }
-
2726  ]
-
2727  })"},
-
2728  {// Note: this should return an error but not throw.
-
2729  "download_shard: arguments swapped.",
-
2730  __LINE__,
-
2731  {
-
2732  "download_shard",
-
2733  "url_NotValidated",
-
2734  "20",
-
2735  },
-
2736  RPCCallTestData::bad_cast,
-
2737  R"()"},
-
2738  {"download_shard: index too small.",
-
2739  __LINE__,
-
2740  {
-
2741  "download_shard",
-
2742  "-1",
-
2743  "url_NotValidated",
-
2744  },
-
2745  RPCCallTestData::bad_cast,
-
2746  R"()"},
-
2747  {"download_shard: index too big.",
-
2748  __LINE__,
-
2749  {
-
2750  "download_shard",
-
2751  "4294967296",
-
2752  "url_NotValidated",
-
2753  },
-
2754  RPCCallTestData::bad_cast,
-
2755  R"()"},
-
2756 
-
2757  // feature
-
2758  // ---------------------------------------------------------------------
-
2759  {"feature: minimal.",
-
2760  __LINE__,
-
2761  {
-
2762  "feature",
-
2763  },
-
2764  RPCCallTestData::no_exception,
-
2765  R"({
-
2766  "method" : "feature",
-
2767  "params" : [
-
2768  {
-
2769  "api_version" : %MAX_API_VER%,
-
2770  }
-
2771  ]
-
2772  })"},
-
2773  {"feature: with name.",
-
2774  __LINE__,
-
2775  {"feature", "featureNameOrHexIsNotValidated"},
-
2776  RPCCallTestData::no_exception,
-
2777  R"({
-
2778  "method" : "feature",
-
2779  "params" : [
-
2780  {
-
2781  "api_version" : %MAX_API_VER%,
-
2782  "feature" : "featureNameOrHexIsNotValidated"
-
2783  }
-
2784  ]
-
2785  })"},
-
2786  {"feature: accept.",
-
2787  __LINE__,
-
2788  {"feature",
-
2789  "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA98"
-
2790  "76543210",
-
2791  "accept"},
-
2792  RPCCallTestData::no_exception,
-
2793  R"({
-
2794  "method" : "feature",
-
2795  "params" : [
-
2796  {
-
2797  "api_version" : %MAX_API_VER%,
-
2798  "feature" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
-
2799  "vetoed" : false
-
2800  }
-
2801  ]
-
2802  })"},
-
2803  {"feature: reject.",
-
2804  __LINE__,
-
2805  {"feature", "0", "reject"},
-
2806  RPCCallTestData::no_exception,
-
2807  R"({
-
2808  "method" : "feature",
-
2809  "params" : [
-
2810  {
-
2811  "api_version" : %MAX_API_VER%,
-
2812  "feature" : "0",
-
2813  "vetoed" : true
-
2814  }
-
2815  ]
-
2816  })"},
-
2817  {"feature: too many arguments.",
-
2818  __LINE__,
-
2819  {"feature", "featureNameOrHexIsNotValidated", "accept", "anotherArg"},
-
2820  RPCCallTestData::no_exception,
-
2821  R"({
-
2822  "method" : "feature",
-
2823  "params" : [
-
2824  {
-
2825  "error" : "badSyntax",
-
2826  "error_code" : 1,
-
2827  "error_message" : "Syntax error."
-
2828  }
-
2829  ]
-
2830  })"},
-
2831  {"feature: neither accept nor reject.",
-
2832  __LINE__,
-
2833  {
-
2834  "feature",
-
2835  "featureNameOrHexIsNotValidated",
-
2836  "veto",
-
2837  },
-
2838  RPCCallTestData::no_exception,
-
2839  R"({
-
2840  "method" : "feature",
-
2841  "params" : [
-
2842  {
-
2843  "error" : "invalidParams",
-
2844  "error_code" : 31,
-
2845  "error_message" : "Invalid parameters."
-
2846  }
-
2847  ]
-
2848  })"},
-
2849 
-
2850  // fetch_info
-
2851  // ------------------------------------------------------------------
-
2852  {"fetch_info: minimal.",
-
2853  __LINE__,
-
2854  {
-
2855  "fetch_info",
-
2856  },
-
2857  RPCCallTestData::no_exception,
-
2858  R"({
-
2859  "method" : "fetch_info",
-
2860  "params" : [
-
2861  {
-
2862  "api_version" : %MAX_API_VER%,
-
2863  }
-
2864  ]
-
2865  })"},
-
2866  {"fetch_info: clear.",
-
2867  __LINE__,
-
2868  {"fetch_info", "clear"},
-
2869  RPCCallTestData::no_exception,
-
2870  R"({
-
2871  "method" : "fetch_info",
-
2872  "params" : [
-
2873  {
-
2874  "api_version" : %MAX_API_VER%,
-
2875  "clear" : true
-
2876  }
-
2877  ]
-
2878  })"},
-
2879  {"fetch_info: too many arguments.",
-
2880  __LINE__,
-
2881  {"fetch_info", "clear", "other"},
-
2882  RPCCallTestData::no_exception,
-
2883  R"({
-
2884  "method" : "fetch_info",
-
2885  "params" : [
-
2886  {
-
2887  "error" : "badSyntax",
-
2888  "error_code" : 1,
-
2889  "error_message" : "Syntax error."
-
2890  }
-
2891  ]
-
2892  })"},
-
2893  {"fetch_info: other trailing argument.",
-
2894  __LINE__,
-
2895  {"fetch_info", "too"},
-
2896  RPCCallTestData::no_exception,
-
2897  R"({
-
2898  "method" : "fetch_info",
-
2899  "params" : [
-
2900  {
-
2901  "api_version" : %MAX_API_VER%,
-
2902  "too" : true
-
2903  }
-
2904  ]
-
2905  })"},
-
2906 
-
2907  // gateway_balances
-
2908  // ------------------------------------------------------------
-
2909  {"gateway_balances: minimal.",
-
2910  __LINE__,
-
2911  {"gateway_balances", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
2912  RPCCallTestData::no_exception,
-
2913  R"({
-
2914  "method" : "gateway_balances",
-
2915  "params" : [
-
2916  {
-
2917  "api_version" : %MAX_API_VER%,
-
2918  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2919  }
-
2920  ]
-
2921  })"},
-
2922  {"gateway_balances: with ledger index.",
-
2923  __LINE__,
-
2924  {"gateway_balances", "890765", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
2925  RPCCallTestData::no_exception,
-
2926  R"({
-
2927  "method" : "gateway_balances",
-
2928  "params" : [
-
2929  {
-
2930  "api_version" : %MAX_API_VER%,
-
2931  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2932  "ledger_index" : "890765"
-
2933  }
-
2934  ]
-
2935  })"},
-
2936  {"gateway_balances: with text ledger index.",
-
2937  __LINE__,
-
2938  {"gateway_balances", "current", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
2939  RPCCallTestData::no_exception,
-
2940  R"({
-
2941  "method" : "gateway_balances",
-
2942  "params" : [
-
2943  {
-
2944  "api_version" : %MAX_API_VER%,
-
2945  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2946  "ledger_index" : "current"
-
2947  }
-
2948  ]
-
2949  })"},
-
2950  {"gateway_balances: with 64 character ledger hash.",
-
2951  __LINE__,
-
2952  {"gateway_balances",
-
2953  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
2954  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
2955  RPCCallTestData::no_exception,
-
2956  R"({
-
2957  "method" : "gateway_balances",
-
2958  "params" : [
-
2959  {
-
2960  "api_version" : %MAX_API_VER%,
-
2961  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2962  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
2963  }
-
2964  ]
-
2965  })"},
-
2966  {"gateway_balances: 1 hotwallet.",
-
2967  __LINE__,
-
2968  {"gateway_balances",
-
2969  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2970  "hotwallet_is_not_validated"},
-
2971  RPCCallTestData::no_exception,
-
2972  R"({
-
2973  "method" : "gateway_balances",
-
2974  "params" : [
-
2975  {
-
2976  "api_version" : %MAX_API_VER%,
-
2977  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2978  "hotwallet" : [ "hotwallet_is_not_validated" ]
-
2979  }
-
2980  ]
-
2981  })"},
-
2982  {"gateway_balances: 3 hotwallets.",
-
2983  __LINE__,
-
2984  {
-
2985  "gateway_balances",
-
2986  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
2987  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2988  "hotwallet_is_not_validated_1",
-
2989  "hotwallet_is_not_validated_2",
-
2990  "hotwallet_is_not_validated_3",
-
2991  },
-
2992  RPCCallTestData::no_exception,
-
2993  R"({
-
2994  "method" : "gateway_balances",
-
2995  "params" : [
-
2996  {
-
2997  "api_version" : %MAX_API_VER%,
-
2998  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
2999  "hotwallet" : [
-
3000  "hotwallet_is_not_validated_1",
-
3001  "hotwallet_is_not_validated_2",
-
3002  "hotwallet_is_not_validated_3"
-
3003  ],
-
3004  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
3005  }
-
3006  ]
-
3007  })"},
-
3008  {"gateway_balances: too few arguments.",
-
3009  __LINE__,
-
3010  {
-
3011  "gateway_balances",
-
3012  },
-
3013  RPCCallTestData::no_exception,
-
3014  R"({
-
3015  "method" : "gateway_balances",
-
3016  "params" : [
-
3017  {
-
3018  "error" : "badSyntax",
-
3019  "error_code" : 1,
-
3020  "error_message" : "Syntax error."
-
3021  }
-
3022  ]
-
3023  })"},
-
3024  {"gateway_balances: empty first argument.",
-
3025  __LINE__,
-
3026  {"gateway_balances", ""},
-
3027  RPCCallTestData::no_exception,
-
3028  R"({
-
3029  "method" : "gateway_balances",
-
3030  "params" : [
-
3031  {
-
3032  "error" : "invalidParams",
-
3033  "error_code" : 31,
-
3034  "error_message" : "Invalid first parameter"
-
3035  }
-
3036  ]
-
3037  })"},
-
3038  {"gateway_balances: with ledger index but no gateway.",
-
3039  __LINE__,
-
3040  {
-
3041  "gateway_balances",
-
3042  "890765",
-
3043  },
-
3044  RPCCallTestData::no_exception,
-
3045  R"({
-
3046  "method" : "gateway_balances",
-
3047  "params" : [
-
3048  {
-
3049  "error" : "invalidParams",
-
3050  "error_code" : 31,
-
3051  "error_message" : "Invalid hotwallet"
-
3052  }
-
3053  ]
-
3054  })"},
-
3055  {"gateway_balances: with text ledger index but no gateway.",
-
3056  __LINE__,
-
3057  {
-
3058  "gateway_balances",
-
3059  "current",
-
3060  },
-
3061  RPCCallTestData::no_exception,
-
3062  R"({
-
3063  "method" : "gateway_balances",
-
3064  "params" : [
-
3065  {
-
3066  "error" : "invalidParams",
-
3067  "error_code" : 31,
-
3068  "error_message" : "Invalid hotwallet"
-
3069  }
-
3070  ]
-
3071  })"},
-
3072  {"gateway_balances: with 64 character ledger hash but no gateway.",
-
3073  __LINE__,
-
3074  {
-
3075  "gateway_balances",
-
3076  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
3077  },
-
3078  RPCCallTestData::no_exception,
-
3079  R"({
-
3080  "method" : "gateway_balances",
-
3081  "params" : [
-
3082  {
-
3083  "error" : "invalidParams",
-
3084  "error_code" : 31,
-
3085  "error_message" : "Invalid hotwallet"
-
3086  }
-
3087  ]
-
3088  })"},
-
3089 
-
3090  // get_counts
-
3091  // ------------------------------------------------------------------
-
3092  {"get_counts: minimal.",
-
3093  __LINE__,
-
3094  {
-
3095  "get_counts",
-
3096  },
-
3097  RPCCallTestData::no_exception,
-
3098  R"({
-
3099  "method" : "get_counts",
-
3100  "params" : [
-
3101  {
-
3102  "api_version" : %MAX_API_VER%,
-
3103  }
-
3104  ]
-
3105  })"},
-
3106  {"get_counts: with maximum count.",
-
3107  __LINE__,
-
3108  {"get_counts", "100"},
-
3109  RPCCallTestData::no_exception,
-
3110  R"({
-
3111  "method" : "get_counts",
-
3112  "params" : [
-
3113  {
-
3114  "api_version" : %MAX_API_VER%,
-
3115  "min_count" : 100
-
3116  }
-
3117  ]
-
3118  })"},
-
3119  {"get_counts: too many arguments.",
-
3120  __LINE__,
-
3121  {"get_counts", "100", "whatever"},
-
3122  RPCCallTestData::no_exception,
-
3123  R"({
-
3124  "method" : "get_counts",
-
3125  "params" : [
-
3126  {
-
3127  "error" : "badSyntax",
-
3128  "error_code" : 1,
-
3129  "error_message" : "Syntax error."
-
3130  }
-
3131  ]
-
3132  })"},
-
3133  {"get_counts: count too small.",
-
3134  __LINE__,
-
3135  {
-
3136  "get_counts",
-
3137  "-1",
-
3138  },
-
3139  RPCCallTestData::bad_cast,
-
3140  R"()"},
-
3141  {"get_counts: count too large.",
-
3142  __LINE__,
-
3143  {"get_counts", "4294967296"},
-
3144  RPCCallTestData::bad_cast,
-
3145  R"()"},
-
3146 
-
3147  // json
-
3148  // ------------------------------------------------------------------------
-
3149  {"json: minimal.",
-
3150  __LINE__,
-
3151  {
-
3152  "json",
-
3153  "command",
-
3154  R"({"json_argument":true})",
-
3155  },
-
3156  RPCCallTestData::no_exception,
-
3157  R"({
-
3158  "method" : "command",
-
3159  "params" : [
-
3160  {
-
3161  "api_version" : %MAX_API_VER%,
-
3162  "json_argument" : true,
-
3163  "method" : "command"
-
3164  }
-
3165  ]
-
3166  })"},
-
3167  {"json: null object.",
-
3168  __LINE__,
-
3169  {
-
3170  "json",
-
3171  "command",
-
3172  R"({})",
-
3173  },
-
3174  RPCCallTestData::no_exception,
-
3175  R"({
-
3176  "method" : "command",
-
3177  "params" : [
-
3178  {
-
3179  "api_version" : %MAX_API_VER%,
-
3180  "method" : "command"
-
3181  }
-
3182  ]
-
3183  })"},
-
3184  {"json: too few arguments.",
-
3185  __LINE__,
-
3186  {"json", "command"},
-
3187  RPCCallTestData::no_exception,
-
3188  R"({
-
3189  "method" : "json",
-
3190  "params" : [
-
3191  {
-
3192  "error" : "badSyntax",
-
3193  "error_code" : 1,
-
3194  "error_message" : "Syntax error."
-
3195  }
-
3196  ]
-
3197  })"},
-
3198  {"json: too many arguments.",
-
3199  __LINE__,
-
3200  {"json", "command", R"({"json_argument":true})", "extra"},
-
3201  RPCCallTestData::no_exception,
-
3202  R"({
-
3203  "method" : "json",
-
3204  "params" : [
-
3205  {
-
3206  "error" : "badSyntax",
-
3207  "error_code" : 1,
-
3208  "error_message" : "Syntax error."
-
3209  }
-
3210  ]
-
3211  })"},
-
3212  {"json: array, not object.",
-
3213  __LINE__,
-
3214  {
-
3215  "json",
-
3216  "command",
-
3217  R"(["arg1","arg2"])",
-
3218  },
-
3219  RPCCallTestData::no_exception,
-
3220  R"({
-
3221  "method" : "json",
-
3222  "params" : [
-
3223  {
-
3224  "error" : "invalidParams",
-
3225  "error_code" : 31,
-
3226  "error_message" : "Invalid parameters."
-
3227  }
-
3228  ]
-
3229  })"},
-
3230  {"json: invalid json (note closing comma).",
-
3231  __LINE__,
-
3232  {
-
3233  "json",
-
3234  "command",
-
3235  R"({"json_argument":true,})",
-
3236  },
-
3237  RPCCallTestData::no_exception,
-
3238  R"({
-
3239  "method" : "json",
-
3240  "params" : [
-
3241  {
-
3242  "error" : "invalidParams",
-
3243  "error_code" : 31,
-
3244  "error_message" : "Invalid parameters."
-
3245  }
-
3246  ]
-
3247  })"},
-
3248 
-
3249  // json2
-
3250  // -----------------------------------------------------------------------
-
3251  {"json2: minimal object.",
-
3252  __LINE__,
-
3253  {
-
3254  "json2",
-
3255  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"})",
-
3256  },
-
3257  RPCCallTestData::no_exception,
-
3258  R"({
-
3259  "id" : "A1",
-
3260  "jsonrpc" : "2.0",
-
3261  "method" : "call_1",
-
3262  "params" : [
-
3263  {
-
3264  "api_version" : %MAX_API_VER%,
-
3265  "id" : "A1",
-
3266  "jsonrpc" : "2.0",
-
3267  "method" : "call_1",
-
3268  "ripplerpc" : "2.0"
-
3269  }
-
3270  ],
-
3271  "ripplerpc" : "2.0"
-
3272  })"},
-
3273  {"json2: object with nested params.",
-
3274  __LINE__,
-
3275  {
-
3276  "json2",
-
3277  R"({
-
3278  "jsonrpc" : "2.0",
-
3279  "ripplerpc" : "2.0",
-
3280  "id" : "A1",
-
3281  "method" : "call_1",
-
3282  "params" : [{"inner_arg" : "yup"}]
-
3283  })",
-
3284  },
-
3285  RPCCallTestData::no_exception,
-
3286  R"({
-
3287  "id" : "A1",
-
3288  "jsonrpc" : "2.0",
-
3289  "method" : "call_1",
-
3290  "params" : [
-
3291  {
-
3292  "api_version" : %MAX_API_VER%,
-
3293  "0" : {
-
3294  "inner_arg" : "yup"
-
3295  },
-
3296  "id" : "A1",
-
3297  "jsonrpc" : "2.0",
-
3298  "method" : "call_1",
-
3299  "ripplerpc" : "2.0"
-
3300  }
-
3301  ],
-
3302  "ripplerpc" : "2.0"
-
3303  })"},
-
3304  {"json2: minimal array.",
-
3305  __LINE__,
-
3306  {
-
3307  "json2",
-
3308  R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"}])",
-
3309  },
-
3310  RPCCallTestData::no_exception,
-
3311  R"({
-
3312  "method" : "json2",
-
3313  "params" : [
-
3314  [
-
3315  {
-
3316  "api_version" : %MAX_API_VER%,
-
3317  "id" : "A1",
-
3318  "jsonrpc" : "2.0",
-
3319  "method" : "call_1",
-
3320  "ripplerpc" : "2.0"
-
3321  }
-
3322  ]
-
3323  ]
-
3324  })"},
-
3325  {"json2: array with object with nested params.",
-
3326  __LINE__,
-
3327  {
-
3328  "json2",
-
3329  R"([
-
3330  {"jsonrpc":"2.0",
-
3331  "ripplerpc":"2.0",
-
3332  "id":"A1",
-
3333  "method":"call_1",
-
3334  "params" : [{"inner_arg" : "yup"}]}
-
3335  ])",
-
3336  },
-
3337  RPCCallTestData::no_exception,
-
3338  R"({
-
3339  "method" : "json2",
-
3340  "params" : [
-
3341  [
-
3342  {
-
3343  "api_version" : %MAX_API_VER%,
-
3344  "0" : {
-
3345  "inner_arg" : "yup"
-
3346  },
-
3347  "id" : "A1",
-
3348  "jsonrpc" : "2.0",
-
3349  "method" : "call_1",
-
3350  "ripplerpc" : "2.0"
-
3351  }
-
3352  ]
-
3353  ]})"},
-
3354  {"json2: too few arguments.",
-
3355  __LINE__,
-
3356  {
-
3357  "json2",
-
3358  },
-
3359  RPCCallTestData::no_exception,
-
3360  R"({
-
3361  "method" : "json2",
-
3362  "params" : [
-
3363  {
-
3364  "error" : "badSyntax",
-
3365  "error_code" : 1,
-
3366  "error_message" : "Syntax error."
-
3367  }
-
3368  ]
-
3369  })"},
-
3370  {"json2: too many arguments.",
-
3371  __LINE__,
-
3372  {"json2",
-
3373  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_this"})",
-
3374  "extra"},
-
3375  RPCCallTestData::no_exception,
-
3376  R"({
-
3377  "method" : "json2",
-
3378  "params" : [
-
3379  {
-
3380  "error" : "badSyntax",
-
3381  "error_code" : 1,
-
3382  "error_message" : "Syntax error."
-
3383  }
-
3384  ]
-
3385  })"},
-
3386  {"json2: malformed json (note extra comma).",
-
3387  __LINE__,
-
3388  {
-
3389  "json2",
-
3390  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",})",
-
3391  },
-
3392  RPCCallTestData::no_exception,
-
3393  R"({
-
3394  "id" : "A1",
-
3395  "jsonrpc" : "2.0",
-
3396  "method" : "json2",
-
3397  "params" : [
-
3398  {
-
3399  "error" : "invalidParams",
-
3400  "error_code" : 31,
-
3401  "error_message" : "Invalid parameters.",
-
3402  "id" : "A1",
-
3403  "jsonrpc" : "2.0",
-
3404  "ripplerpc" : "2.0"
-
3405  }
-
3406  ],
-
3407  "ripplerpc" : "2.0"
-
3408  })"},
-
3409  {"json2: omit jsonrpc.",
-
3410  __LINE__,
-
3411  {
-
3412  "json2",
-
3413  R"({"ripplerpc":"2.0","id":"A1","method":"call_1"})",
-
3414  },
-
3415  RPCCallTestData::no_exception,
-
3416  R"({
-
3417  "id" : "A1",
-
3418  "method" : "json2",
-
3419  "params" : [
-
3420  {
-
3421  "error" : "invalidParams",
-
3422  "error_code" : 31,
-
3423  "error_message" : "Invalid parameters.",
-
3424  "id" : "A1",
-
3425  "ripplerpc" : "2.0"
-
3426  }
-
3427  ],
-
3428  "ripplerpc" : "2.0"
-
3429  })"},
-
3430  {"json2: wrong jsonrpc version.",
-
3431  __LINE__,
-
3432  {
-
3433  "json2",
-
3434  R"({"jsonrpc":"2.1","ripplerpc":"2.0","id":"A1","method":"call_1"})",
-
3435  },
-
3436  RPCCallTestData::no_exception,
-
3437  R"({
-
3438  "id" : "A1",
-
3439  "jsonrpc" : "2.1",
-
3440  "method" : "json2",
-
3441  "params" : [
-
3442  {
-
3443  "error" : "invalidParams",
-
3444  "error_code" : 31,
-
3445  "error_message" : "Invalid parameters.",
-
3446  "id" : "A1",
-
3447  "jsonrpc" : "2.1",
-
3448  "ripplerpc" : "2.0"
-
3449  }
-
3450  ],
-
3451  "ripplerpc" : "2.0"
-
3452  })"},
-
3453  {"json2: omit ripplerpc.",
-
3454  __LINE__,
-
3455  {
-
3456  "json2",
-
3457  R"({"jsonrpc":"2.0","id":"A1","method":"call_1"})",
-
3458  },
-
3459  RPCCallTestData::no_exception,
-
3460  R"({
-
3461  "id" : "A1",
-
3462  "jsonrpc" : "2.0",
-
3463  "method" : "json2",
-
3464  "params" : [
-
3465  {
-
3466  "error" : "invalidParams",
-
3467  "error_code" : 31,
-
3468  "error_message" : "Invalid parameters.",
-
3469  "id" : "A1",
-
3470  "jsonrpc" : "2.0"
-
3471  }
-
3472  ]
-
3473  })"},
-
3474  {"json2: wrong ripplerpc version.",
-
3475  __LINE__,
-
3476  {
-
3477  "json2",
-
3478  R"({"jsonrpc":"2.0","ripplerpc":"2.00","id":"A1","method":"call_1"})",
-
3479  },
-
3480  RPCCallTestData::no_exception,
-
3481  R"({
-
3482  "id" : "A1",
-
3483  "jsonrpc" : "2.0",
-
3484  "method" : "json2",
-
3485  "params" : [
-
3486  {
-
3487  "error" : "invalidParams",
-
3488  "error_code" : 31,
-
3489  "error_message" : "Invalid parameters.",
-
3490  "id" : "A1",
-
3491  "jsonrpc" : "2.0",
-
3492  "ripplerpc" : "2.00"
-
3493  }
-
3494  ],
-
3495  "ripplerpc" : "2.00"
-
3496  })"},
-
3497  {"json2: omit id.",
-
3498  __LINE__,
-
3499  {
-
3500  "json2",
-
3501  R"({"jsonrpc":"2.0","ripplerpc":"2.0","method":"call_1"})",
-
3502  },
-
3503  RPCCallTestData::no_exception,
-
3504  R"({
-
3505  "jsonrpc" : "2.0",
-
3506  "method" : "json2",
-
3507  "params" : [
-
3508  {
-
3509  "error" : "invalidParams",
-
3510  "error_code" : 31,
-
3511  "error_message" : "Invalid parameters.",
-
3512  "jsonrpc" : "2.0",
-
3513  "ripplerpc" : "2.0"
-
3514  }
-
3515  ],
-
3516  "ripplerpc" : "2.0"
-
3517  })"},
-
3518  {"json2: omit method.",
-
3519  __LINE__,
-
3520  {
-
3521  "json2",
-
3522  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1"})",
-
3523  },
-
3524  RPCCallTestData::no_exception,
-
3525  R"({
-
3526  "id" : "A1",
-
3527  "jsonrpc" : "2.0",
-
3528  "method" : "json2",
-
3529  "params" : [
-
3530  {
-
3531  "error" : "invalidParams",
-
3532  "error_code" : 31,
-
3533  "error_message" : "Invalid parameters.",
-
3534  "id" : "A1",
-
3535  "jsonrpc" : "2.0",
-
3536  "ripplerpc" : "2.0"
-
3537  }
-
3538  ],
-
3539  "ripplerpc" : "2.0"
-
3540  })"},
-
3541  {"json2: empty outer array.",
-
3542  __LINE__,
-
3543  {
-
3544  "json2",
-
3545  R"([])",
-
3546  },
-
3547  RPCCallTestData::no_exception,
-
3548  R"({
-
3549  "method" : "json2",
-
3550  "params" : [
-
3551  {
-
3552  "error" : "invalidParams",
-
3553  "error_code" : 31,
-
3554  "error_message" : "Invalid parameters."
-
3555  }
-
3556  ]
-
3557  })"},
-
3558  {"json2: empty inner array.",
-
3559  __LINE__,
-
3560  {
-
3561  "json2",
-
3562  R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",[]}])",
-
3563  },
-
3564  RPCCallTestData::no_exception,
-
3565  R"({
-
3566  "method" : "json2",
-
3567  "params" : [
-
3568  {
-
3569  "error" : "invalidParams",
-
3570  "error_code" : 31,
-
3571  "error_message" : "Invalid parameters."
-
3572  }
-
3573  ]
-
3574  })"},
-
3575  {"json2: array with non-json2 object.",
-
3576  __LINE__,
-
3577  {
-
3578  "json2",
-
3579  R"([
-
3580  {"jsonrpc" : "2.1",
-
3581  "ripplerpc" : "2.0",
-
3582  "id" : "A1",
-
3583  "method" : "call_1"
-
3584  }
-
3585  ])",
-
3586  },
-
3587  RPCCallTestData::no_exception,
-
3588  R"({
-
3589  "method" : "json2",
-
3590  "params" : [
-
3591  {
-
3592  "error" : "invalidParams",
-
3593  "error_code" : 31,
-
3594  "error_message" : "Invalid parameters."
-
3595  }
-
3596  ]
-
3597  })"},
-
3598  {"json2: non-object or -array inner params member.",
-
3599  __LINE__,
-
3600  {
-
3601  "json2",
-
3602  R"({
-
3603  "jsonrpc" : "2.0",
-
3604  "ripplerpc" : "2.0",
-
3605  "id" : "A1",
-
3606  "method" : "call_1",
-
3607  "params" : true
-
3608  })",
-
3609  },
-
3610  RPCCallTestData::no_exception,
-
3611  R"({
-
3612  "id" : "A1",
-
3613  "jsonrpc" : "2.0",
-
3614  "method" : "json2",
-
3615  "params" : [
-
3616  {
-
3617  "error" : "invalidParams",
-
3618  "error_code" : 31,
-
3619  "error_message" : "Invalid parameters.",
-
3620  "id" : "A1",
-
3621  "jsonrpc" : "2.0",
-
3622  "ripplerpc" : "2.0"
-
3623  }
-
3624  ],
-
3625  "ripplerpc" : "2.0"
-
3626  })"},
-
3627 
-
3628  // ledger
-
3629  // ----------------------------------------------------------------------
-
3630  {"ledger: minimal.",
-
3631  __LINE__,
-
3632  {"ledger"},
-
3633  RPCCallTestData::no_exception,
-
3634  R"({
-
3635  "method" : "ledger",
-
3636  "params" : [
-
3637  {
-
3638  "api_version" : %MAX_API_VER%,
-
3639  }
-
3640  ]
-
3641  })"},
-
3642  {"ledger: ledger index.",
-
3643  __LINE__,
-
3644  {"ledger", "4294967295"},
-
3645  RPCCallTestData::no_exception,
-
3646  R"({
-
3647  "method" : "ledger",
-
3648  "params" : [
-
3649  {
-
3650  "api_version" : %MAX_API_VER%,
-
3651  "ledger_index" : 4294967295
-
3652  }
-
3653  ]
-
3654  })"},
-
3655  {"ledger: text ledger index.",
-
3656  __LINE__,
-
3657  {"ledger", "validated"},
-
3658  RPCCallTestData::no_exception,
-
3659  R"({
-
3660  "method" : "ledger",
-
3661  "params" : [
-
3662  {
-
3663  "api_version" : %MAX_API_VER%,
-
3664  "ledger_index" : "validated"
-
3665  }
-
3666  ]
-
3667  })"},
-
3668  {"ledger: ledger hash.",
-
3669  __LINE__,
-
3670  {"ledger",
-
3671  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
-
3672  RPCCallTestData::no_exception,
-
3673  R"({
-
3674  "method" : "ledger",
-
3675  "params" : [
-
3676  {
-
3677  "api_version" : %MAX_API_VER%,
-
3678  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
-
3679  }
-
3680  ]
-
3681  })"},
-
3682  {"ledger: full.",
-
3683  __LINE__,
-
3684  {"ledger", "current", "full"},
-
3685  RPCCallTestData::no_exception,
-
3686  R"({
-
3687  "method" : "ledger",
-
3688  "params" : [
-
3689  {
-
3690  "api_version" : %MAX_API_VER%,
-
3691  "full" : true,
-
3692  "ledger_index" : "current"
-
3693  }
-
3694  ]
-
3695  })"},
-
3696  {"ledger: tx.",
-
3697  __LINE__,
-
3698  {"ledger", "closed", "tx"},
-
3699  RPCCallTestData::no_exception,
-
3700  R"({
-
3701  "method" : "ledger",
-
3702  "params" : [
-
3703  {
-
3704  "api_version" : %MAX_API_VER%,
-
3705  "expand" : true,
-
3706  "ledger_index" : "closed",
-
3707  "transactions" : true
-
3708  }
-
3709  ]
-
3710  })"},
-
3711  {"ledger: too many arguments.",
-
3712  __LINE__,
-
3713  {"ledger", "4294967295", "spare"},
-
3714  RPCCallTestData::no_exception,
-
3715  R"({
-
3716  "method" : "ledger",
-
3717  "params" : [
-
3718  {
-
3719  "api_version" : %MAX_API_VER%,
-
3720  "ledger_index" : 4294967295
-
3721  }
-
3722  ]
-
3723  })"},
-
3724  {"ledger: ledger index too small.",
-
3725  __LINE__,
-
3726  {"ledger", "-1"},
-
3727  RPCCallTestData::no_exception,
-
3728  R"({
-
3729  "method" : "ledger",
-
3730  "params" : [
-
3731  {
-
3732  "api_version" : %MAX_API_VER%,
-
3733  "ledger_index" : 0
-
3734  }
-
3735  ]
-
3736  })"},
-
3737  {"ledger: ledger index too big.",
-
3738  __LINE__,
-
3739  {"ledger", "4294967296"},
-
3740  RPCCallTestData::no_exception,
-
3741  R"({
-
3742  "method" : "ledger",
-
3743  "params" : [
-
3744  {
-
3745  "api_version" : %MAX_API_VER%,
-
3746  "ledger_index" : 0
-
3747  }
-
3748  ]
-
3749  })"},
-
3750  {"ledger: invalid ledger text.",
-
3751  __LINE__,
-
3752  {"ledger", "latest"},
-
3753  RPCCallTestData::no_exception,
-
3754  R"({
-
3755  "method" : "ledger",
-
3756  "params" : [
-
3757  {
-
3758  "api_version" : %MAX_API_VER%,
-
3759  "ledger_index" : 0
-
3760  }
-
3761  ]
-
3762  })"},
-
3763  {"ledger: unsupported final argument.",
-
3764  __LINE__,
-
3765  {"ledger", "current", "expand"},
-
3766  RPCCallTestData::no_exception,
-
3767  R"({
-
3768  "method" : "ledger",
-
3769  "params" : [
-
3770  {
-
3771  "api_version" : %MAX_API_VER%,
-
3772  "ledger_index" : "current"
-
3773  }
-
3774  ]
-
3775  })"},
-
3776 
-
3777  // ledger_closed
-
3778  // ---------------------------------------------------------------
-
3779  {"ledger_closed: minimal.",
-
3780  __LINE__,
-
3781  {"ledger_closed"},
-
3782  RPCCallTestData::no_exception,
-
3783  R"({
-
3784  "method" : "ledger_closed",
-
3785  "params" : [
-
3786  {
-
3787  "api_version" : %MAX_API_VER%,
-
3788  }
-
3789  ]
-
3790  })"},
-
3791  {"ledger_closed: too many arguments.",
-
3792  __LINE__,
-
3793  {"ledger_closed", "today"},
-
3794  RPCCallTestData::no_exception,
-
3795  R"({
-
3796  "method" : "ledger_closed",
-
3797  "params" : [
-
3798  {
-
3799  "error" : "badSyntax",
-
3800  "error_code" : 1,
-
3801  "error_message" : "Syntax error."
-
3802  }
-
3803  ]
-
3804  })"},
-
3805 
-
3806  // ledger_current
-
3807  // --------------------------------------------------------------
-
3808  {"ledger_current: minimal.",
-
3809  __LINE__,
-
3810  {"ledger_current"},
-
3811  RPCCallTestData::no_exception,
-
3812  R"({
-
3813  "method" : "ledger_current",
-
3814  "params" : [
-
3815  {
-
3816  "api_version" : %MAX_API_VER%,
-
3817  }
-
3818  ]
-
3819  })"},
-
3820  {"ledger_current: too many arguments.",
-
3821  __LINE__,
-
3822  {"ledger_current", "today"},
-
3823  RPCCallTestData::no_exception,
-
3824  R"({
-
3825  "method" : "ledger_current",
-
3826  "params" : [
-
3827  {
-
3828  "error" : "badSyntax",
-
3829  "error_code" : 1,
-
3830  "error_message" : "Syntax error."
-
3831  }
-
3832  ]
-
3833  })"},
-
3834 
-
3835  // ledger_header
-
3836  // ---------------------------------------------------------------
-
3837  {"ledger_header: ledger index.",
-
3838  __LINE__,
-
3839  {"ledger_header", "4294967295"},
-
3840  RPCCallTestData::no_exception,
-
3841  R"({
-
3842  "method" : "ledger_header",
-
3843  "params" : [
-
3844  {
-
3845  "api_version" : %MAX_API_VER%,
-
3846  "ledger_index" : 4294967295
-
3847  }
-
3848  ]
-
3849  })"},
-
3850  {"ledger_header: ledger hash.",
-
3851  __LINE__,
-
3852  {"ledger_header",
-
3853  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
-
3854  RPCCallTestData::no_exception,
-
3855  R"({
-
3856  "method" : "ledger_header",
-
3857  "params" : [
-
3858  {
-
3859  "api_version" : %MAX_API_VER%,
-
3860  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
-
3861  }
-
3862  ]
-
3863  })"},
-
3864  {"ledger_header: too few arguments.",
-
3865  __LINE__,
-
3866  {
-
3867  "ledger_header",
-
3868  },
-
3869  RPCCallTestData::no_exception,
-
3870  R"({
-
3871  "method" : "ledger_header",
-
3872  "params" : [
-
3873  {
-
3874  "error" : "badSyntax",
-
3875  "error_code" : 1,
-
3876  "error_message" : "Syntax error."
-
3877  }
-
3878  ]
-
3879  })"},
-
3880  {"ledger_header: too many arguments.",
-
3881  __LINE__,
-
3882  {"ledger_header", "4294967295", "spare"},
-
3883  RPCCallTestData::no_exception,
-
3884  R"({
-
3885  "method" : "ledger_header",
-
3886  "params" : [
-
3887  {
-
3888  "error" : "badSyntax",
-
3889  "error_code" : 1,
-
3890  "error_message" : "Syntax error."
-
3891  }
-
3892  ]
-
3893  })"},
-
3894  {"ledger_header: text ledger index.",
-
3895  __LINE__,
-
3896  {"ledger_header", "current"},
-
3897  RPCCallTestData::no_exception,
-
3898  R"({
-
3899  "method" : "ledger_header",
-
3900  "params" : [
-
3901  {
-
3902  "api_version" : %MAX_API_VER%,
-
3903  "ledger_index" : 0
-
3904  }
-
3905  ]
-
3906  })"},
-
3907  {"ledger_header: ledger index too small.",
-
3908  __LINE__,
-
3909  {"ledger_header", "-1"},
-
3910  RPCCallTestData::no_exception,
-
3911  R"({
-
3912  "method" : "ledger_header",
-
3913  "params" : [
-
3914  {
-
3915  "api_version" : %MAX_API_VER%,
-
3916  "ledger_index" : 0
-
3917  }
-
3918  ]
-
3919  })"},
-
3920  {"ledger_header: ledger index too big.",
-
3921  __LINE__,
-
3922  {"ledger_header", "4294967296"},
-
3923  RPCCallTestData::no_exception,
-
3924  R"({
-
3925  "method" : "ledger_header",
-
3926  "params" : [
-
3927  {
-
3928  "api_version" : %MAX_API_VER%,
-
3929  "ledger_index" : 0
-
3930  }
-
3931  ]
-
3932  })"},
-
3933 
-
3934  // ledger_request
-
3935  // --------------------------------------------------------------
-
3936  {"ledger_request: ledger index.",
-
3937  __LINE__,
-
3938  {"ledger_request", "4294967295"},
-
3939  RPCCallTestData::no_exception,
-
3940  R"({
-
3941  "method" : "ledger_request",
-
3942  "params" : [
-
3943  {
-
3944  "api_version" : %MAX_API_VER%,
-
3945  "ledger_index" : 4294967295
-
3946  }
-
3947  ]
-
3948  })"},
-
3949  {"ledger_request: ledger hash.",
-
3950  __LINE__,
-
3951  {"ledger_request",
-
3952  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
-
3953  RPCCallTestData::no_exception,
-
3954  R"({
-
3955  "method" : "ledger_request",
-
3956  "params" : [
-
3957  {
-
3958  "api_version" : %MAX_API_VER%,
-
3959  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
-
3960  }
-
3961  ]
-
3962  })"},
-
3963  {"ledger_request: too few arguments.",
-
3964  __LINE__,
-
3965  {
-
3966  "ledger_request",
-
3967  },
-
3968  RPCCallTestData::no_exception,
-
3969  R"({
-
3970  "method" : "ledger_request",
-
3971  "params" : [
-
3972  {
-
3973  "error" : "badSyntax",
-
3974  "error_code" : 1,
-
3975  "error_message" : "Syntax error."
-
3976  }
-
3977  ]
-
3978  })"},
-
3979  {"ledger_request: too many arguments.",
-
3980  __LINE__,
-
3981  {"ledger_request", "4294967295", "spare"},
-
3982  RPCCallTestData::no_exception,
-
3983  R"({
-
3984  "method" : "ledger_request",
-
3985  "params" : [
-
3986  {
-
3987  "error" : "badSyntax",
-
3988  "error_code" : 1,
-
3989  "error_message" : "Syntax error."
-
3990  }
-
3991  ]
-
3992  })"},
-
3993  {"ledger_request: text ledger index.",
-
3994  __LINE__,
-
3995  {"ledger_request", "current"},
-
3996  RPCCallTestData::no_exception,
-
3997  R"({
-
3998  "method" : "ledger_request",
-
3999  "params" : [
-
4000  {
-
4001  "api_version" : %MAX_API_VER%,
-
4002  "ledger_index" : 0
-
4003  }
-
4004  ]
-
4005  })"},
-
4006  {"ledger_request: ledger index too small.",
-
4007  __LINE__,
-
4008  {"ledger_request", "-1"},
-
4009  RPCCallTestData::no_exception,
-
4010  R"({
-
4011  "method" : "ledger_request",
-
4012  "params" : [
-
4013  {
-
4014  "api_version" : %MAX_API_VER%,
-
4015  "ledger_index" : 0
-
4016  }
-
4017  ]
-
4018  })"},
-
4019  {"ledger_request: ledger index too big.",
-
4020  __LINE__,
-
4021  {"ledger_request", "4294967296"},
-
4022  RPCCallTestData::no_exception,
-
4023  R"({
-
4024  "method" : "ledger_request",
-
4025  "params" : [
-
4026  {
-
4027  "api_version" : %MAX_API_VER%,
-
4028  "ledger_index" : 0
-
4029  }
-
4030  ]
-
4031  })"},
-
4032 
-
4033  // log_level
-
4034  // -------------------------------------------------------------------
-
4035  {"log_level: minimal.",
-
4036  __LINE__,
-
4037  {
-
4038  "log_level",
-
4039  },
-
4040  RPCCallTestData::no_exception,
-
4041  R"({
-
4042  "method" : "log_level",
-
4043  "params" : [
-
4044  {
-
4045  "api_version" : %MAX_API_VER%,
-
4046  }
-
4047  ]
-
4048  })"},
-
4049  {"log_level: fatal.",
-
4050  __LINE__,
-
4051  {"log_level", "fatal"},
-
4052  RPCCallTestData::no_exception,
-
4053  R"({
-
4054  "method" : "log_level",
-
4055  "params" : [
-
4056  {
-
4057  "api_version" : %MAX_API_VER%,
-
4058  "severity" : "fatal"
-
4059  }
-
4060  ]
-
4061  })"},
-
4062  {"log_level: error.",
-
4063  __LINE__,
-
4064  {"log_level", "error"},
-
4065  RPCCallTestData::no_exception,
-
4066  R"({
-
4067  "method" : "log_level",
-
4068  "params" : [
-
4069  {
-
4070  "api_version" : %MAX_API_VER%,
-
4071  "severity" : "error"
-
4072  }
-
4073  ]
-
4074  })"},
-
4075  {"log_level: warn.",
-
4076  __LINE__,
-
4077  {"log_level", "warn"},
-
4078  RPCCallTestData::no_exception,
-
4079  R"({
-
4080  "method" : "log_level",
-
4081  "params" : [
-
4082  {
-
4083  "api_version" : %MAX_API_VER%,
-
4084  "severity" : "warn"
-
4085  }
-
4086  ]
-
4087  })"},
-
4088  {"log_level: debug.",
-
4089  __LINE__,
-
4090  {"log_level", "debug"},
-
4091  RPCCallTestData::no_exception,
-
4092  R"({
-
4093  "method" : "log_level",
-
4094  "params" : [
-
4095  {
-
4096  "api_version" : %MAX_API_VER%,
-
4097  "severity" : "debug"
-
4098  }
-
4099  ]
-
4100  })"},
-
4101  {"log_level: trace.",
-
4102  __LINE__,
-
4103  {"log_level", "trace"},
-
4104  RPCCallTestData::no_exception,
-
4105  R"({
-
4106  "method" : "log_level",
-
4107  "params" : [
-
4108  {
-
4109  "api_version" : %MAX_API_VER%,
-
4110  "severity" : "trace"
-
4111  }
-
4112  ]
-
4113  })"},
-
4114  {"log_level: base partition.",
-
4115  __LINE__,
-
4116  {"log_level", "base", "trace"},
-
4117  RPCCallTestData::no_exception,
-
4118  R"({
-
4119  "method" : "log_level",
-
4120  "params" : [
-
4121  {
-
4122  "api_version" : %MAX_API_VER%,
-
4123  "partition" : "base",
-
4124  "severity" : "trace"
-
4125  }
-
4126  ]
-
4127  })"},
-
4128  {"log_level: partiton_name.",
-
4129  __LINE__,
-
4130  {"log_level", "partition_name", "fatal"},
-
4131  RPCCallTestData::no_exception,
-
4132  R"({
-
4133  "method" : "log_level",
-
4134  "params" : [
-
4135  {
-
4136  "api_version" : %MAX_API_VER%,
-
4137  "partition" : "partition_name",
-
4138  "severity" : "fatal"
-
4139  }
-
4140  ]
-
4141  })"},
-
4142  {"log_level: too many arguments.",
-
4143  __LINE__,
-
4144  {"log_level", "partition_name", "fatal", "extra"},
-
4145  RPCCallTestData::no_exception,
-
4146  R"({
-
4147  "method" : "log_level",
-
4148  "params" : [
-
4149  {
-
4150  "error" : "badSyntax",
-
4151  "error_code" : 1,
-
4152  "error_message" : "Syntax error."
-
4153  }
-
4154  ]
-
4155  })"},
-
4156  {"log_level: invalid severity.",
-
4157  __LINE__,
-
4158  {"log_level", "err"},
-
4159  RPCCallTestData::no_exception,
-
4160  R"({
-
4161  "method" : "log_level",
-
4162  "params" : [
-
4163  {
-
4164  "api_version" : %MAX_API_VER%,
-
4165  "severity" : "err"
-
4166  }
-
4167  ]
-
4168  })"},
-
4169  {"log_level: swap partition name and severity.",
-
4170  __LINE__,
-
4171  {
-
4172  "log_level",
-
4173  "fatal",
-
4174  "partition_name",
-
4175  },
-
4176  RPCCallTestData::no_exception,
-
4177  R"({
-
4178  "method" : "log_level",
-
4179  "params" : [
-
4180  {
-
4181  "api_version" : %MAX_API_VER%,
-
4182  "partition" : "fatal",
-
4183  "severity" : "partition_name"
-
4184  }
-
4185  ]
-
4186  })"},
-
4187 
-
4188  // logrotate
-
4189  // -------------------------------------------------------------------
-
4190  {"logrotate: minimal.",
-
4191  __LINE__,
-
4192  {
-
4193  "logrotate",
-
4194  },
-
4195  RPCCallTestData::no_exception,
-
4196  R"({
-
4197  "method" : "logrotate",
-
4198  "params" : [
-
4199  {
-
4200  "api_version" : %MAX_API_VER%,
-
4201  }
-
4202  ]
-
4203  })"},
-
4204  {"logrotate: too many arguments.",
-
4205  __LINE__,
-
4206  {"logrotate", "extra"},
-
4207  RPCCallTestData::no_exception,
-
4208  R"({
-
4209  "method" : "logrotate",
-
4210  "params" : [
-
4211  {
-
4212  "error" : "badSyntax",
-
4213  "error_code" : 1,
-
4214  "error_message" : "Syntax error."
-
4215  }
-
4216  ]
-
4217  })"},
-
4218 
-
4219  // node_to_shard
-
4220  // -------------------------------------------------------------------
-
4221  {"node_to_shard: status.",
-
4222  __LINE__,
-
4223  {"node_to_shard", "status"},
-
4224  RPCCallTestData::no_exception,
-
4225  R"({
-
4226  "method" : "node_to_shard",
-
4227  "params" : [
-
4228  {
-
4229  "api_version" : %MAX_API_VER%,
-
4230  "action" : "status"
-
4231  }
-
4232  ]
-
4233  })"},
-
4234  {"node_to_shard: start.",
-
4235  __LINE__,
-
4236  {"node_to_shard", "start"},
-
4237  RPCCallTestData::no_exception,
-
4238  R"({
-
4239  "method" : "node_to_shard",
-
4240  "params" : [
-
4241  {
-
4242  "api_version" : %MAX_API_VER%,
-
4243  "action" : "start"
-
4244  }
-
4245  ]
-
4246  })"},
-
4247  {"node_to_shard: stop.",
-
4248  __LINE__,
-
4249  {"node_to_shard", "stop"},
-
4250  RPCCallTestData::no_exception,
-
4251  R"({
-
4252  "method" : "node_to_shard",
-
4253  "params" : [
-
4254  {
-
4255  "api_version" : %MAX_API_VER%,
-
4256  "action" : "stop"
-
4257  }
-
4258  ]
-
4259  })"},
-
4260  {"node_to_shard: too many arguments.",
-
4261  __LINE__,
-
4262  {"node_to_shard", "start", "stop"},
-
4263  RPCCallTestData::no_exception,
-
4264  R"({
-
4265  "method" : "node_to_shard",
-
4266  "params" : [
-
4267  {
-
4268  "error" : "badSyntax",
-
4269  "error_code" : 1,
-
4270  "error_message" : "Syntax error."
-
4271  }
-
4272  ]
-
4273  })"},
-
4274  {"node_to_shard: invalid argument.",
-
4275  __LINE__,
-
4276  {"node_to_shard", "invalid"},
-
4277  RPCCallTestData::no_exception,
-
4278  R"({
-
4279  "method" : "node_to_shard",
-
4280  "params" : [
-
4281  {
-
4282  "api_version" : %MAX_API_VER%,
-
4283  "action" : "invalid"
-
4284  }
-
4285  ]
-
4286  })"},
-
4287 
-
4288  // owner_info
-
4289  // ------------------------------------------------------------------
-
4290  {"owner_info: minimal.",
-
4291  __LINE__,
-
4292  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
4293  RPCCallTestData::no_exception,
-
4294  R"({
-
4295  "method" : "owner_info",
-
4296  "params" : [
-
4297  {
-
4298  "api_version" : %MAX_API_VER%,
-
4299  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
-
4300  }
-
4301  ]
-
4302  })"},
-
4303  {"owner_info: with numeric ledger index.",
-
4304  __LINE__,
-
4305  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
-
4306  RPCCallTestData::no_exception,
-
4307  R"({
-
4308  "method" : "owner_info",
-
4309  "params" : [
-
4310  {
-
4311  "api_version" : %MAX_API_VER%,
-
4312  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4313  "ledger_index" : 987654321
-
4314  }
-
4315  ]
-
4316  })"},
-
4317  {"owner_info: with text ledger index.",
-
4318  __LINE__,
-
4319  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
4320  RPCCallTestData::no_exception,
-
4321  R"({
-
4322  "method" : "owner_info",
-
4323  "params" : [
-
4324  {
-
4325  "api_version" : %MAX_API_VER%,
-
4326  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4327  "ledger_index" : "validated"
-
4328  }
-
4329  ]
-
4330  })"},
-
4331  {"owner_info: with ledger hash.",
-
4332  __LINE__,
-
4333  {"owner_info",
-
4334  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4335  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
-
4336  RPCCallTestData::no_exception,
-
4337  R"({
-
4338  "method" : "owner_info",
-
4339  "params" : [
-
4340  {
-
4341  "api_version" : %MAX_API_VER%,
-
4342  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4343  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
-
4344  }
-
4345  ]
-
4346  })"},
-
4347  {"owner_info: with ledger index.",
-
4348  __LINE__,
-
4349  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
-
4350  RPCCallTestData::no_exception,
-
4351  R"({
-
4352  "method" : "owner_info",
-
4353  "params" : [
-
4354  {
-
4355  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4356  "api_version" : %MAX_API_VER%,
-
4357  "ledger_index" : "validated"
-
4358  }
-
4359  ]
-
4360  })"},
-
4361  {"owner_info: too few arguments.",
-
4362  __LINE__,
-
4363  {
-
4364  "owner_info",
-
4365  },
-
4366  RPCCallTestData::no_exception,
-
4367  R"({
-
4368  "method" : "owner_info",
-
4369  "params" : [
-
4370  {
-
4371  "error" : "badSyntax",
-
4372  "error_code" : 1,
-
4373  "error_message" : "Syntax error."
-
4374  }
-
4375  ]
-
4376  })"},
-
4377  {"owner_info: too many arguments.",
-
4378  __LINE__,
-
4379  {
-
4380  "owner_info",
-
4381  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4382  "current",
-
4383  "extra1",
-
4384  "extra2",
-
4385  },
-
4386  RPCCallTestData::no_exception,
-
4387  R"({
-
4388  "method" : "owner_info",
-
4389  "params" : [
-
4390  {
-
4391  "error" : "badSyntax",
-
4392  "error_code" : 1,
-
4393  "error_message" : "Syntax error."
-
4394  }
-
4395  ]
-
4396  })"},
-
4397  {
-
4398  "owner_info: invalid accountID.",
-
4399  __LINE__,
-
4400  {
-
4401  "owner_info",
-
4402  "", // Note: very few values are detected as bad!
-
4403  },
-
4404  RPCCallTestData::no_exception,
-
4405  R"({
-
4406  "method" : "owner_info",
-
4407  "params" : [
-
4408  {
-
4409  "error" : "actMalformed",
-
4410  "error_code" : 35,
-
4411  "error_message" : "Account malformed."
-
4412  }
-
4413  ]
-
4414  })",
-
4415  },
-
4416  {
-
4417  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
4418  // cannot currently occur because jvParseLedger() always returns true.
-
4419  "owner_info: invalid ledger selection.",
-
4420  __LINE__,
-
4421  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
4422  RPCCallTestData::no_exception,
-
4423  R"({
-
4424  "method" : "owner_info",
-
4425  "params" : [
-
4426  {
-
4427  "api_version" : %MAX_API_VER%,
-
4428  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4429  "ledger_index" : 0
-
4430  }
-
4431  ]
-
4432  })",
-
4433  },
-
4434  {
-
4435  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
-
4436  // cannot currently occur because jvParseLedger() always returns true.
-
4437  "owner_info: invalid ledger selection.",
-
4438  __LINE__,
-
4439  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
-
4440  RPCCallTestData::no_exception,
-
4441  R"({
-
4442  "method" : "owner_info",
-
4443  "params" : [
-
4444  {
-
4445  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4446  "api_version" : %MAX_API_VER%,
-
4447  "ledger_index" : 0
-
4448  }
-
4449  ]
-
4450  })",
-
4451  },
-
4452 
-
4453  // peers
-
4454  // -----------------------------------------------------------------------
-
4455  {"peers: minimal.",
-
4456  __LINE__,
-
4457  {
-
4458  "peers",
-
4459  },
-
4460  RPCCallTestData::no_exception,
-
4461  R"({
-
4462  "method" : "peers",
-
4463  "params" : [
-
4464  {
-
4465  "api_version" : %MAX_API_VER%,
-
4466  }
-
4467  ]
-
4468  })"},
-
4469  {"peers: too many arguments.",
-
4470  __LINE__,
-
4471  {"peers", "extra"},
-
4472  RPCCallTestData::no_exception,
-
4473  R"({
-
4474  "method" : "peers",
-
4475  "params" : [
-
4476  {
-
4477  "error" : "badSyntax",
-
4478  "error_code" : 1,
-
4479  "error_message" : "Syntax error."
-
4480  }
-
4481  ]
-
4482  })"},
-
4483 
-
4484  // peer_reservations_add
-
4485  // -------------------------------------------------------
-
4486  {"peer_reservations_add: minimal.",
-
4487  __LINE__,
-
4488  {"peer_reservations_add", "public_key_string"},
-
4489  RPCCallTestData::no_exception,
-
4490  R"({
-
4491  "method" : "peer_reservations_add",
-
4492  "params" : [
-
4493  {
-
4494  "api_version" : %MAX_API_VER%,
-
4495  "public_key" : "public_key_string"
-
4496  }
-
4497  ]
-
4498  })"},
-
4499  {"peer_reservations_add: with description.",
-
4500  __LINE__,
-
4501  {"peer_reservations_add", "public_key_string", "public_key_description"},
-
4502  RPCCallTestData::no_exception,
-
4503  R"({
-
4504  "method" : "peer_reservations_add",
-
4505  "params" : [
-
4506  {
-
4507  "api_version" : %MAX_API_VER%,
-
4508  "description" : "public_key_description",
-
4509  "public_key" : "public_key_string"
-
4510  }
-
4511  ]
-
4512  })"},
-
4513  {"peer_reservations_add: too few arguments.",
-
4514  __LINE__,
-
4515  {"peer_reservations_add"},
-
4516  RPCCallTestData::no_exception,
-
4517  R"({
-
4518  "method" : "peer_reservations_add",
-
4519  "params" : [
-
4520  {
-
4521  "error" : "badSyntax",
-
4522  "error_code" : 1,
-
4523  "error_message" : "Syntax error."
-
4524  }
-
4525  ]
-
4526  })"},
-
4527  {"peer_reservations_add: too many arguments.",
-
4528  __LINE__,
-
4529  {"peer_reservations_add",
-
4530  "public_key_string",
-
4531  "public_key_description",
-
4532  "spare"},
-
4533  RPCCallTestData::no_exception,
-
4534  R"({
-
4535  "method" : "peer_reservations_add",
-
4536  "params" : [
-
4537  {
-
4538  "error" : "badSyntax",
-
4539  "error_code" : 1,
-
4540  "error_message" : "Syntax error."
-
4541  }
-
4542  ]
-
4543  })"},
-
4544 
-
4545  // peer_reservations_del
-
4546  // -------------------------------------------------------
-
4547  {"peer_reservations_del: minimal.",
-
4548  __LINE__,
-
4549  {"peer_reservations_del", "public_key_string"},
-
4550  RPCCallTestData::no_exception,
-
4551  R"({
-
4552  "method" : "peer_reservations_del",
-
4553  "params" : [
-
4554  {
-
4555  "api_version" : %MAX_API_VER%,
-
4556  "public_key" : "public_key_string"
-
4557  }
-
4558  ]
-
4559  })"},
-
4560  {"peer_reservations_del: too few arguments.",
-
4561  __LINE__,
-
4562  {"peer_reservations_del"},
-
4563  RPCCallTestData::no_exception,
-
4564  R"({
-
4565  "method" : "peer_reservations_del",
-
4566  "params" : [
-
4567  {
-
4568  "error" : "badSyntax",
-
4569  "error_code" : 1,
-
4570  "error_message" : "Syntax error."
-
4571  }
-
4572  ]
-
4573  })"},
-
4574  {"peer_reservations_del: too many arguments.",
-
4575  __LINE__,
-
4576  {"peer_reservations_del",
-
4577  "public_key_string",
-
4578  "public_key_description",
-
4579  "spare"},
-
4580  RPCCallTestData::no_exception,
-
4581  R"({
-
4582  "method" : "peer_reservations_del",
-
4583  "params" : [
-
4584  {
-
4585  "error" : "badSyntax",
-
4586  "error_code" : 1,
-
4587  "error_message" : "Syntax error."
-
4588  }
-
4589  ]
-
4590  })"},
-
4591 
-
4592  // ping
-
4593  // ------------------------------------------------------------------------
-
4594  {"ping: minimal.",
-
4595  __LINE__,
-
4596  {
-
4597  "ping",
-
4598  },
-
4599  RPCCallTestData::no_exception,
-
4600  R"({
-
4601  "method" : "ping",
-
4602  "params" : [
-
4603  {
-
4604  "api_version" : %MAX_API_VER%,
-
4605  }
-
4606  ]
-
4607  })"},
-
4608  {"ping: too many arguments.",
-
4609  __LINE__,
-
4610  {"ping", "extra"},
-
4611  RPCCallTestData::no_exception,
-
4612  R"({
-
4613  "method" : "ping",
-
4614  "params" : [
-
4615  {
-
4616  "error" : "badSyntax",
-
4617  "error_code" : 1,
-
4618  "error_message" : "Syntax error."
-
4619  }
-
4620  ]
-
4621  })"},
-
4622 
-
4623  // print
-
4624  // -----------------------------------------------------------------------
-
4625  {"print: minimal.",
-
4626  __LINE__,
-
4627  {
-
4628  "print",
-
4629  },
-
4630  RPCCallTestData::no_exception,
-
4631  R"({
-
4632  "method" : "print",
-
4633  "params" : [
-
4634  {
-
4635  "api_version" : %MAX_API_VER%,
-
4636  }
-
4637  ]
-
4638  })"},
-
4639  {// The docs indicate that no arguments are allowed. So should this error?
-
4640  "print: extra argument.",
-
4641  __LINE__,
-
4642  {"print", "extra"},
-
4643  RPCCallTestData::no_exception,
-
4644  R"({
-
4645  "method" : "print",
-
4646  "params" : [
-
4647  {
-
4648  "api_version" : %MAX_API_VER%,
-
4649  "params" : [ "extra" ]
-
4650  }
-
4651  ]
-
4652  })"},
-
4653  {"print: too many arguments.",
-
4654  __LINE__,
-
4655  {"print", "extra1", "extra2"},
-
4656  RPCCallTestData::no_exception,
-
4657  R"({
-
4658  "method" : "print",
-
4659  "params" : [
-
4660  {
-
4661  "error" : "badSyntax",
-
4662  "error_code" : 1,
-
4663  "error_message" : "Syntax error."
-
4664  }
-
4665  ]
-
4666  })"},
-
4667 
-
4668  // random
-
4669  // ----------------------------------------------------------------------
-
4670  {"random: minimal.",
-
4671  __LINE__,
-
4672  {
-
4673  "random",
-
4674  },
-
4675  RPCCallTestData::no_exception,
-
4676  R"({
-
4677  "method" : "random",
-
4678  "params" : [
-
4679  {
-
4680  "api_version" : %MAX_API_VER%,
-
4681  }
-
4682  ]
-
4683  })"},
-
4684  {"random: too many arguments.",
-
4685  __LINE__,
-
4686  {"random", "extra"},
-
4687  RPCCallTestData::no_exception,
-
4688  R"({
-
4689  "method" : "random",
-
4690  "params" : [
-
4691  {
-
4692  "error" : "badSyntax",
-
4693  "error_code" : 1,
-
4694  "error_message" : "Syntax error."
-
4695  }
-
4696  ]
-
4697  })"},
-
4698 
-
4699  // ripple_path_find
-
4700  // ------------------------------------------------------------
-
4701  {"ripple_path_find: minimal.",
-
4702  __LINE__,
-
4703  {
-
4704  "ripple_path_find",
-
4705  R"({"json_argument":true})",
-
4706  },
-
4707  RPCCallTestData::no_exception,
-
4708  R"({
-
4709  "method" : "ripple_path_find",
-
4710  "params" : [
-
4711  {
-
4712  "api_version" : %MAX_API_VER%,
-
4713  "json_argument" : true
-
4714  }
-
4715  ]
-
4716  })"},
-
4717  {"ripple_path_find: ledger index.",
-
4718  __LINE__,
-
4719  {"ripple_path_find", R"({"json_argument":true})", "4294967295"},
-
4720  RPCCallTestData::no_exception,
-
4721  R"({
-
4722  "method" : "ripple_path_find",
-
4723  "params" : [
-
4724  {
-
4725  "api_version" : %MAX_API_VER%,
-
4726  "json_argument" : true,
-
4727  "ledger_index" : 4294967295
-
4728  }
-
4729  ]
-
4730  })"},
-
4731  {"ripple_path_find: text ledger index.",
-
4732  __LINE__,
-
4733  {"ripple_path_find", R"({"json_argument":true})", "closed"},
-
4734  RPCCallTestData::no_exception,
-
4735  R"({
-
4736  "method" : "ripple_path_find",
-
4737  "params" : [
-
4738  {
-
4739  "api_version" : %MAX_API_VER%,
-
4740  "json_argument" : true,
-
4741  "ledger_index" : "closed"
-
4742  }
-
4743  ]
-
4744  })"},
-
4745  {"ripple_path_find: ledger hash.",
-
4746  __LINE__,
-
4747  {"ripple_path_find",
-
4748  R"({"json_argument":true})",
-
4749  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"},
-
4750  RPCCallTestData::no_exception,
-
4751  R"({
-
4752  "method" : "ripple_path_find",
-
4753  "params" : [
-
4754  {
-
4755  "api_version" : %MAX_API_VER%,
-
4756  "json_argument" : true,
-
4757  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
4758  }
-
4759  ]
-
4760  })"},
-
4761 
-
4762  {"ripple_path_find: too few arguments.",
-
4763  __LINE__,
-
4764  {
-
4765  "ripple_path_find",
-
4766  },
-
4767  RPCCallTestData::no_exception,
-
4768  R"({
-
4769  "method" : "ripple_path_find",
-
4770  "params" : [
-
4771  {
-
4772  "error" : "badSyntax",
-
4773  "error_code" : 1,
-
4774  "error_message" : "Syntax error."
-
4775  }
-
4776  ]
-
4777  })"},
-
4778  {"ripple_path_find: too many arguments.",
-
4779  __LINE__,
-
4780  {"ripple_path_find", R"({"json_argument":true})", "current", "extra"},
-
4781  RPCCallTestData::no_exception,
-
4782  R"({
-
4783  "method" : "ripple_path_find",
-
4784  "params" : [
-
4785  {
-
4786  "error" : "badSyntax",
-
4787  "error_code" : 1,
-
4788  "error_message" : "Syntax error."
-
4789  }
-
4790  ]
-
4791  })"},
-
4792  {"ripple_path_find: invalid json (note extra comma).",
-
4793  __LINE__,
-
4794  {
-
4795  "ripple_path_find",
-
4796  R"({"json_argument":true,})",
-
4797  },
-
4798  RPCCallTestData::no_exception,
-
4799  R"({
-
4800  "method" : "ripple_path_find",
-
4801  "params" : [
-
4802  {
-
4803  "error" : "invalidParams",
-
4804  "error_code" : 31,
-
4805  "error_message" : "Invalid parameters."
-
4806  }
-
4807  ]
-
4808  })"},
-
4809  {"ripple_path_find: ledger index too small.",
-
4810  __LINE__,
-
4811  {"ripple_path_find", R"({"json_argument":true})", "-1"},
-
4812  RPCCallTestData::no_exception,
-
4813  R"({
-
4814  "method" : "ripple_path_find",
-
4815  "params" : [
-
4816  {
-
4817  "api_version" : %MAX_API_VER%,
-
4818  "json_argument" : true,
-
4819  "ledger_index" : 0
-
4820  }
-
4821  ]
-
4822  })"},
-
4823  {"ripple_path_find: ledger index too big.",
-
4824  __LINE__,
-
4825  {"ripple_path_find", R"({"json_argument":true})", "4294967296"},
-
4826  RPCCallTestData::no_exception,
-
4827  R"({
-
4828  "method" : "ripple_path_find",
-
4829  "params" : [
-
4830  {
-
4831  "api_version" : %MAX_API_VER%,
-
4832  "json_argument" : true,
-
4833  "ledger_index" : 0
-
4834  }
-
4835  ]
-
4836  })"},
-
4837  {"ripple_path_find: invalid text ledger index.",
-
4838  __LINE__,
-
4839  {"ripple_path_find", R"({"json_argument":true})", "cur"},
-
4840  RPCCallTestData::no_exception,
-
4841  R"({
-
4842  "method" : "ripple_path_find",
-
4843  "params" : [
-
4844  {
-
4845  "api_version" : %MAX_API_VER%,
-
4846  "json_argument" : true,
-
4847  "ledger_index" : 0
-
4848  }
-
4849  ]
-
4850  })"},
-
4851 
-
4852  // sign
-
4853  // ------------------------------------------------------------------------
-
4854  {"sign: minimal.",
-
4855  __LINE__,
-
4856  {
-
4857  "sign",
-
4858  "my_secret",
-
4859  R"({"json_argument":true})",
-
4860  },
-
4861  RPCCallTestData::no_exception,
-
4862  R"({
-
4863  "method" : "sign",
-
4864  "params" : [
-
4865  {
-
4866  "api_version" : %MAX_API_VER%,
-
4867  "secret" : "my_secret",
-
4868  "tx_json" : {
-
4869  "json_argument" : true
-
4870  }
-
4871  }
-
4872  ]
-
4873  })"},
-
4874  {"sign: offline.",
-
4875  __LINE__,
-
4876  {"sign", "my_secret", R"({"json_argument":true})", "offline"},
-
4877  RPCCallTestData::no_exception,
-
4878  R"({
-
4879  "method" : "sign",
-
4880  "params" : [
-
4881  {
-
4882  "api_version" : %MAX_API_VER%,
-
4883  "offline" : true,
-
4884  "secret" : "my_secret",
-
4885  "tx_json" : {
-
4886  "json_argument" : true
-
4887  }
-
4888  }
-
4889  ]
-
4890  })"},
-
4891  {"sign: too few arguments.",
-
4892  __LINE__,
-
4893  {"sign", "contents_of_blob"},
-
4894  RPCCallTestData::no_exception,
-
4895  R"({
-
4896  "method" : "sign",
-
4897  "params" : [
-
4898  {
-
4899  "error" : "badSyntax",
-
4900  "error_code" : 1,
-
4901  "error_message" : "Syntax error."
-
4902  }
-
4903  ]
-
4904  })"},
-
4905  {"sign: too many arguments.",
-
4906  __LINE__,
-
4907  {"sign", "my_secret", R"({"json_argument":true})", "offline", "extra"},
-
4908  RPCCallTestData::no_exception,
-
4909  R"({
-
4910  "method" : "sign",
-
4911  "params" : [
-
4912  {
-
4913  "error" : "badSyntax",
-
4914  "error_code" : 1,
-
4915  "error_message" : "Syntax error."
-
4916  }
-
4917  ]
-
4918  })"},
-
4919  {"sign: invalid JSON (note extra comma).",
-
4920  __LINE__,
-
4921  {
-
4922  "sign",
-
4923  "my_secret",
-
4924  R"({"json_argument":true,})",
-
4925  },
-
4926  RPCCallTestData::no_exception,
-
4927  R"({
-
4928  "method" : "sign",
-
4929  "params" : [
-
4930  {
-
4931  "error" : "invalidParams",
-
4932  "error_code" : 31,
-
4933  "error_message" : "Invalid parameters."
-
4934  }
-
4935  ]
-
4936  })"},
-
4937  {"sign: invalid final argument.",
-
4938  __LINE__,
-
4939  {"sign", "my_secret", R"({"json_argument":true})", "offlin"},
-
4940  RPCCallTestData::no_exception,
-
4941  R"({
-
4942  "method" : "sign",
-
4943  "params" : [
-
4944  {
-
4945  "error" : "invalidParams",
-
4946  "error_code" : 31,
-
4947  "error_message" : "Invalid parameters."
-
4948  }
-
4949  ]
-
4950  })"},
-
4951 
-
4952  // sign_for
-
4953  // --------------------------------------------------------------------
-
4954  {"sign_for: minimal.",
-
4955  __LINE__,
-
4956  {
-
4957  "sign_for",
-
4958  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4959  "my_secret",
-
4960  R"({"json_argument":true})",
-
4961  },
-
4962  RPCCallTestData::no_exception,
-
4963  R"({
-
4964  "method" : "sign_for",
-
4965  "params" : [
-
4966  {
-
4967  "api_version" : %MAX_API_VER%,
-
4968  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4969  "secret" : "my_secret",
-
4970  "tx_json" : {
-
4971  "json_argument" : true
-
4972  }
-
4973  }
-
4974  ]
-
4975  })"},
-
4976  {"sign_for: offline.",
-
4977  __LINE__,
-
4978  {"sign_for",
-
4979  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4980  "my_secret",
-
4981  R"({"json_argument":true})",
-
4982  "offline"},
-
4983  RPCCallTestData::no_exception,
-
4984  R"({
-
4985  "method" : "sign_for",
-
4986  "params" : [
-
4987  {
-
4988  "api_version" : %MAX_API_VER%,
-
4989  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
4990  "offline" : true,
-
4991  "secret" : "my_secret",
-
4992  "tx_json" : {
-
4993  "json_argument" : true
-
4994  }
-
4995  }
-
4996  ]
-
4997  })"},
-
4998  {"sign_for: too few arguments.",
-
4999  __LINE__,
-
5000  {
-
5001  "sign_for",
-
5002  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5003  "my_secret",
-
5004  },
-
5005  RPCCallTestData::no_exception,
-
5006  R"({
-
5007  "method" : "sign_for",
-
5008  "params" : [
-
5009  {
-
5010  "error" : "badSyntax",
-
5011  "error_code" : 1,
-
5012  "error_message" : "Syntax error."
-
5013  }
-
5014  ]
-
5015  })"},
-
5016  {"sign_for: too many arguments.",
-
5017  __LINE__,
-
5018  {"sign_for",
-
5019  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5020  "my_secret",
-
5021  R"({"json_argument":true})",
-
5022  "offline",
-
5023  "extra"},
-
5024  RPCCallTestData::no_exception,
-
5025  R"({
-
5026  "method" : "sign_for",
-
5027  "params" : [
-
5028  {
-
5029  "error" : "badSyntax",
-
5030  "error_code" : 1,
-
5031  "error_message" : "Syntax error."
-
5032  }
-
5033  ]
-
5034  })"},
-
5035  {"sign_for: invalid json (note extra comma).",
-
5036  __LINE__,
-
5037  {
-
5038  "sign_for",
-
5039  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5040  "my_secret",
-
5041  R"({"json_argument":true,})",
-
5042  },
-
5043  RPCCallTestData::no_exception,
-
5044  R"({
-
5045  "method" : "sign_for",
-
5046  "params" : [
-
5047  {
-
5048  "error" : "invalidParams",
-
5049  "error_code" : 31,
-
5050  "error_message" : "Invalid parameters."
-
5051  }
-
5052  ]
-
5053  })"},
-
5054  {"sign_for: invalid final argument.",
-
5055  __LINE__,
-
5056  {"sign_for",
-
5057  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5058  "my_secret",
-
5059  R"({"json_argument":true})",
-
5060  "ofline"},
-
5061  RPCCallTestData::no_exception,
-
5062  R"({
-
5063  "method" : "sign_for",
-
5064  "params" : [
-
5065  {
-
5066  "error" : "invalidParams",
-
5067  "error_code" : 31,
-
5068  "error_message" : "Invalid parameters."
-
5069  }
-
5070  ]
-
5071  })"},
-
5072 
-
5073  // submit
-
5074  // ----------------------------------------------------------------------
-
5075  {"submit: blob.",
-
5076  __LINE__,
-
5077  {"submit", "the blob is unvalidated and may be any length..."},
-
5078  RPCCallTestData::no_exception,
-
5079  R"({
-
5080  "method" : "submit",
-
5081  "params" : [
-
5082  {
-
5083  "api_version" : %MAX_API_VER%,
-
5084  "tx_blob" : "the blob is unvalidated and may be any length..."
-
5085  }
-
5086  ]
-
5087  })"},
-
5088  {"submit: json.",
-
5089  __LINE__,
-
5090  {
-
5091  "submit",
-
5092  "my_secret",
-
5093  R"({"json_argument":true})",
-
5094  },
-
5095  RPCCallTestData::no_exception,
-
5096  R"({
-
5097  "method" : "submit",
-
5098  "params" : [
-
5099  {
-
5100  "api_version" : %MAX_API_VER%,
-
5101  "secret" : "my_secret",
-
5102  "tx_json" : {
-
5103  "json_argument" : true
-
5104  }
-
5105  }
-
5106  ]
-
5107  })"},
-
5108  {"submit: too few arguments.",
-
5109  __LINE__,
-
5110  {
-
5111  "submit",
-
5112  },
-
5113  RPCCallTestData::no_exception,
-
5114  R"({
-
5115  "method" : "submit",
-
5116  "params" : [
-
5117  {
-
5118  "error" : "badSyntax",
-
5119  "error_code" : 1,
-
5120  "error_message" : "Syntax error."
-
5121  }
-
5122  ]
-
5123  })"},
-
5124  {// Note: I believe this _ought_ to be detected as too many arguments.
-
5125  "submit: four arguments.",
-
5126  __LINE__,
-
5127  {"submit", "my_secret", R"({"json_argument":true})", "offline"},
-
5128  RPCCallTestData::no_exception,
-
5129  R"({
-
5130  "method" : "submit",
-
5131  "params" : [
-
5132  {
-
5133  "api_version" : %MAX_API_VER%,
-
5134  "offline" : true,
-
5135  "secret" : "my_secret",
-
5136  "tx_json" : {
-
5137  "json_argument" : true
-
5138  }
-
5139  }
-
5140  ]
-
5141  })"},
-
5142  {"submit: too many arguments.",
-
5143  __LINE__,
-
5144  {"submit", "my_secret", R"({"json_argument":true})", "offline", "extra"},
-
5145  RPCCallTestData::no_exception,
-
5146  R"({
-
5147  "method" : "submit",
-
5148  "params" : [
-
5149  {
-
5150  "error" : "badSyntax",
-
5151  "error_code" : 1,
-
5152  "error_message" : "Syntax error."
-
5153  }
-
5154  ]
-
5155  })"},
-
5156  {"submit: invalid json (note extra comma).",
-
5157  __LINE__,
-
5158  {
-
5159  "submit",
-
5160  "my_secret",
-
5161  R"({"json_argument":true,})",
-
5162  },
-
5163  RPCCallTestData::no_exception,
-
5164  R"({
-
5165  "method" : "submit",
-
5166  "params" : [
-
5167  {
-
5168  "error" : "invalidParams",
-
5169  "error_code" : 31,
-
5170  "error_message" : "Invalid parameters."
-
5171  }
-
5172  ]
-
5173  })"},
-
5174  {"submit: last argument not \"offline\".",
-
5175  __LINE__,
-
5176  {"submit", "my_secret", R"({"json_argument":true})", "offlne"},
-
5177  RPCCallTestData::no_exception,
-
5178  R"({
-
5179  "method" : "submit",
-
5180  "params" : [
-
5181  {
-
5182  "error" : "invalidParams",
-
5183  "error_code" : 31,
-
5184  "error_message" : "Invalid parameters."
-
5185  }
-
5186  ]
-
5187  })"},
-
5188 
-
5189  // submit_multisigned
-
5190  // ----------------------------------------------------------
-
5191  {"submit_multisigned: json.",
-
5192  __LINE__,
-
5193  {
-
5194  "submit_multisigned",
-
5195  R"({"json_argument":true})",
-
5196  },
-
5197  RPCCallTestData::no_exception,
-
5198  R"({
-
5199  "method" : "submit_multisigned",
-
5200  "params" : [
-
5201  {
-
5202  "api_version" : %MAX_API_VER%,
-
5203  "tx_json" : {
-
5204  "json_argument" : true
-
5205  }
-
5206  }
-
5207  ]
-
5208  })"},
-
5209  {"submit_multisigned: too few arguments.",
-
5210  __LINE__,
-
5211  {
-
5212  "submit_multisigned",
-
5213  },
-
5214  RPCCallTestData::no_exception,
-
5215  R"({
-
5216  "method" : "submit_multisigned",
-
5217  "params" : [
-
5218  {
-
5219  "error" : "badSyntax",
-
5220  "error_code" : 1,
-
5221  "error_message" : "Syntax error."
-
5222  }
-
5223  ]
-
5224  })"},
-
5225  {"submit_multisigned: too many arguments.",
-
5226  __LINE__,
-
5227  {"submit_multisigned", R"({"json_argument":true})", "extra"},
-
5228  RPCCallTestData::no_exception,
-
5229  R"({
-
5230  "method" : "submit_multisigned",
-
5231  "params" : [
-
5232  {
-
5233  "error" : "badSyntax",
-
5234  "error_code" : 1,
-
5235  "error_message" : "Syntax error."
-
5236  }
-
5237  ]
-
5238  })"},
-
5239  {"submit_multisigned: invalid json (note extra comma).",
-
5240  __LINE__,
-
5241  {
-
5242  "submit_multisigned",
-
5243  R"({"json_argument":true,})",
-
5244  },
-
5245  RPCCallTestData::no_exception,
-
5246  R"({
-
5247  "method" : "submit_multisigned",
-
5248  "params" : [
-
5249  {
-
5250  "error" : "invalidParams",
-
5251  "error_code" : 31,
-
5252  "error_message" : "Invalid parameters."
-
5253  }
-
5254  }
-
5255  ]
-
5256  })"},
-
5257 
-
5258  // server_info
-
5259  // -----------------------------------------------------------------
-
5260  {"server_info: minimal.",
-
5261  __LINE__,
-
5262  {
-
5263  "server_info",
-
5264  },
-
5265  RPCCallTestData::no_exception,
-
5266  R"({
-
5267  "method" : "server_info",
-
5268  "params" : [
-
5269  {
-
5270  "api_version" : %MAX_API_VER%,
-
5271  }
-
5272  ]
-
5273  })"},
-
5274  {"server_info: counters.",
-
5275  __LINE__,
-
5276  {"server_info", "counters"},
-
5277  RPCCallTestData::no_exception,
-
5278  R"({
-
5279  "method" : "server_info",
-
5280  "params" : [
-
5281  {
-
5282  "api_version" : %MAX_API_VER%,
-
5283  "counters" : true
-
5284  }
-
5285  ]
-
5286  })"},
-
5287  {"server_info: too many arguments.",
-
5288  __LINE__,
-
5289  {"server_info", "counters", "extra"},
-
5290  RPCCallTestData::no_exception,
-
5291  R"({
-
5292  "method" : "server_info",
-
5293  "params" : [
-
5294  {
-
5295  "error" : "badSyntax",
-
5296  "error_code" : 1,
-
5297  "error_message" : "Syntax error."
-
5298  }
-
5299  ]
-
5300  })"},
-
5301  {"server_info: non-counters argument.",
-
5302  __LINE__,
-
5303  {"server_info", "counter"},
-
5304  RPCCallTestData::no_exception,
-
5305  R"({
-
5306  "method" : "server_info",
-
5307  "params" : [
-
5308  {
-
5309  "api_version" : %MAX_API_VER%,
-
5310  }
-
5311  ]
-
5312  })"},
-
5313 
-
5314  // server_state
-
5315  // ----------------------------------------------------------------
-
5316  {"server_state: minimal.",
-
5317  __LINE__,
-
5318  {
-
5319  "server_state",
-
5320  },
-
5321  RPCCallTestData::no_exception,
-
5322  R"({
-
5323  "method" : "server_state",
-
5324  "params" : [
-
5325  {
-
5326  "api_version" : %MAX_API_VER%,
-
5327  }
-
5328  ]
-
5329  })"},
-
5330  {"server_state: counters.",
-
5331  __LINE__,
-
5332  {"server_state", "counters"},
-
5333  RPCCallTestData::no_exception,
-
5334  R"({
-
5335  "method" : "server_state",
-
5336  "params" : [
-
5337  {
-
5338  "api_version" : %MAX_API_VER%,
-
5339  "counters" : true
-
5340  }
-
5341  ]
-
5342  })"},
-
5343  {"server_state: too many arguments.",
-
5344  __LINE__,
-
5345  {"server_state", "counters", "extra"},
-
5346  RPCCallTestData::no_exception,
-
5347  R"({
-
5348  "method" : "server_state",
-
5349  "params" : [
-
5350  {
-
5351  "error" : "badSyntax",
-
5352  "error_code" : 1,
-
5353  "error_message" : "Syntax error."
-
5354  }
-
5355  ]
-
5356  })"},
-
5357  {"server_state: non-counters argument.",
-
5358  __LINE__,
-
5359  {"server_state", "counter"},
-
5360  RPCCallTestData::no_exception,
-
5361  R"({
-
5362  "method" : "server_state",
-
5363  "params" : [
-
5364  {
-
5365  "api_version" : %MAX_API_VER%,
-
5366  }
-
5367  ]
-
5368  })"},
-
5369 
-
5370  // stop
-
5371  // ------------------------------------------------------------------------
-
5372  {"stop: minimal.",
-
5373  __LINE__,
-
5374  {
-
5375  "stop",
-
5376  },
-
5377  RPCCallTestData::no_exception,
-
5378  R"({
-
5379  "method" : "stop",
-
5380  "params" : [
-
5381  {
-
5382  "api_version" : %MAX_API_VER%,
-
5383  }
-
5384  ]
-
5385  })"},
-
5386  {"stop: too many arguments.",
-
5387  __LINE__,
-
5388  {"stop", "extra"},
-
5389  RPCCallTestData::no_exception,
-
5390  R"({
-
5391  "method" : "stop",
-
5392  "params" : [
-
5393  {
-
5394  "error" : "badSyntax",
-
5395  "error_code" : 1,
-
5396  "error_message" : "Syntax error."
-
5397  }
-
5398  ]
-
5399  })"},
-
5400 
-
5401  // transaction_entry
-
5402  // -----------------------------------------------------------
-
5403  {"transaction_entry: ledger index.",
-
5404  __LINE__,
-
5405  {"transaction_entry",
-
5406  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5407  "4294967295"},
-
5408  RPCCallTestData::no_exception,
-
5409  R"({
-
5410  "method" : "transaction_entry",
-
5411  "params" : [
-
5412  {
-
5413  "api_version" : %MAX_API_VER%,
-
5414  "ledger_index" : 4294967295,
-
5415  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
5416  }
-
5417  ]
-
5418  })"},
-
5419  {"transaction_entry: text ledger index.",
-
5420  __LINE__,
-
5421  {"transaction_entry",
-
5422  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5423  "current"},
-
5424  RPCCallTestData::no_exception,
-
5425  R"({
-
5426  "method" : "transaction_entry",
-
5427  "params" : [
-
5428  {
-
5429  "api_version" : %MAX_API_VER%,
-
5430  "ledger_index" : "current",
-
5431  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
5432  }
-
5433  ]
-
5434  })"},
-
5435  {"transaction_entry: ledger hash.",
-
5436  __LINE__,
-
5437  {"transaction_entry",
-
5438  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5439  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210"},
-
5440  RPCCallTestData::no_exception,
-
5441  R"({
-
5442  "method" : "transaction_entry",
-
5443  "params" : [
-
5444  {
-
5445  "api_version" : %MAX_API_VER%,
-
5446  "ledger_hash" : "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210",
-
5447  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
-
5448  }
-
5449  ]
-
5450  })"},
-
5451  {"transaction_entry: too few arguments.",
-
5452  __LINE__,
-
5453  {
-
5454  "transaction_entry",
-
5455  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5456  },
-
5457  RPCCallTestData::no_exception,
-
5458  R"({
-
5459  "method" : "transaction_entry",
-
5460  "params" : [
-
5461  {
-
5462  "error" : "badSyntax",
-
5463  "error_code" : 1,
-
5464  "error_message" : "Syntax error."
-
5465  }
-
5466  ]
-
5467  })"},
-
5468  {"transaction_entry: too many arguments.",
-
5469  __LINE__,
-
5470  {"transaction_entry",
-
5471  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5472  "validated",
-
5473  "extra"},
-
5474  RPCCallTestData::no_exception,
-
5475  R"({
-
5476  "method" : "transaction_entry",
-
5477  "params" : [
-
5478  {
-
5479  "error" : "badSyntax",
-
5480  "error_code" : 1,
-
5481  "error_message" : "Syntax error."
-
5482  }
-
5483  ]
-
5484  })"},
-
5485  {"transaction_entry: short tx_hash.",
-
5486  __LINE__,
-
5487  {
-
5488  "transaction_entry",
-
5489  "123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5490  "validated",
-
5491  },
-
5492  RPCCallTestData::no_exception,
-
5493  R"({
-
5494  "method" : "transaction_entry",
-
5495  "params" : [
-
5496  {
-
5497  "error" : "invalidParams",
-
5498  "error_code" : 31,
-
5499  "error_message" : "Invalid parameters."
-
5500  }
-
5501  ]
-
5502  })"},
-
5503  {"transaction_entry: long tx_hash.",
-
5504  __LINE__,
-
5505  {
-
5506  "transaction_entry",
-
5507  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUVW",
-
5508  "validated",
-
5509  },
-
5510  RPCCallTestData::no_exception,
-
5511  R"({
-
5512  "method" : "transaction_entry",
-
5513  "params" : [
-
5514  {
-
5515  "error" : "invalidParams",
-
5516  "error_code" : 31,
-
5517  "error_message" : "Invalid parameters."
-
5518  }
-
5519  ]
-
5520  })"},
-
5521  {"transaction_entry: small ledger index.",
-
5522  __LINE__,
-
5523  {
-
5524  "transaction_entry",
-
5525  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5526  "0",
-
5527  },
-
5528  RPCCallTestData::no_exception,
-
5529  R"({
-
5530  "method" : "transaction_entry",
-
5531  "params" : [
-
5532  {
-
5533  "error" : "invalidParams",
-
5534  "error_code" : 31,
-
5535  "error_message" : "Invalid parameters."
-
5536  }
-
5537  ]
-
5538  })"},
-
5539  {"transaction_entry: large ledger index.",
-
5540  __LINE__,
-
5541  {
-
5542  "transaction_entry",
-
5543  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5544  "4294967296",
-
5545  },
-
5546  RPCCallTestData::no_exception,
-
5547  R"({
-
5548  "method" : "transaction_entry",
-
5549  "params" : [
-
5550  {
-
5551  "error" : "invalidParams",
-
5552  "error_code" : 31,
-
5553  "error_message" : "Invalid parameters."
-
5554  }
-
5555  ]
-
5556  })"},
-
5557  {"transaction_entry: short ledger hash.",
-
5558  __LINE__,
-
5559  {
-
5560  "transaction_entry",
-
5561  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5562  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA987654321",
-
5563  },
-
5564  RPCCallTestData::no_exception,
-
5565  R"({
-
5566  "method" : "transaction_entry",
-
5567  "params" : [
-
5568  {
-
5569  "error" : "invalidParams",
-
5570  "error_code" : 31,
-
5571  "error_message" : "Invalid parameters."
-
5572  }
-
5573  ]
-
5574  })"},
-
5575  {"transaction_entry: long ledger hash.",
-
5576  __LINE__,
-
5577  {
-
5578  "transaction_entry",
-
5579  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
-
5580  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210Z",
-
5581  },
-
5582  RPCCallTestData::no_exception,
-
5583  R"({
-
5584  "method" : "transaction_entry",
-
5585  "params" : [
-
5586  {
-
5587  "error" : "invalidParams",
-
5588  "error_code" : 31,
-
5589  "error_message" : "Invalid parameters."
-
5590  }
-
5591  ]
-
5592  })"},
-
5593 
-
5594  // tx
-
5595  // --------------------------------------------------------------------------
-
5596  {"tx: ctid. minimal",
-
5597  __LINE__,
-
5598  {"tx", "FFFFFFFFFFFFFFFF", "1", "2"},
-
5599  RPCCallTestData::no_exception,
-
5600  R"({
-
5601  "method" : "tx",
-
5602  "params" : [
-
5603  {
-
5604  "api_version" : %MAX_API_VER%,
-
5605  "ctid" : "FFFFFFFFFFFFFFFF",
-
5606  "max_ledger" : "2",
-
5607  "min_ledger" : "1"
-
5608  }
-
5609  ]
-
5610  })"},
-
5611  {"tx: ctid. binary",
-
5612  __LINE__,
-
5613  {"tx", "FFFFFFFFFFFFFFFF", "binary", "1", "2"},
-
5614  RPCCallTestData::no_exception,
-
5615  R"({
-
5616  "method" : "tx",
-
5617  "params" : [
-
5618  {
-
5619  "api_version" : %MAX_API_VER%,
-
5620  "binary" : true,
-
5621  "ctid" : "FFFFFFFFFFFFFFFF",
-
5622  "max_ledger" : "2",
-
5623  "min_ledger" : "1"
-
5624  }
-
5625  ]
-
5626  })"},
-
5627  {"tx: minimal.",
-
5628  __LINE__,
-
5629  {"tx", "transaction_hash_is_not_validated"},
-
5630  RPCCallTestData::no_exception,
-
5631  R"({
-
5632  "method" : "tx",
-
5633  "params" : [
-
5634  {
-
5635  "api_version" : %MAX_API_VER%,
-
5636  "transaction" : "transaction_hash_is_not_validated"
-
5637  }
-
5638  ]
-
5639  })"},
-
5640  {"tx: binary.",
-
5641  __LINE__,
-
5642  {"tx", "transaction_hash_is_not_validated", "binary"},
-
5643  RPCCallTestData::no_exception,
-
5644  R"({
-
5645  "method" : "tx",
-
5646  "params" : [
-
5647  {
-
5648  "api_version" : %MAX_API_VER%,
-
5649  "binary" : true,
-
5650  "transaction" : "transaction_hash_is_not_validated"
-
5651  }
-
5652  ]
-
5653  })"},
-
5654  {"tx: too few arguments.",
-
5655  __LINE__,
-
5656  {
-
5657  "tx",
-
5658  },
-
5659  RPCCallTestData::no_exception,
-
5660  R"({
-
5661  "method" : "tx",
-
5662  "params" : [
-
5663  {
-
5664  "error" : "badSyntax",
-
5665  "error_code" : 1,
-
5666  "error_message" : "Syntax error."
-
5667  }
-
5668  ]
-
5669  })"},
-
5670  {"tx: too many arguments.",
-
5671  __LINE__,
-
5672  {"tx", "transaction_hash_is_not_validated", "binary", "1", "2", "extra"},
-
5673  RPCCallTestData::no_exception,
-
5674  R"({
-
5675  "method" : "tx",
-
5676  "params" : [
-
5677  {
-
5678  "error" : "badSyntax",
-
5679  "error_code" : 1,
-
5680  "error_message" : "Syntax error."
-
5681  }
-
5682  ]
-
5683  })"},
-
5684  {"tx: invalid final argument is apparently ignored.",
-
5685  __LINE__,
-
5686  {"tx", "transaction_hash_is_not_validated", "bin"},
-
5687  RPCCallTestData::no_exception,
-
5688  R"({
-
5689  "method" : "tx",
-
5690  "params" : [
-
5691  {
-
5692  "api_version" : %MAX_API_VER%,
-
5693  "transaction" : "transaction_hash_is_not_validated"
-
5694  }
-
5695  ]
-
5696  })"},
-
5697 
-
5698  // tx_account
-
5699  // ------------------------------------------------------------------
-
5700  {"tx_account: minimal.",
-
5701  __LINE__,
-
5702  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
-
5703  RPCCallTestData::no_exception,
-
5704  R"({
-
5705  "method" : "tx_account",
-
5706  "params" : [
-
5707  {
-
5708  "api_version" : %MAX_API_VER%,
-
5709  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5710  }
-
5711  ]
-
5712  })"},
-
5713  {"tx_account: ledger_index .",
-
5714  __LINE__,
-
5715  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "4294967295"},
-
5716  RPCCallTestData::no_exception,
-
5717  R"({
-
5718  "method" : "tx_account",
-
5719  "params" : [
-
5720  {
-
5721  "api_version" : %MAX_API_VER%,
-
5722  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5723  "ledger_index" : 4294967295
-
5724  }
-
5725  ]
-
5726  })"},
-
5727  {"tx_account: ledger_index plus trailing params.",
-
5728  __LINE__,
-
5729  {"tx_account",
-
5730  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5731  "707",
-
5732  "forward",
-
5733  "binary",
-
5734  "count"},
-
5735  RPCCallTestData::no_exception,
-
5736  R"({
-
5737  "method" : "tx_account",
-
5738  "params" : [
-
5739  {
-
5740  "api_version" : %MAX_API_VER%,
-
5741  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5742  "binary" : true,
-
5743  "count" : true,
-
5744  "forward" : true,
-
5745  "ledger_index" : 707
-
5746  }
-
5747  ]
-
5748  })"},
-
5749  {"tx_account: ledger_index_min and _max.",
-
5750  __LINE__,
-
5751  {"tx_account",
-
5752  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5753  "2147483647",
-
5754  "2147483647"},
-
5755  RPCCallTestData::no_exception,
-
5756  R"({
-
5757  "method" : "tx_account",
-
5758  "params" : [
-
5759  {
-
5760  "api_version" : %MAX_API_VER%,
-
5761  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5762  "ledger_index_max" : 2147483647,
-
5763  "ledger_index_min" : 2147483647
-
5764  }
-
5765  ]
-
5766  })"},
-
5767  {"tx_account: ledger_index_min and _max plus trailing params.",
-
5768  __LINE__,
-
5769  {"tx_account",
-
5770  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5771  "33333",
-
5772  "2147483647",
-
5773  "binary",
-
5774  "count",
-
5775  "forward"},
-
5776  RPCCallTestData::no_exception,
-
5777  R"({
-
5778  "method" : "tx_account",
-
5779  "params" : [
-
5780  {
-
5781  "api_version" : %MAX_API_VER%,
-
5782  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5783  "binary" : true,
-
5784  "count" : true,
-
5785  "forward" : true,
-
5786  "ledger_index_max" : 2147483647,
-
5787  "ledger_index_min" : 33333
-
5788  }
-
5789  ]
-
5790  })"},
-
5791  {"tx_account: ledger_index_min and _max plus limit.",
-
5792  __LINE__,
-
5793  {"tx_account",
-
5794  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5795  "-1",
-
5796  "2147483647",
-
5797  "2147483647"},
-
5798  RPCCallTestData::no_exception,
-
5799  R"({
-
5800  "method" : "tx_account",
-
5801  "params" : [
-
5802  {
-
5803  "api_version" : %MAX_API_VER%,
-
5804  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5805  "ledger_index_max" : 2147483647,
-
5806  "ledger_index_min" : -1,
-
5807  "limit" : 2147483647
-
5808  }
-
5809  ]
-
5810  })"},
-
5811  {"tx_account: ledger_index_min and _max, limit, trailing args.",
-
5812  __LINE__,
-
5813  {"tx_account",
-
5814  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5815  "1",
+
1429  "false",
+
1430  "false"},
+
1431  RPCCallTestData::bad_cast,
+
1432  R"()"},
+
1433 
+
1434  // book_offers
+
1435  // -----------------------------------------------------------------
+
1436  {"book_offers: minimal no issuer.",
+
1437  __LINE__,
+
1438  {
+
1439  "book_offers",
+
1440  "USD",
+
1441  "EUR",
+
1442  },
+
1443  RPCCallTestData::no_exception,
+
1444  R"({
+
1445  "method" : "book_offers",
+
1446  "params" : [
+
1447  {
+
1448  "api_version" : %MAX_API_VER%,
+
1449  "taker_gets" : {
+
1450  "currency" : "EUR"
+
1451  },
+
1452  "taker_pays" : {
+
1453  "currency" : "USD"
+
1454  }
+
1455  }
+
1456  ]
+
1457  })"},
+
1458  {"book_offers: minimal with currency/issuer",
+
1459  __LINE__,
+
1460  {
+
1461  "book_offers",
+
1462  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1463  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1464  },
+
1465  RPCCallTestData::no_exception,
+
1466  R"({
+
1467  "method" : "book_offers",
+
1468  "params" : [
+
1469  {
+
1470  "api_version" : %MAX_API_VER%,
+
1471  "taker_gets" : {
+
1472  "currency" : "EUR",
+
1473  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1474  },
+
1475  "taker_pays" : {
+
1476  "currency" : "USD",
+
1477  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1478  }
+
1479  }
+
1480  ]
+
1481  })"},
+
1482  {// Note: documentation suggests that "issuer" is the wrong type.
+
1483  // Should it be "taker" instead?
+
1484  "book_offers: add issuer.",
+
1485  __LINE__,
+
1486  {"book_offers", "USD", "EUR", "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"},
+
1487  RPCCallTestData::no_exception,
+
1488  R"({
+
1489  "method" : "book_offers",
+
1490  "params" : [
+
1491  {
+
1492  "api_version" : %MAX_API_VER%,
+
1493  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1494  "taker_gets" : {
+
1495  "currency" : "EUR"
+
1496  },
+
1497  "taker_pays" : {
+
1498  "currency" : "USD"
+
1499  }
+
1500  }
+
1501  ]
+
1502  })"},
+
1503  {"book_offers: add issuer and numeric ledger index.",
+
1504  __LINE__,
+
1505  {"book_offers",
+
1506  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1507  "EUR",
+
1508  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1509  "666"},
+
1510  RPCCallTestData::no_exception,
+
1511  R"({
+
1512  "method" : "book_offers",
+
1513  "params" : [
+
1514  {
+
1515  "api_version" : %MAX_API_VER%,
+
1516  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1517  "ledger_index" : 666,
+
1518  "taker_gets" : {
+
1519  "currency" : "EUR"
+
1520  },
+
1521  "taker_pays" : {
+
1522  "currency" : "USD",
+
1523  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1524  }
+
1525  }
+
1526  ]
+
1527  })"},
+
1528  {"book_offers: add issuer and text ledger index.",
+
1529  __LINE__,
+
1530  {"book_offers",
+
1531  "USD",
+
1532  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1533  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1534  "current"},
+
1535  RPCCallTestData::no_exception,
+
1536  R"({
+
1537  "method" : "book_offers",
+
1538  "params" : [
+
1539  {
+
1540  "api_version" : %MAX_API_VER%,
+
1541  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1542  "ledger_index" : "current",
+
1543  "taker_gets" : {
+
1544  "currency" : "EUR",
+
1545  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1546  },
+
1547  "taker_pays" : {
+
1548  "currency" : "USD"
+
1549  }
+
1550  }
+
1551  ]
+
1552  })"},
+
1553  {"book_offers: add issuer and ledger hash.",
+
1554  __LINE__,
+
1555  {"book_offers",
+
1556  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1557  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1558  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1559  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
+
1560  RPCCallTestData::no_exception,
+
1561  R"({
+
1562  "method" : "book_offers",
+
1563  "params" : [
+
1564  {
+
1565  "api_version" : %MAX_API_VER%,
+
1566  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1567  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1568  "taker_gets" : {
+
1569  "currency" : "EUR",
+
1570  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1571  },
+
1572  "taker_pays" : {
+
1573  "currency" : "USD",
+
1574  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1575  }
+
1576  }
+
1577  ]
+
1578  })"},
+
1579  {"book_offers: issuer, ledger hash, and limit.",
+
1580  __LINE__,
+
1581  {
+
1582  "book_offers",
+
1583  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1584  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1585  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1586  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1587  "junk", // Note: indexing bug in parseBookOffers() requires junk
+
1588  // param.
+
1589  "200",
+
1590  },
+
1591  RPCCallTestData::no_exception,
+
1592  R"({
+
1593  "method" : "book_offers",
+
1594  "params" : [
+
1595  {
+
1596  "api_version" : %MAX_API_VER%,
+
1597  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1598  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1599  "limit" : 200,
+
1600  "proof" : true,
+
1601  "taker_gets" : {
+
1602  "currency" : "EUR",
+
1603  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1604  },
+
1605  "taker_pays" : {
+
1606  "currency" : "USD",
+
1607  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1608  }
+
1609  }
+
1610  ]
+
1611  })"},
+
1612  {// Note: parser supports "marker", but the docs don't cover it.
+
1613  "book_offers: issuer, ledger hash, limit, and marker.",
+
1614  __LINE__,
+
1615  {"book_offers",
+
1616  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1617  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1618  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1619  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1620  "junk", // Note: indexing bug in parseBookOffers() requires junk param.
+
1621  "200",
+
1622  "MyMarker"},
+
1623  RPCCallTestData::no_exception,
+
1624  R"({
+
1625  "method" : "book_offers",
+
1626  "params" : [
+
1627  {
+
1628  "api_version" : %MAX_API_VER%,
+
1629  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1630  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1631  "limit" : 200,
+
1632  "marker" : "MyMarker",
+
1633  "proof" : true,
+
1634  "taker_gets" : {
+
1635  "currency" : "EUR",
+
1636  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1637  },
+
1638  "taker_pays" : {
+
1639  "currency" : "USD",
+
1640  "issuer" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
1641  }
+
1642  }
+
1643  ]
+
1644  })"},
+
1645  {"book_offers: too few arguments.",
+
1646  __LINE__,
+
1647  {
+
1648  "book_offers",
+
1649  },
+
1650  RPCCallTestData::no_exception,
+
1651  R"({
+
1652  "method" : "book_offers",
+
1653  "params" : [
+
1654  {
+
1655  "error" : "badSyntax",
+
1656  "error_code" : 1,
+
1657  "error_message" : "Syntax error."
+
1658  }
+
1659  ]
+
1660  })"},
+
1661  {"book_offers: too many arguments.",
+
1662  __LINE__,
+
1663  {"book_offers",
+
1664  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1665  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1666  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1667  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1668  "junk", // Note: indexing bug in parseBookOffers() requires junk param.
+
1669  "200",
+
1670  "MyMarker",
+
1671  "extra"},
+
1672  RPCCallTestData::no_exception,
+
1673  R"({
+
1674  "method" : "book_offers",
+
1675  "params" : [
+
1676  {
+
1677  "error" : "badSyntax",
+
1678  "error_code" : 1,
+
1679  "error_message" : "Syntax error."
+
1680  }
+
1681  ]
+
1682  })"},
+
1683 
+
1684  {"book_offers: taker pays no currency.",
+
1685  __LINE__,
+
1686  {
+
1687  "book_offers",
+
1688  "/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1689  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1690  },
+
1691  RPCCallTestData::no_exception,
+
1692  R"({
+
1693  "method" : "book_offers",
+
1694  "params" : [
+
1695  {
+
1696  "error" : "invalidParams",
+
1697  "error_code" : 31,
+
1698  "error_message" : "Invalid currency/issuer '/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'"
+
1699  }
+
1700  ]
+
1701  })"},
+
1702  {"book_offers: taker gets no currency.",
+
1703  __LINE__,
+
1704  {
+
1705  "book_offers",
+
1706  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1707  "/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1708  },
+
1709  RPCCallTestData::no_exception,
+
1710  R"({
+
1711  "method" : "book_offers",
+
1712  "params" : [
+
1713  {
+
1714  "error" : "invalidParams",
+
1715  "error_code" : 31,
+
1716  "error_message" : "Invalid currency/issuer '/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA'"
+
1717  }
+
1718  ]
+
1719  })"},
+
1720  {"book_offers: invalid issuer.",
+
1721  __LINE__,
+
1722  {"book_offers", "USD", "EUR", "not_a_valid_issuer"},
+
1723  RPCCallTestData::no_exception,
+
1724  R"({
+
1725  "method" : "book_offers",
+
1726  "params" : [
+
1727  {
+
1728  "api_version" : %MAX_API_VER%,
+
1729  "issuer" : "not_a_valid_issuer",
+
1730  "taker_gets" : {
+
1731  "currency" : "EUR"
+
1732  },
+
1733  "taker_pays" : {
+
1734  "currency" : "USD"
+
1735  }
+
1736  }
+
1737  ]
+
1738  })"},
+
1739  {"book_offers: invalid text ledger index.",
+
1740  __LINE__,
+
1741  {"book_offers",
+
1742  "USD",
+
1743  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1744  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1745  "not_a_ledger"},
+
1746  RPCCallTestData::no_exception,
+
1747  R"({
+
1748  "method" : "book_offers",
+
1749  "params" : [
+
1750  {
+
1751  "api_version" : %MAX_API_VER%,
+
1752  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1753  "ledger_index" : 0,
+
1754  "taker_gets" : {
+
1755  "currency" : "EUR",
+
1756  "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA"
+
1757  },
+
1758  "taker_pays" : {
+
1759  "currency" : "USD"
+
1760  }
+
1761  }
+
1762  ]
+
1763  })"},
+
1764  {// Note: this really shouldn't throw, but does at the moment.
+
1765  "book_offers: non-numeric limit.",
+
1766  __LINE__,
+
1767  {
+
1768  "book_offers",
+
1769  "USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
1770  "EUR/rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1771  "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA",
+
1772  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
1773  "junk", // Note: indexing bug in parseBookOffers() requires junk
+
1774  // param.
+
1775  "not_a_number",
+
1776  },
+
1777  RPCCallTestData::bad_cast,
+
1778  R"()"},
+
1779 
+
1780  // can_delete
+
1781  // ------------------------------------------------------------------
+
1782  {"can_delete: minimal.",
+
1783  __LINE__,
+
1784  {
+
1785  "can_delete",
+
1786  },
+
1787  RPCCallTestData::no_exception,
+
1788  R"({
+
1789  "method" : "can_delete",
+
1790  "params" : [
+
1791  {
+
1792  "api_version" : %MAX_API_VER%,
+
1793  }
+
1794  ]
+
1795  })"},
+
1796  {"can_delete: ledger index.",
+
1797  __LINE__,
+
1798  {
+
1799  "can_delete",
+
1800  "4294967295",
+
1801  },
+
1802  RPCCallTestData::no_exception,
+
1803  R"({
+
1804  "method" : "can_delete",
+
1805  "params" : [
+
1806  {
+
1807  "api_version" : %MAX_API_VER%,
+
1808  "can_delete" : 4294967295
+
1809  }
+
1810  ]
+
1811  })"},
+
1812  {"can_delete: ledger hash.",
+
1813  __LINE__,
+
1814  {
+
1815  "can_delete",
+
1816  "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
+
1817  },
+
1818  RPCCallTestData::no_exception,
+
1819  R"({
+
1820  "method" : "can_delete",
+
1821  "params" : [
+
1822  {
+
1823  "api_version" : %MAX_API_VER%,
+
1824  "can_delete" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210"
+
1825  }
+
1826  ]
+
1827  })"},
+
1828  {"can_delete: always.",
+
1829  __LINE__,
+
1830  {
+
1831  "can_delete",
+
1832  "always",
+
1833  },
+
1834  RPCCallTestData::no_exception,
+
1835  R"({
+
1836  "method" : "can_delete",
+
1837  "params" : [
+
1838  {
+
1839  "api_version" : %MAX_API_VER%,
+
1840  "can_delete" : "always"
+
1841  }
+
1842  ]
+
1843  })"},
+
1844  {"can_delete: never.",
+
1845  __LINE__,
+
1846  {
+
1847  "can_delete",
+
1848  "never",
+
1849  },
+
1850  RPCCallTestData::no_exception,
+
1851  R"({
+
1852  "method" : "can_delete",
+
1853  "params" : [
+
1854  {
+
1855  "api_version" : %MAX_API_VER%,
+
1856  "can_delete" : "never"
+
1857  }
+
1858  ]
+
1859  })"},
+
1860  {"can_delete: now.",
+
1861  __LINE__,
+
1862  {
+
1863  "can_delete",
+
1864  "now",
+
1865  },
+
1866  RPCCallTestData::no_exception,
+
1867  R"({
+
1868  "method" : "can_delete",
+
1869  "params" : [
+
1870  {
+
1871  "api_version" : %MAX_API_VER%,
+
1872  "can_delete" : "now"
+
1873  }
+
1874  ]
+
1875  })"},
+
1876  {"can_delete: too many arguments.",
+
1877  __LINE__,
+
1878  {"can_delete", "always", "never"},
+
1879  RPCCallTestData::no_exception,
+
1880  R"({
+
1881  "method" : "can_delete",
+
1882  "params" : [
+
1883  {
+
1884  "error" : "badSyntax",
+
1885  "error_code" : 1,
+
1886  "error_message" : "Syntax error."
+
1887  }
+
1888  ]
+
1889  })"},
+
1890  {"can_delete: invalid argument.",
+
1891  __LINE__,
+
1892  {"can_delete", "invalid"},
+
1893  RPCCallTestData::no_exception,
+
1894  R"({
+
1895  "method" : "can_delete",
+
1896  "params" : [
+
1897  {
+
1898  "api_version" : %MAX_API_VER%,
+
1899  "can_delete" : "invalid"
+
1900  }
+
1901  ]
+
1902  })"},
+
1903  {// Note: this should return an error but not throw.
+
1904  "can_delete: ledger index > 32 bits.",
+
1905  __LINE__,
+
1906  {
+
1907  "can_delete",
+
1908  "4294967296",
+
1909  },
+
1910  RPCCallTestData::bad_cast,
+
1911  R"()"},
+
1912  {// Note: this really shouldn't throw since it's a legitimate ledger hash.
+
1913  "can_delete: ledger hash with no alphas.",
+
1914  __LINE__,
+
1915  {
+
1916  "can_delete",
+
1917  "0123456701234567012345670123456701234567012345670123456701234567",
+
1918  },
+
1919  RPCCallTestData::bad_cast,
+
1920  R"()"},
+
1921 
+
1922  // channel_authorize
+
1923  // -----------------------------------------------------------
+
1924  {"channel_authorize: minimal.",
+
1925  __LINE__,
+
1926  {"channel_authorize",
+
1927  "secret_can_be_anything",
+
1928  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
1929  "18446744073709551615"},
+
1930  RPCCallTestData::no_exception,
+
1931  R"({
+
1932  "method" : "channel_authorize",
+
1933  "params" : [
+
1934  {
+
1935  "api_version" : %MAX_API_VER%,
+
1936  "amount" : "18446744073709551615",
+
1937  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
1938  "secret" : "secret_can_be_anything"
+
1939  }
+
1940  ]
+
1941  })"},
+
1942  {"channel_authorize: too few arguments.",
+
1943  __LINE__,
+
1944  {
+
1945  "channel_authorize",
+
1946  "secret_can_be_anything",
+
1947  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
1948  },
+
1949  RPCCallTestData::no_exception,
+
1950  R"({
+
1951  "method" : "channel_authorize",
+
1952  "params" : [
+
1953  {
+
1954  "error" : "badSyntax",
+
1955  "error_code" : 1,
+
1956  "error_message" : "Syntax error."
+
1957  }
+
1958  ]
+
1959  })"},
+
1960  {"channel_authorize: too many arguments.",
+
1961  __LINE__,
+
1962  {"channel_authorize",
+
1963  "secp256k1",
+
1964  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
1965  "2000",
+
1966  "whatever",
+
1967  "whenever"},
+
1968  RPCCallTestData::no_exception,
+
1969  R"({
+
1970  "method" : "channel_authorize",
+
1971  "params" : [
+
1972  {
+
1973  "error" : "badSyntax",
+
1974  "error_code" : 1,
+
1975  "error_message" : "Syntax error."
+
1976  }
+
1977  ]
+
1978  })"},
+
1979  {"channel_authorize: bad key type.",
+
1980  __LINE__,
+
1981  {"channel_authorize",
+
1982  "secp257k1",
+
1983  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
1984  "2000",
+
1985  "whatever"},
+
1986  RPCCallTestData::no_exception,
+
1987  R"({
+
1988  "method" : "channel_authorize",
+
1989  "params" : [
+
1990  {
+
1991  "error" : "badKeyType",
+
1992  "error_code" : 1,
+
1993  "error_message" : "Bad key type."
+
1994  }
+
1995  ]
+
1996  })"},
+
1997  {"channel_authorize: channel_id too short.",
+
1998  __LINE__,
+
1999  {"channel_authorize",
+
2000  "secret_can_be_anything",
+
2001  "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2002  "2000"},
+
2003  RPCCallTestData::no_exception,
+
2004  R"({
+
2005  "method" : "channel_authorize",
+
2006  "params" : [
+
2007  {
+
2008  "error" : "channelMalformed",
+
2009  "error_code" : 43,
+
2010  "error_message" : "Payment channel is malformed."
+
2011  }
+
2012  ]
+
2013  })"},
+
2014  {"channel_authorize: channel_id too long.",
+
2015  __LINE__,
+
2016  {"channel_authorize",
+
2017  "secret_can_be_anything",
+
2018  "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2019  "2000"},
+
2020  RPCCallTestData::no_exception,
+
2021  R"({
+
2022  "method" : "channel_authorize",
+
2023  "params" : [
+
2024  {
+
2025  "error" : "channelMalformed",
+
2026  "error_code" : 43,
+
2027  "error_message" : "Payment channel is malformed."
+
2028  }
+
2029  ]
+
2030  })"},
+
2031  {"channel_authorize: channel_id not hex.",
+
2032  __LINE__,
+
2033  {"channel_authorize",
+
2034  "secret_can_be_anything",
+
2035  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEZ",
+
2036  "2000"},
+
2037  RPCCallTestData::no_exception,
+
2038  R"({
+
2039  "method" : "channel_authorize",
+
2040  "params" : [
+
2041  {
+
2042  "error" : "channelMalformed",
+
2043  "error_code" : 43,
+
2044  "error_message" : "Payment channel is malformed."
+
2045  }
+
2046  ]
+
2047  })"},
+
2048  {"channel_authorize: negative amount.",
+
2049  __LINE__,
+
2050  {"channel_authorize",
+
2051  "secret_can_be_anything",
+
2052  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2053  "-1"},
+
2054  RPCCallTestData::no_exception,
+
2055  R"({
+
2056  "method" : "channel_authorize",
+
2057  "params" : [
+
2058  {
+
2059  "error" : "channelAmtMalformed",
+
2060  "error_code" : 44,
+
2061  "error_message" : "Payment channel amount is malformed."
+
2062  }
+
2063  ]
+
2064  })"},
+
2065  {"channel_authorize: amount > 64 bits.",
+
2066  __LINE__,
+
2067  {"channel_authorize",
+
2068  "secret_can_be_anything",
+
2069  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2070  "18446744073709551616"},
+
2071  RPCCallTestData::no_exception,
+
2072  R"({
+
2073  "method" : "channel_authorize",
+
2074  "params" : [
+
2075  {
+
2076  "error" : "channelAmtMalformed",
+
2077  "error_code" : 44,
+
2078  "error_message" : "Payment channel amount is malformed."
+
2079  }
+
2080  ]
+
2081  })"},
+
2082 
+
2083  // channel_verify
+
2084  // --------------------------------------------------------------
+
2085  {"channel_verify: public key.",
+
2086  __LINE__,
+
2087  {"channel_verify",
+
2088  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2089  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2090  "0",
+
2091  "DEADBEEF"},
+
2092  RPCCallTestData::no_exception,
+
2093  R"({
+
2094  "method" : "channel_verify",
+
2095  "params" : [
+
2096  {
+
2097  "api_version" : %MAX_API_VER%,
+
2098  "amount" : "0",
+
2099  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2100  "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2101  "signature" : "DEADBEEF"
+
2102  }
+
2103  ]
+
2104  })"},
+
2105  {"channel_verify: public key hex.",
+
2106  __LINE__,
+
2107  {"channel_verify",
+
2108  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
+
2109  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2110  "18446744073709551615",
+
2111  "DEADBEEF"},
+
2112  RPCCallTestData::no_exception,
+
2113  R"({
+
2114  "method" : "channel_verify",
+
2115  "params" : [
+
2116  {
+
2117  "api_version" : %MAX_API_VER%,
+
2118  "amount" : "18446744073709551615",
+
2119  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2120  "public_key" : "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
+
2121  "signature" : "DEADBEEF"
+
2122  }
+
2123  ]
+
2124  })"},
+
2125  {"channel_verify: too few arguments.",
+
2126  __LINE__,
+
2127  {"channel_verify",
+
2128  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2129  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
2130  RPCCallTestData::no_exception,
+
2131  R"({
+
2132  "method" : "channel_verify",
+
2133  "params" : [
+
2134  {
+
2135  "error" : "badSyntax",
+
2136  "error_code" : 1,
+
2137  "error_message" : "Syntax error."
+
2138  }
+
2139  ]
+
2140  })"},
+
2141  {"channel_verify: too many arguments.",
+
2142  __LINE__,
+
2143  {"channel_verify",
+
2144  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2145  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2146  "2000",
+
2147  "DEADBEEF",
+
2148  "Whatever"},
+
2149  RPCCallTestData::no_exception,
+
2150  R"({
+
2151  "method" : "channel_verify",
+
2152  "params" : [
+
2153  {
+
2154  "error" : "badSyntax",
+
2155  "error_code" : 1,
+
2156  "error_message" : "Syntax error."
+
2157  }
+
2158  ]
+
2159  })"},
+
2160  {"channel_verify: malformed public key.",
+
2161  __LINE__,
+
2162  {"channel_verify",
+
2163  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9GoV",
+
2164  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2165  "2000",
+
2166  "DEADBEEF"},
+
2167  RPCCallTestData::no_exception,
+
2168  R"({
+
2169  "method" : "channel_verify",
+
2170  "params" : [
+
2171  {
+
2172  "error" : "publicMalformed",
+
2173  "error_code" : 60,
+
2174  "error_message" : "Public key is malformed."
+
2175  }
+
2176  ]
+
2177  })"},
+
2178  {"channel_verify: malformed hex public key.",
+
2179  __LINE__,
+
2180  {"channel_verify",
+
2181  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F",
+
2182  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2183  "2000",
+
2184  "DEADBEEF"},
+
2185  RPCCallTestData::no_exception,
+
2186  R"({
+
2187  "method" : "channel_verify",
+
2188  "params" : [
+
2189  {
+
2190  "error" : "publicMalformed",
+
2191  "error_code" : 60,
+
2192  "error_message" : "Public key is malformed."
+
2193  }
+
2194  ]
+
2195  })"},
+
2196  {"channel_verify: invalid channel id.",
+
2197  __LINE__,
+
2198  {"channel_verify",
+
2199  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2200  "10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2201  "2000",
+
2202  "DEADBEEF"},
+
2203  RPCCallTestData::no_exception,
+
2204  R"({
+
2205  "method" : "channel_verify",
+
2206  "params" : [
+
2207  {
+
2208  "error" : "channelMalformed",
+
2209  "error_code" : 43,
+
2210  "error_message" : "Payment channel is malformed."
+
2211  }
+
2212  ]
+
2213  })"},
+
2214  {"channel_verify: short channel id.",
+
2215  __LINE__,
+
2216  {"channel_verify",
+
2217  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2218  "123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2219  "2000",
+
2220  "DEADBEEF"},
+
2221  RPCCallTestData::no_exception,
+
2222  R"({
+
2223  "method" : "channel_verify",
+
2224  "params" : [
+
2225  {
+
2226  "error" : "channelMalformed",
+
2227  "error_code" : 43,
+
2228  "error_message" : "Payment channel is malformed."
+
2229  }
+
2230  ]
+
2231  })"},
+
2232  {"channel_verify: amount too small.",
+
2233  __LINE__,
+
2234  {"channel_verify",
+
2235  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
+
2236  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2237  "-1",
+
2238  "DEADBEEF"},
+
2239  RPCCallTestData::no_exception,
+
2240  R"({
+
2241  "method" : "channel_verify",
+
2242  "params" : [
+
2243  {
+
2244  "error" : "channelAmtMalformed",
+
2245  "error_code" : 44,
+
2246  "error_message" : "Payment channel amount is malformed."
+
2247  }
+
2248  ]
+
2249  })"},
+
2250  {"channel_verify: amount too large.",
+
2251  __LINE__,
+
2252  {"channel_verify",
+
2253  "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6",
+
2254  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2255  "18446744073709551616",
+
2256  "DEADBEEF"},
+
2257  RPCCallTestData::no_exception,
+
2258  R"({
+
2259  "method" : "channel_verify",
+
2260  "params" : [
+
2261  {
+
2262  "error" : "channelAmtMalformed",
+
2263  "error_code" : 44,
+
2264  "error_message" : "Payment channel amount is malformed."
+
2265  }
+
2266  ]
+
2267  })"},
+
2268  {"channel_verify: non-hex signature.",
+
2269  __LINE__,
+
2270  {"channel_verify",
+
2271  "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2272  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2273  "40000000",
+
2274  "ThisIsNotHexadecimal"},
+
2275  RPCCallTestData::no_exception,
+
2276  R"({
+
2277  "method" : "channel_verify",
+
2278  "params" : [
+
2279  {
+
2280  "api_version" : %MAX_API_VER%,
+
2281  "amount" : "40000000",
+
2282  "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
+
2283  "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov",
+
2284  "signature" : "ThisIsNotHexadecimal"
+
2285  }
+
2286  ]
+
2287  })"},
+
2288 
+
2289  // connect
+
2290  // ---------------------------------------------------------------------
+
2291  {"connect: minimal.",
+
2292  __LINE__,
+
2293  {
+
2294  "connect",
+
2295  "ThereIsNoCheckingOnTheIPFormat",
+
2296  },
+
2297  RPCCallTestData::no_exception,
+
2298  R"({
+
2299  "method" : "connect",
+
2300  "params" : [
+
2301  {
+
2302  "api_version" : %MAX_API_VER%,
+
2303  "ip" : "ThereIsNoCheckingOnTheIPFormat"
+
2304  }
+
2305  ]
+
2306  })"},
+
2307  {"connect: ip and port.",
+
2308  __LINE__,
+
2309  {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561"},
+
2310  RPCCallTestData::no_exception,
+
2311  R"({
+
2312  "method" : "connect",
+
2313  "params" : [
+
2314  {
+
2315  "api_version" : %MAX_API_VER%,
+
2316  "ip" : "ThereIsNoCheckingOnTheIPFormat",
+
2317  "port" : 6561
+
2318  }
+
2319  ]
+
2320  })"},
+
2321  {"connect: too few arguments.",
+
2322  __LINE__,
+
2323  {
+
2324  "connect",
+
2325  },
+
2326  RPCCallTestData::no_exception,
+
2327  R"({
+
2328  "method" : "connect",
+
2329  "params" : [
+
2330  {
+
2331  "error" : "badSyntax",
+
2332  "error_code" : 1,
+
2333  "error_message" : "Syntax error."
+
2334  }
+
2335  ]
+
2336  })"},
+
2337  {"connect: too many arguments.",
+
2338  __LINE__,
+
2339  {"connect", "ThereIsNoCheckingOnTheIPFormat", "6561", "extra"},
+
2340  RPCCallTestData::no_exception,
+
2341  R"({
+
2342  "method" : "connect",
+
2343  "params" : [
+
2344  {
+
2345  "error" : "badSyntax",
+
2346  "error_code" : 1,
+
2347  "error_message" : "Syntax error."
+
2348  }
+
2349  ]
+
2350  })"},
+
2351  {// Note: this should return an error but not throw.
+
2352  "connect: port too small.",
+
2353  __LINE__,
+
2354  {
+
2355  "connect",
+
2356  "ThereIsNoCheckingOnTheIPFormat",
+
2357  "-1",
+
2358  },
+
2359  RPCCallTestData::bad_cast,
+
2360  R"()"},
+
2361  {// Note: this should return an error but not throw.
+
2362  "connect: port too large.",
+
2363  __LINE__,
+
2364  {
+
2365  "connect",
+
2366  "ThereIsNoCheckingOnTheIPFormat",
+
2367  "4294967296",
+
2368  },
+
2369  RPCCallTestData::bad_cast,
+
2370  R"()"},
+
2371 
+
2372  // consensus_info
+
2373  // --------------------------------------------------------------
+
2374  {"consensus_info: minimal.",
+
2375  __LINE__,
+
2376  {
+
2377  "consensus_info",
+
2378  },
+
2379  RPCCallTestData::no_exception,
+
2380  R"({
+
2381  "method" : "consensus_info",
+
2382  "params" : [
+
2383  {
+
2384  "api_version" : %MAX_API_VER%
+
2385  }
+
2386  ]
+
2387  })"},
+
2388  {"consensus_info: too many arguments.",
+
2389  __LINE__,
+
2390  {"consensus_info", "whatever"},
+
2391  RPCCallTestData::no_exception,
+
2392  R"({
+
2393  "method" : "consensus_info",
+
2394  "params" : [
+
2395  {
+
2396  "error" : "badSyntax",
+
2397  "error_code" : 1,
+
2398  "error_message" : "Syntax error."
+
2399  }
+
2400  ]
+
2401  })"},
+
2402 
+
2403  // deposit_authorized
+
2404  // ----------------------------------------------------------
+
2405  {"deposit_authorized: minimal.",
+
2406  __LINE__,
+
2407  {
+
2408  "deposit_authorized",
+
2409  "source_account_NotValidated",
+
2410  "destination_account_NotValidated",
+
2411  },
+
2412  RPCCallTestData::no_exception,
+
2413  R"({
+
2414  "method" : "deposit_authorized",
+
2415  "params" : [
+
2416  {
+
2417  "api_version" : %MAX_API_VER%,
+
2418  "destination_account" : "destination_account_NotValidated",
+
2419  "source_account" : "source_account_NotValidated"
+
2420  }
+
2421  ]
+
2422  })"},
+
2423  {"deposit_authorized: with text ledger index.",
+
2424  __LINE__,
+
2425  {"deposit_authorized",
+
2426  "source_account_NotValidated",
+
2427  "destination_account_NotValidated",
+
2428  "validated"},
+
2429  RPCCallTestData::no_exception,
+
2430  R"({
+
2431  "method" : "deposit_authorized",
+
2432  "params" : [
+
2433  {
+
2434  "api_version" : %MAX_API_VER%,
+
2435  "destination_account" : "destination_account_NotValidated",
+
2436  "ledger_index" : "validated",
+
2437  "source_account" : "source_account_NotValidated"
+
2438  }
+
2439  ]
+
2440  })"},
+
2441  {"deposit_authorized: with ledger index.",
+
2442  __LINE__,
+
2443  {"deposit_authorized",
+
2444  "source_account_NotValidated",
+
2445  "destination_account_NotValidated",
+
2446  "4294967295"},
+
2447  RPCCallTestData::no_exception,
+
2448  R"({
+
2449  "method" : "deposit_authorized",
+
2450  "params" : [
+
2451  {
+
2452  "api_version" : %MAX_API_VER%,
+
2453  "destination_account" : "destination_account_NotValidated",
+
2454  "ledger_index" : 4294967295,
+
2455  "source_account" : "source_account_NotValidated"
+
2456  }
+
2457  ]
+
2458  })"},
+
2459  {"deposit_authorized: with ledger hash.",
+
2460  __LINE__,
+
2461  {"deposit_authorized",
+
2462  "source_account_NotValidated",
+
2463  "destination_account_NotValidated",
+
2464  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
+
2465  RPCCallTestData::no_exception,
+
2466  R"({
+
2467  "method" : "deposit_authorized",
+
2468  "params" : [
+
2469  {
+
2470  "api_version" : %MAX_API_VER%,
+
2471  "destination_account" : "destination_account_NotValidated",
+
2472  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
2473  "source_account" : "source_account_NotValidated"
+
2474  }
+
2475  ]
+
2476  })"},
+
2477  {"deposit_authorized: too few arguments.",
+
2478  __LINE__,
+
2479  {
+
2480  "deposit_authorized",
+
2481  "source_account_NotValidated",
+
2482  },
+
2483  RPCCallTestData::no_exception,
+
2484  R"({
+
2485  "method" : "deposit_authorized",
+
2486  "params" : [
+
2487  {
+
2488  "error" : "badSyntax",
+
2489  "error_code" : 1,
+
2490  "error_message" : "Syntax error."
+
2491  }
+
2492  ]
+
2493  })"},
+
2494  {"deposit_authorized: too many arguments.",
+
2495  __LINE__,
+
2496  {"deposit_authorized",
+
2497  "source_account_NotValidated",
+
2498  "destination_account_NotValidated",
+
2499  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789",
+
2500  "spare"},
+
2501  RPCCallTestData::no_exception,
+
2502  R"({
+
2503  "method" : "deposit_authorized",
+
2504  "params" : [
+
2505  {
+
2506  "error" : "badSyntax",
+
2507  "error_code" : 1,
+
2508  "error_message" : "Syntax error."
+
2509  }
+
2510  ]
+
2511  })"},
+
2512  {"deposit_authorized: invalid ledger selection.",
+
2513  __LINE__,
+
2514  {
+
2515  "deposit_authorized",
+
2516  "source_account_NotValidated",
+
2517  "destination_account_NotValidated",
+
2518  "NotALedger",
+
2519  },
+
2520  RPCCallTestData::no_exception,
+
2521  R"({
+
2522  "method" : "deposit_authorized",
+
2523  "params" : [
+
2524  {
+
2525  "api_version" : %MAX_API_VER%,
+
2526  "destination_account" : "destination_account_NotValidated",
+
2527  "ledger_index" : 0,
+
2528  "source_account" : "source_account_NotValidated"
+
2529  }
+
2530  ]
+
2531  })"},
+
2532 
+
2533  // download_shard
+
2534  // --------------------------------------------------------------
+
2535  {"download_shard: minimal.",
+
2536  __LINE__,
+
2537  {
+
2538  "download_shard",
+
2539  "20",
+
2540  "url_NotValidated",
+
2541  },
+
2542  RPCCallTestData::no_exception,
+
2543  R"({
+
2544  "method" : "download_shard",
+
2545  "params" : [
+
2546  {
+
2547  "api_version" : %MAX_API_VER%,
+
2548  "shards" : [
+
2549  {
+
2550  "index" : 20,
+
2551  "url" : "url_NotValidated"
+
2552  }
+
2553  ]
+
2554  }
+
2555  ]
+
2556  })"},
+
2557  {"download_shard:",
+
2558  __LINE__,
+
2559  {
+
2560  "download_shard",
+
2561  "20",
+
2562  "url_NotValidated",
+
2563  },
+
2564  RPCCallTestData::no_exception,
+
2565  R"({
+
2566  "method" : "download_shard",
+
2567  "params" : [
+
2568  {
+
2569  "api_version" : %MAX_API_VER%,
+
2570  "shards" : [
+
2571  {
+
2572  "index" : 20,
+
2573  "url" : "url_NotValidated"
+
2574  }
+
2575  ]
+
2576  }
+
2577  ]
+
2578  })"},
+
2579  {"download_shard: many shards.",
+
2580  __LINE__,
+
2581  {
+
2582  "download_shard",
+
2583  "200000000",
+
2584  "url_NotValidated0",
+
2585  "199999999",
+
2586  "url_NotValidated1",
+
2587  "199999998",
+
2588  "url_NotValidated2",
+
2589  "199999997",
+
2590  "url_NotValidated3",
+
2591  },
+
2592  RPCCallTestData::no_exception,
+
2593  R"({
+
2594  "method" : "download_shard",
+
2595  "params" : [
+
2596  {
+
2597  "api_version" : %MAX_API_VER%,
+
2598  "shards" : [
+
2599  {
+
2600  "index" : 200000000,
+
2601  "url" : "url_NotValidated0"
+
2602  },
+
2603  {
+
2604  "index" : 199999999,
+
2605  "url" : "url_NotValidated1"
+
2606  },
+
2607  {
+
2608  "index" : 199999998,
+
2609  "url" : "url_NotValidated2"
+
2610  },
+
2611  {
+
2612  "index" : 199999997,
+
2613  "url" : "url_NotValidated3"
+
2614  }
+
2615  ]
+
2616  }
+
2617  ]
+
2618  })"},
+
2619  {"download_shard: many shards.",
+
2620  __LINE__,
+
2621  {
+
2622  "download_shard",
+
2623  "2000000",
+
2624  "url_NotValidated0",
+
2625  "2000001",
+
2626  "url_NotValidated1",
+
2627  "2000002",
+
2628  "url_NotValidated2",
+
2629  "2000003",
+
2630  "url_NotValidated3",
+
2631  "2000004",
+
2632  "url_NotValidated4",
+
2633  },
+
2634  RPCCallTestData::no_exception,
+
2635  R"({
+
2636  "method" : "download_shard",
+
2637  "params" : [
+
2638  {
+
2639  "api_version" : %MAX_API_VER%,
+
2640  "shards" : [
+
2641  {
+
2642  "index" : 2000000,
+
2643  "url" : "url_NotValidated0"
+
2644  },
+
2645  {
+
2646  "index" : 2000001,
+
2647  "url" : "url_NotValidated1"
+
2648  },
+
2649  {
+
2650  "index" : 2000002,
+
2651  "url" : "url_NotValidated2"
+
2652  },
+
2653  {
+
2654  "index" : 2000003,
+
2655  "url" : "url_NotValidated3"
+
2656  },
+
2657  {
+
2658  "index" : 2000004,
+
2659  "url" : "url_NotValidated4"
+
2660  }
+
2661  ]
+
2662  }
+
2663  ]
+
2664  })"},
+
2665  {"download_shard: too few arguments.",
+
2666  __LINE__,
+
2667  {"download_shard", "20"},
+
2668  RPCCallTestData::no_exception,
+
2669  R"({
+
2670  "method" : "download_shard",
+
2671  "params" : [
+
2672  {
+
2673  "error" : "badSyntax",
+
2674  "error_code" : 1,
+
2675  "error_message" : "Syntax error."
+
2676  }
+
2677  ]
+
2678  })"},
+
2679  {// Note: this should return an error but not throw.
+
2680  "download_shard: novalidate too few arguments.",
+
2681  __LINE__,
+
2682  {"download_shard", "novalidate", "20"},
+
2683  RPCCallTestData::bad_cast,
+
2684  R"()"},
+
2685  {"download_shard: novalidate at end.",
+
2686  __LINE__,
+
2687  {
+
2688  "download_shard",
+
2689  "20",
+
2690  "url_NotValidated",
+
2691  "novalidate",
+
2692  },
+
2693  RPCCallTestData::no_exception,
+
2694  R"({
+
2695  "method" : "download_shard",
+
2696  "params" : [
+
2697  {
+
2698  "api_version" : %MAX_API_VER%,
+
2699  "shards" : [
+
2700  {
+
2701  "index" : 20,
+
2702  "url" : "url_NotValidated"
+
2703  }
+
2704  ]
+
2705  }
+
2706  ]
+
2707  })"},
+
2708  {"download_shard: novalidate in middle.",
+
2709  __LINE__,
+
2710  {
+
2711  "download_shard",
+
2712  "20",
+
2713  "url_NotValidated20",
+
2714  "novalidate",
+
2715  "200",
+
2716  "url_NotValidated200",
+
2717  },
+
2718  RPCCallTestData::no_exception,
+
2719  R"({
+
2720  "method" : "download_shard",
+
2721  "params" : [
+
2722  {
+
2723  "error" : "invalidParams",
+
2724  "error_code" : 31,
+
2725  "error_message" : "Invalid parameters."
+
2726  }
+
2727  ]
+
2728  })"},
+
2729  {// Note: this should return an error but not throw.
+
2730  "download_shard: arguments swapped.",
+
2731  __LINE__,
+
2732  {
+
2733  "download_shard",
+
2734  "url_NotValidated",
+
2735  "20",
+
2736  },
+
2737  RPCCallTestData::bad_cast,
+
2738  R"()"},
+
2739  {"download_shard: index too small.",
+
2740  __LINE__,
+
2741  {
+
2742  "download_shard",
+
2743  "-1",
+
2744  "url_NotValidated",
+
2745  },
+
2746  RPCCallTestData::bad_cast,
+
2747  R"()"},
+
2748  {"download_shard: index too big.",
+
2749  __LINE__,
+
2750  {
+
2751  "download_shard",
+
2752  "4294967296",
+
2753  "url_NotValidated",
+
2754  },
+
2755  RPCCallTestData::bad_cast,
+
2756  R"()"},
+
2757 
+
2758  // feature
+
2759  // ---------------------------------------------------------------------
+
2760  {"feature: minimal.",
+
2761  __LINE__,
+
2762  {
+
2763  "feature",
+
2764  },
+
2765  RPCCallTestData::no_exception,
+
2766  R"({
+
2767  "method" : "feature",
+
2768  "params" : [
+
2769  {
+
2770  "api_version" : %MAX_API_VER%,
+
2771  }
+
2772  ]
+
2773  })"},
+
2774  {"feature: with name.",
+
2775  __LINE__,
+
2776  {"feature", "featureNameOrHexIsNotValidated"},
+
2777  RPCCallTestData::no_exception,
+
2778  R"({
+
2779  "method" : "feature",
+
2780  "params" : [
+
2781  {
+
2782  "api_version" : %MAX_API_VER%,
+
2783  "feature" : "featureNameOrHexIsNotValidated"
+
2784  }
+
2785  ]
+
2786  })"},
+
2787  {"feature: accept.",
+
2788  __LINE__,
+
2789  {"feature",
+
2790  "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA98"
+
2791  "76543210",
+
2792  "accept"},
+
2793  RPCCallTestData::no_exception,
+
2794  R"({
+
2795  "method" : "feature",
+
2796  "params" : [
+
2797  {
+
2798  "api_version" : %MAX_API_VER%,
+
2799  "feature" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210",
+
2800  "vetoed" : false
+
2801  }
+
2802  ]
+
2803  })"},
+
2804  {"feature: reject.",
+
2805  __LINE__,
+
2806  {"feature", "0", "reject"},
+
2807  RPCCallTestData::no_exception,
+
2808  R"({
+
2809  "method" : "feature",
+
2810  "params" : [
+
2811  {
+
2812  "api_version" : %MAX_API_VER%,
+
2813  "feature" : "0",
+
2814  "vetoed" : true
+
2815  }
+
2816  ]
+
2817  })"},
+
2818  {"feature: too many arguments.",
+
2819  __LINE__,
+
2820  {"feature", "featureNameOrHexIsNotValidated", "accept", "anotherArg"},
+
2821  RPCCallTestData::no_exception,
+
2822  R"({
+
2823  "method" : "feature",
+
2824  "params" : [
+
2825  {
+
2826  "error" : "badSyntax",
+
2827  "error_code" : 1,
+
2828  "error_message" : "Syntax error."
+
2829  }
+
2830  ]
+
2831  })"},
+
2832  {"feature: neither accept nor reject.",
+
2833  __LINE__,
+
2834  {
+
2835  "feature",
+
2836  "featureNameOrHexIsNotValidated",
+
2837  "veto",
+
2838  },
+
2839  RPCCallTestData::no_exception,
+
2840  R"({
+
2841  "method" : "feature",
+
2842  "params" : [
+
2843  {
+
2844  "error" : "invalidParams",
+
2845  "error_code" : 31,
+
2846  "error_message" : "Invalid parameters."
+
2847  }
+
2848  ]
+
2849  })"},
+
2850 
+
2851  // fetch_info
+
2852  // ------------------------------------------------------------------
+
2853  {"fetch_info: minimal.",
+
2854  __LINE__,
+
2855  {
+
2856  "fetch_info",
+
2857  },
+
2858  RPCCallTestData::no_exception,
+
2859  R"({
+
2860  "method" : "fetch_info",
+
2861  "params" : [
+
2862  {
+
2863  "api_version" : %MAX_API_VER%,
+
2864  }
+
2865  ]
+
2866  })"},
+
2867  {"fetch_info: clear.",
+
2868  __LINE__,
+
2869  {"fetch_info", "clear"},
+
2870  RPCCallTestData::no_exception,
+
2871  R"({
+
2872  "method" : "fetch_info",
+
2873  "params" : [
+
2874  {
+
2875  "api_version" : %MAX_API_VER%,
+
2876  "clear" : true
+
2877  }
+
2878  ]
+
2879  })"},
+
2880  {"fetch_info: too many arguments.",
+
2881  __LINE__,
+
2882  {"fetch_info", "clear", "other"},
+
2883  RPCCallTestData::no_exception,
+
2884  R"({
+
2885  "method" : "fetch_info",
+
2886  "params" : [
+
2887  {
+
2888  "error" : "badSyntax",
+
2889  "error_code" : 1,
+
2890  "error_message" : "Syntax error."
+
2891  }
+
2892  ]
+
2893  })"},
+
2894  {"fetch_info: other trailing argument.",
+
2895  __LINE__,
+
2896  {"fetch_info", "too"},
+
2897  RPCCallTestData::no_exception,
+
2898  R"({
+
2899  "method" : "fetch_info",
+
2900  "params" : [
+
2901  {
+
2902  "api_version" : %MAX_API_VER%,
+
2903  "too" : true
+
2904  }
+
2905  ]
+
2906  })"},
+
2907 
+
2908  // gateway_balances
+
2909  // ------------------------------------------------------------
+
2910  {"gateway_balances: minimal.",
+
2911  __LINE__,
+
2912  {"gateway_balances", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
2913  RPCCallTestData::no_exception,
+
2914  R"({
+
2915  "method" : "gateway_balances",
+
2916  "params" : [
+
2917  {
+
2918  "api_version" : %MAX_API_VER%,
+
2919  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2920  }
+
2921  ]
+
2922  })"},
+
2923  {"gateway_balances: with ledger index.",
+
2924  __LINE__,
+
2925  {"gateway_balances", "890765", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
2926  RPCCallTestData::no_exception,
+
2927  R"({
+
2928  "method" : "gateway_balances",
+
2929  "params" : [
+
2930  {
+
2931  "api_version" : %MAX_API_VER%,
+
2932  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2933  "ledger_index" : "890765"
+
2934  }
+
2935  ]
+
2936  })"},
+
2937  {"gateway_balances: with text ledger index.",
+
2938  __LINE__,
+
2939  {"gateway_balances", "current", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
2940  RPCCallTestData::no_exception,
+
2941  R"({
+
2942  "method" : "gateway_balances",
+
2943  "params" : [
+
2944  {
+
2945  "api_version" : %MAX_API_VER%,
+
2946  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2947  "ledger_index" : "current"
+
2948  }
+
2949  ]
+
2950  })"},
+
2951  {"gateway_balances: with 64 character ledger hash.",
+
2952  __LINE__,
+
2953  {"gateway_balances",
+
2954  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
2955  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
2956  RPCCallTestData::no_exception,
+
2957  R"({
+
2958  "method" : "gateway_balances",
+
2959  "params" : [
+
2960  {
+
2961  "api_version" : %MAX_API_VER%,
+
2962  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2963  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
2964  }
+
2965  ]
+
2966  })"},
+
2967  {"gateway_balances: 1 hotwallet.",
+
2968  __LINE__,
+
2969  {"gateway_balances",
+
2970  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2971  "hotwallet_is_not_validated"},
+
2972  RPCCallTestData::no_exception,
+
2973  R"({
+
2974  "method" : "gateway_balances",
+
2975  "params" : [
+
2976  {
+
2977  "api_version" : %MAX_API_VER%,
+
2978  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2979  "hotwallet" : [ "hotwallet_is_not_validated" ]
+
2980  }
+
2981  ]
+
2982  })"},
+
2983  {"gateway_balances: 3 hotwallets.",
+
2984  __LINE__,
+
2985  {
+
2986  "gateway_balances",
+
2987  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
2988  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
2989  "hotwallet_is_not_validated_1",
+
2990  "hotwallet_is_not_validated_2",
+
2991  "hotwallet_is_not_validated_3",
+
2992  },
+
2993  RPCCallTestData::no_exception,
+
2994  R"({
+
2995  "method" : "gateway_balances",
+
2996  "params" : [
+
2997  {
+
2998  "api_version" : %MAX_API_VER%,
+
2999  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
3000  "hotwallet" : [
+
3001  "hotwallet_is_not_validated_1",
+
3002  "hotwallet_is_not_validated_2",
+
3003  "hotwallet_is_not_validated_3"
+
3004  ],
+
3005  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
3006  }
+
3007  ]
+
3008  })"},
+
3009  {"gateway_balances: too few arguments.",
+
3010  __LINE__,
+
3011  {
+
3012  "gateway_balances",
+
3013  },
+
3014  RPCCallTestData::no_exception,
+
3015  R"({
+
3016  "method" : "gateway_balances",
+
3017  "params" : [
+
3018  {
+
3019  "error" : "badSyntax",
+
3020  "error_code" : 1,
+
3021  "error_message" : "Syntax error."
+
3022  }
+
3023  ]
+
3024  })"},
+
3025  {"gateway_balances: empty first argument.",
+
3026  __LINE__,
+
3027  {"gateway_balances", ""},
+
3028  RPCCallTestData::no_exception,
+
3029  R"({
+
3030  "method" : "gateway_balances",
+
3031  "params" : [
+
3032  {
+
3033  "error" : "invalidParams",
+
3034  "error_code" : 31,
+
3035  "error_message" : "Invalid first parameter"
+
3036  }
+
3037  ]
+
3038  })"},
+
3039  {"gateway_balances: with ledger index but no gateway.",
+
3040  __LINE__,
+
3041  {
+
3042  "gateway_balances",
+
3043  "890765",
+
3044  },
+
3045  RPCCallTestData::no_exception,
+
3046  R"({
+
3047  "method" : "gateway_balances",
+
3048  "params" : [
+
3049  {
+
3050  "error" : "invalidParams",
+
3051  "error_code" : 31,
+
3052  "error_message" : "Invalid hotwallet"
+
3053  }
+
3054  ]
+
3055  })"},
+
3056  {"gateway_balances: with text ledger index but no gateway.",
+
3057  __LINE__,
+
3058  {
+
3059  "gateway_balances",
+
3060  "current",
+
3061  },
+
3062  RPCCallTestData::no_exception,
+
3063  R"({
+
3064  "method" : "gateway_balances",
+
3065  "params" : [
+
3066  {
+
3067  "error" : "invalidParams",
+
3068  "error_code" : 31,
+
3069  "error_message" : "Invalid hotwallet"
+
3070  }
+
3071  ]
+
3072  })"},
+
3073  {"gateway_balances: with 64 character ledger hash but no gateway.",
+
3074  __LINE__,
+
3075  {
+
3076  "gateway_balances",
+
3077  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
3078  },
+
3079  RPCCallTestData::no_exception,
+
3080  R"({
+
3081  "method" : "gateway_balances",
+
3082  "params" : [
+
3083  {
+
3084  "error" : "invalidParams",
+
3085  "error_code" : 31,
+
3086  "error_message" : "Invalid hotwallet"
+
3087  }
+
3088  ]
+
3089  })"},
+
3090 
+
3091  // get_counts
+
3092  // ------------------------------------------------------------------
+
3093  {"get_counts: minimal.",
+
3094  __LINE__,
+
3095  {
+
3096  "get_counts",
+
3097  },
+
3098  RPCCallTestData::no_exception,
+
3099  R"({
+
3100  "method" : "get_counts",
+
3101  "params" : [
+
3102  {
+
3103  "api_version" : %MAX_API_VER%,
+
3104  }
+
3105  ]
+
3106  })"},
+
3107  {"get_counts: with maximum count.",
+
3108  __LINE__,
+
3109  {"get_counts", "100"},
+
3110  RPCCallTestData::no_exception,
+
3111  R"({
+
3112  "method" : "get_counts",
+
3113  "params" : [
+
3114  {
+
3115  "api_version" : %MAX_API_VER%,
+
3116  "min_count" : 100
+
3117  }
+
3118  ]
+
3119  })"},
+
3120  {"get_counts: too many arguments.",
+
3121  __LINE__,
+
3122  {"get_counts", "100", "whatever"},
+
3123  RPCCallTestData::no_exception,
+
3124  R"({
+
3125  "method" : "get_counts",
+
3126  "params" : [
+
3127  {
+
3128  "error" : "badSyntax",
+
3129  "error_code" : 1,
+
3130  "error_message" : "Syntax error."
+
3131  }
+
3132  ]
+
3133  })"},
+
3134  {"get_counts: count too small.",
+
3135  __LINE__,
+
3136  {
+
3137  "get_counts",
+
3138  "-1",
+
3139  },
+
3140  RPCCallTestData::bad_cast,
+
3141  R"()"},
+
3142  {"get_counts: count too large.",
+
3143  __LINE__,
+
3144  {"get_counts", "4294967296"},
+
3145  RPCCallTestData::bad_cast,
+
3146  R"()"},
+
3147 
+
3148  // json
+
3149  // ------------------------------------------------------------------------
+
3150  {"json: minimal.",
+
3151  __LINE__,
+
3152  {
+
3153  "json",
+
3154  "command",
+
3155  R"({"json_argument":true})",
+
3156  },
+
3157  RPCCallTestData::no_exception,
+
3158  R"({
+
3159  "method" : "command",
+
3160  "params" : [
+
3161  {
+
3162  "api_version" : %MAX_API_VER%,
+
3163  "json_argument" : true,
+
3164  "method" : "command"
+
3165  }
+
3166  ]
+
3167  })"},
+
3168  {"json: null object.",
+
3169  __LINE__,
+
3170  {
+
3171  "json",
+
3172  "command",
+
3173  R"({})",
+
3174  },
+
3175  RPCCallTestData::no_exception,
+
3176  R"({
+
3177  "method" : "command",
+
3178  "params" : [
+
3179  {
+
3180  "api_version" : %MAX_API_VER%,
+
3181  "method" : "command"
+
3182  }
+
3183  ]
+
3184  })"},
+
3185  {"json: too few arguments.",
+
3186  __LINE__,
+
3187  {"json", "command"},
+
3188  RPCCallTestData::no_exception,
+
3189  R"({
+
3190  "method" : "json",
+
3191  "params" : [
+
3192  {
+
3193  "error" : "badSyntax",
+
3194  "error_code" : 1,
+
3195  "error_message" : "Syntax error."
+
3196  }
+
3197  ]
+
3198  })"},
+
3199  {"json: too many arguments.",
+
3200  __LINE__,
+
3201  {"json", "command", R"({"json_argument":true})", "extra"},
+
3202  RPCCallTestData::no_exception,
+
3203  R"({
+
3204  "method" : "json",
+
3205  "params" : [
+
3206  {
+
3207  "error" : "badSyntax",
+
3208  "error_code" : 1,
+
3209  "error_message" : "Syntax error."
+
3210  }
+
3211  ]
+
3212  })"},
+
3213  {"json: array, not object.",
+
3214  __LINE__,
+
3215  {
+
3216  "json",
+
3217  "command",
+
3218  R"(["arg1","arg2"])",
+
3219  },
+
3220  RPCCallTestData::no_exception,
+
3221  R"({
+
3222  "method" : "json",
+
3223  "params" : [
+
3224  {
+
3225  "error" : "invalidParams",
+
3226  "error_code" : 31,
+
3227  "error_message" : "Invalid parameters."
+
3228  }
+
3229  ]
+
3230  })"},
+
3231  {"json: invalid json (note closing comma).",
+
3232  __LINE__,
+
3233  {
+
3234  "json",
+
3235  "command",
+
3236  R"({"json_argument":true,})",
+
3237  },
+
3238  RPCCallTestData::no_exception,
+
3239  R"({
+
3240  "method" : "json",
+
3241  "params" : [
+
3242  {
+
3243  "error" : "invalidParams",
+
3244  "error_code" : 31,
+
3245  "error_message" : "Invalid parameters."
+
3246  }
+
3247  ]
+
3248  })"},
+
3249 
+
3250  // json2
+
3251  // -----------------------------------------------------------------------
+
3252  {"json2: minimal object.",
+
3253  __LINE__,
+
3254  {
+
3255  "json2",
+
3256  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"})",
+
3257  },
+
3258  RPCCallTestData::no_exception,
+
3259  R"({
+
3260  "id" : "A1",
+
3261  "jsonrpc" : "2.0",
+
3262  "method" : "call_1",
+
3263  "params" : [
+
3264  {
+
3265  "api_version" : %MAX_API_VER%,
+
3266  "id" : "A1",
+
3267  "jsonrpc" : "2.0",
+
3268  "method" : "call_1",
+
3269  "ripplerpc" : "2.0"
+
3270  }
+
3271  ],
+
3272  "ripplerpc" : "2.0"
+
3273  })"},
+
3274  {"json2: object with nested params.",
+
3275  __LINE__,
+
3276  {
+
3277  "json2",
+
3278  R"({
+
3279  "jsonrpc" : "2.0",
+
3280  "ripplerpc" : "2.0",
+
3281  "id" : "A1",
+
3282  "method" : "call_1",
+
3283  "params" : [{"inner_arg" : "yup"}]
+
3284  })",
+
3285  },
+
3286  RPCCallTestData::no_exception,
+
3287  R"({
+
3288  "id" : "A1",
+
3289  "jsonrpc" : "2.0",
+
3290  "method" : "call_1",
+
3291  "params" : [
+
3292  {
+
3293  "api_version" : %MAX_API_VER%,
+
3294  "0" : {
+
3295  "inner_arg" : "yup"
+
3296  },
+
3297  "id" : "A1",
+
3298  "jsonrpc" : "2.0",
+
3299  "method" : "call_1",
+
3300  "ripplerpc" : "2.0"
+
3301  }
+
3302  ],
+
3303  "ripplerpc" : "2.0"
+
3304  })"},
+
3305  {"json2: minimal array.",
+
3306  __LINE__,
+
3307  {
+
3308  "json2",
+
3309  R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1"}])",
+
3310  },
+
3311  RPCCallTestData::no_exception,
+
3312  R"({
+
3313  "method" : "json2",
+
3314  "params" : [
+
3315  [
+
3316  {
+
3317  "api_version" : %MAX_API_VER%,
+
3318  "id" : "A1",
+
3319  "jsonrpc" : "2.0",
+
3320  "method" : "call_1",
+
3321  "ripplerpc" : "2.0"
+
3322  }
+
3323  ]
+
3324  ]
+
3325  })"},
+
3326  {"json2: array with object with nested params.",
+
3327  __LINE__,
+
3328  {
+
3329  "json2",
+
3330  R"([
+
3331  {"jsonrpc":"2.0",
+
3332  "ripplerpc":"2.0",
+
3333  "id":"A1",
+
3334  "method":"call_1",
+
3335  "params" : [{"inner_arg" : "yup"}]}
+
3336  ])",
+
3337  },
+
3338  RPCCallTestData::no_exception,
+
3339  R"({
+
3340  "method" : "json2",
+
3341  "params" : [
+
3342  [
+
3343  {
+
3344  "api_version" : %MAX_API_VER%,
+
3345  "0" : {
+
3346  "inner_arg" : "yup"
+
3347  },
+
3348  "id" : "A1",
+
3349  "jsonrpc" : "2.0",
+
3350  "method" : "call_1",
+
3351  "ripplerpc" : "2.0"
+
3352  }
+
3353  ]
+
3354  ]})"},
+
3355  {"json2: too few arguments.",
+
3356  __LINE__,
+
3357  {
+
3358  "json2",
+
3359  },
+
3360  RPCCallTestData::no_exception,
+
3361  R"({
+
3362  "method" : "json2",
+
3363  "params" : [
+
3364  {
+
3365  "error" : "badSyntax",
+
3366  "error_code" : 1,
+
3367  "error_message" : "Syntax error."
+
3368  }
+
3369  ]
+
3370  })"},
+
3371  {"json2: too many arguments.",
+
3372  __LINE__,
+
3373  {"json2",
+
3374  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_this"})",
+
3375  "extra"},
+
3376  RPCCallTestData::no_exception,
+
3377  R"({
+
3378  "method" : "json2",
+
3379  "params" : [
+
3380  {
+
3381  "error" : "badSyntax",
+
3382  "error_code" : 1,
+
3383  "error_message" : "Syntax error."
+
3384  }
+
3385  ]
+
3386  })"},
+
3387  {"json2: malformed json (note extra comma).",
+
3388  __LINE__,
+
3389  {
+
3390  "json2",
+
3391  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",})",
+
3392  },
+
3393  RPCCallTestData::no_exception,
+
3394  R"({
+
3395  "id" : "A1",
+
3396  "jsonrpc" : "2.0",
+
3397  "method" : "json2",
+
3398  "params" : [
+
3399  {
+
3400  "error" : "invalidParams",
+
3401  "error_code" : 31,
+
3402  "error_message" : "Invalid parameters.",
+
3403  "id" : "A1",
+
3404  "jsonrpc" : "2.0",
+
3405  "ripplerpc" : "2.0"
+
3406  }
+
3407  ],
+
3408  "ripplerpc" : "2.0"
+
3409  })"},
+
3410  {"json2: omit jsonrpc.",
+
3411  __LINE__,
+
3412  {
+
3413  "json2",
+
3414  R"({"ripplerpc":"2.0","id":"A1","method":"call_1"})",
+
3415  },
+
3416  RPCCallTestData::no_exception,
+
3417  R"({
+
3418  "id" : "A1",
+
3419  "method" : "json2",
+
3420  "params" : [
+
3421  {
+
3422  "error" : "invalidParams",
+
3423  "error_code" : 31,
+
3424  "error_message" : "Invalid parameters.",
+
3425  "id" : "A1",
+
3426  "ripplerpc" : "2.0"
+
3427  }
+
3428  ],
+
3429  "ripplerpc" : "2.0"
+
3430  })"},
+
3431  {"json2: wrong jsonrpc version.",
+
3432  __LINE__,
+
3433  {
+
3434  "json2",
+
3435  R"({"jsonrpc":"2.1","ripplerpc":"2.0","id":"A1","method":"call_1"})",
+
3436  },
+
3437  RPCCallTestData::no_exception,
+
3438  R"({
+
3439  "id" : "A1",
+
3440  "jsonrpc" : "2.1",
+
3441  "method" : "json2",
+
3442  "params" : [
+
3443  {
+
3444  "error" : "invalidParams",
+
3445  "error_code" : 31,
+
3446  "error_message" : "Invalid parameters.",
+
3447  "id" : "A1",
+
3448  "jsonrpc" : "2.1",
+
3449  "ripplerpc" : "2.0"
+
3450  }
+
3451  ],
+
3452  "ripplerpc" : "2.0"
+
3453  })"},
+
3454  {"json2: omit ripplerpc.",
+
3455  __LINE__,
+
3456  {
+
3457  "json2",
+
3458  R"({"jsonrpc":"2.0","id":"A1","method":"call_1"})",
+
3459  },
+
3460  RPCCallTestData::no_exception,
+
3461  R"({
+
3462  "id" : "A1",
+
3463  "jsonrpc" : "2.0",
+
3464  "method" : "json2",
+
3465  "params" : [
+
3466  {
+
3467  "error" : "invalidParams",
+
3468  "error_code" : 31,
+
3469  "error_message" : "Invalid parameters.",
+
3470  "id" : "A1",
+
3471  "jsonrpc" : "2.0"
+
3472  }
+
3473  ]
+
3474  })"},
+
3475  {"json2: wrong ripplerpc version.",
+
3476  __LINE__,
+
3477  {
+
3478  "json2",
+
3479  R"({"jsonrpc":"2.0","ripplerpc":"2.00","id":"A1","method":"call_1"})",
+
3480  },
+
3481  RPCCallTestData::no_exception,
+
3482  R"({
+
3483  "id" : "A1",
+
3484  "jsonrpc" : "2.0",
+
3485  "method" : "json2",
+
3486  "params" : [
+
3487  {
+
3488  "error" : "invalidParams",
+
3489  "error_code" : 31,
+
3490  "error_message" : "Invalid parameters.",
+
3491  "id" : "A1",
+
3492  "jsonrpc" : "2.0",
+
3493  "ripplerpc" : "2.00"
+
3494  }
+
3495  ],
+
3496  "ripplerpc" : "2.00"
+
3497  })"},
+
3498  {"json2: omit id.",
+
3499  __LINE__,
+
3500  {
+
3501  "json2",
+
3502  R"({"jsonrpc":"2.0","ripplerpc":"2.0","method":"call_1"})",
+
3503  },
+
3504  RPCCallTestData::no_exception,
+
3505  R"({
+
3506  "jsonrpc" : "2.0",
+
3507  "method" : "json2",
+
3508  "params" : [
+
3509  {
+
3510  "error" : "invalidParams",
+
3511  "error_code" : 31,
+
3512  "error_message" : "Invalid parameters.",
+
3513  "jsonrpc" : "2.0",
+
3514  "ripplerpc" : "2.0"
+
3515  }
+
3516  ],
+
3517  "ripplerpc" : "2.0"
+
3518  })"},
+
3519  {"json2: omit method.",
+
3520  __LINE__,
+
3521  {
+
3522  "json2",
+
3523  R"({"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1"})",
+
3524  },
+
3525  RPCCallTestData::no_exception,
+
3526  R"({
+
3527  "id" : "A1",
+
3528  "jsonrpc" : "2.0",
+
3529  "method" : "json2",
+
3530  "params" : [
+
3531  {
+
3532  "error" : "invalidParams",
+
3533  "error_code" : 31,
+
3534  "error_message" : "Invalid parameters.",
+
3535  "id" : "A1",
+
3536  "jsonrpc" : "2.0",
+
3537  "ripplerpc" : "2.0"
+
3538  }
+
3539  ],
+
3540  "ripplerpc" : "2.0"
+
3541  })"},
+
3542  {"json2: empty outer array.",
+
3543  __LINE__,
+
3544  {
+
3545  "json2",
+
3546  R"([])",
+
3547  },
+
3548  RPCCallTestData::no_exception,
+
3549  R"({
+
3550  "method" : "json2",
+
3551  "params" : [
+
3552  {
+
3553  "error" : "invalidParams",
+
3554  "error_code" : 31,
+
3555  "error_message" : "Invalid parameters."
+
3556  }
+
3557  ]
+
3558  })"},
+
3559  {"json2: empty inner array.",
+
3560  __LINE__,
+
3561  {
+
3562  "json2",
+
3563  R"([{"jsonrpc":"2.0","ripplerpc":"2.0","id":"A1","method":"call_1",[]}])",
+
3564  },
+
3565  RPCCallTestData::no_exception,
+
3566  R"({
+
3567  "method" : "json2",
+
3568  "params" : [
+
3569  {
+
3570  "error" : "invalidParams",
+
3571  "error_code" : 31,
+
3572  "error_message" : "Invalid parameters."
+
3573  }
+
3574  ]
+
3575  })"},
+
3576  {"json2: array with non-json2 object.",
+
3577  __LINE__,
+
3578  {
+
3579  "json2",
+
3580  R"([
+
3581  {"jsonrpc" : "2.1",
+
3582  "ripplerpc" : "2.0",
+
3583  "id" : "A1",
+
3584  "method" : "call_1"
+
3585  }
+
3586  ])",
+
3587  },
+
3588  RPCCallTestData::no_exception,
+
3589  R"({
+
3590  "method" : "json2",
+
3591  "params" : [
+
3592  {
+
3593  "error" : "invalidParams",
+
3594  "error_code" : 31,
+
3595  "error_message" : "Invalid parameters."
+
3596  }
+
3597  ]
+
3598  })"},
+
3599  {"json2: non-object or -array inner params member.",
+
3600  __LINE__,
+
3601  {
+
3602  "json2",
+
3603  R"({
+
3604  "jsonrpc" : "2.0",
+
3605  "ripplerpc" : "2.0",
+
3606  "id" : "A1",
+
3607  "method" : "call_1",
+
3608  "params" : true
+
3609  })",
+
3610  },
+
3611  RPCCallTestData::no_exception,
+
3612  R"({
+
3613  "id" : "A1",
+
3614  "jsonrpc" : "2.0",
+
3615  "method" : "json2",
+
3616  "params" : [
+
3617  {
+
3618  "error" : "invalidParams",
+
3619  "error_code" : 31,
+
3620  "error_message" : "Invalid parameters.",
+
3621  "id" : "A1",
+
3622  "jsonrpc" : "2.0",
+
3623  "ripplerpc" : "2.0"
+
3624  }
+
3625  ],
+
3626  "ripplerpc" : "2.0"
+
3627  })"},
+
3628 
+
3629  // ledger
+
3630  // ----------------------------------------------------------------------
+
3631  {"ledger: minimal.",
+
3632  __LINE__,
+
3633  {"ledger"},
+
3634  RPCCallTestData::no_exception,
+
3635  R"({
+
3636  "method" : "ledger",
+
3637  "params" : [
+
3638  {
+
3639  "api_version" : %MAX_API_VER%,
+
3640  }
+
3641  ]
+
3642  })"},
+
3643  {"ledger: ledger index.",
+
3644  __LINE__,
+
3645  {"ledger", "4294967295"},
+
3646  RPCCallTestData::no_exception,
+
3647  R"({
+
3648  "method" : "ledger",
+
3649  "params" : [
+
3650  {
+
3651  "api_version" : %MAX_API_VER%,
+
3652  "ledger_index" : 4294967295
+
3653  }
+
3654  ]
+
3655  })"},
+
3656  {"ledger: text ledger index.",
+
3657  __LINE__,
+
3658  {"ledger", "validated"},
+
3659  RPCCallTestData::no_exception,
+
3660  R"({
+
3661  "method" : "ledger",
+
3662  "params" : [
+
3663  {
+
3664  "api_version" : %MAX_API_VER%,
+
3665  "ledger_index" : "validated"
+
3666  }
+
3667  ]
+
3668  })"},
+
3669  {"ledger: ledger hash.",
+
3670  __LINE__,
+
3671  {"ledger",
+
3672  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
+
3673  RPCCallTestData::no_exception,
+
3674  R"({
+
3675  "method" : "ledger",
+
3676  "params" : [
+
3677  {
+
3678  "api_version" : %MAX_API_VER%,
+
3679  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
+
3680  }
+
3681  ]
+
3682  })"},
+
3683  {"ledger: full.",
+
3684  __LINE__,
+
3685  {"ledger", "current", "full"},
+
3686  RPCCallTestData::no_exception,
+
3687  R"({
+
3688  "method" : "ledger",
+
3689  "params" : [
+
3690  {
+
3691  "api_version" : %MAX_API_VER%,
+
3692  "full" : true,
+
3693  "ledger_index" : "current"
+
3694  }
+
3695  ]
+
3696  })"},
+
3697  {"ledger: tx.",
+
3698  __LINE__,
+
3699  {"ledger", "closed", "tx"},
+
3700  RPCCallTestData::no_exception,
+
3701  R"({
+
3702  "method" : "ledger",
+
3703  "params" : [
+
3704  {
+
3705  "api_version" : %MAX_API_VER%,
+
3706  "expand" : true,
+
3707  "ledger_index" : "closed",
+
3708  "transactions" : true
+
3709  }
+
3710  ]
+
3711  })"},
+
3712  {"ledger: too many arguments.",
+
3713  __LINE__,
+
3714  {"ledger", "4294967295", "spare"},
+
3715  RPCCallTestData::no_exception,
+
3716  R"({
+
3717  "method" : "ledger",
+
3718  "params" : [
+
3719  {
+
3720  "api_version" : %MAX_API_VER%,
+
3721  "ledger_index" : 4294967295
+
3722  }
+
3723  ]
+
3724  })"},
+
3725  {"ledger: ledger index too small.",
+
3726  __LINE__,
+
3727  {"ledger", "-1"},
+
3728  RPCCallTestData::no_exception,
+
3729  R"({
+
3730  "method" : "ledger",
+
3731  "params" : [
+
3732  {
+
3733  "api_version" : %MAX_API_VER%,
+
3734  "ledger_index" : 0
+
3735  }
+
3736  ]
+
3737  })"},
+
3738  {"ledger: ledger index too big.",
+
3739  __LINE__,
+
3740  {"ledger", "4294967296"},
+
3741  RPCCallTestData::no_exception,
+
3742  R"({
+
3743  "method" : "ledger",
+
3744  "params" : [
+
3745  {
+
3746  "api_version" : %MAX_API_VER%,
+
3747  "ledger_index" : 0
+
3748  }
+
3749  ]
+
3750  })"},
+
3751  {"ledger: invalid ledger text.",
+
3752  __LINE__,
+
3753  {"ledger", "latest"},
+
3754  RPCCallTestData::no_exception,
+
3755  R"({
+
3756  "method" : "ledger",
+
3757  "params" : [
+
3758  {
+
3759  "api_version" : %MAX_API_VER%,
+
3760  "ledger_index" : 0
+
3761  }
+
3762  ]
+
3763  })"},
+
3764  {"ledger: unsupported final argument.",
+
3765  __LINE__,
+
3766  {"ledger", "current", "expand"},
+
3767  RPCCallTestData::no_exception,
+
3768  R"({
+
3769  "method" : "ledger",
+
3770  "params" : [
+
3771  {
+
3772  "api_version" : %MAX_API_VER%,
+
3773  "ledger_index" : "current"
+
3774  }
+
3775  ]
+
3776  })"},
+
3777 
+
3778  // ledger_closed
+
3779  // ---------------------------------------------------------------
+
3780  {"ledger_closed: minimal.",
+
3781  __LINE__,
+
3782  {"ledger_closed"},
+
3783  RPCCallTestData::no_exception,
+
3784  R"({
+
3785  "method" : "ledger_closed",
+
3786  "params" : [
+
3787  {
+
3788  "api_version" : %MAX_API_VER%,
+
3789  }
+
3790  ]
+
3791  })"},
+
3792  {"ledger_closed: too many arguments.",
+
3793  __LINE__,
+
3794  {"ledger_closed", "today"},
+
3795  RPCCallTestData::no_exception,
+
3796  R"({
+
3797  "method" : "ledger_closed",
+
3798  "params" : [
+
3799  {
+
3800  "error" : "badSyntax",
+
3801  "error_code" : 1,
+
3802  "error_message" : "Syntax error."
+
3803  }
+
3804  ]
+
3805  })"},
+
3806 
+
3807  // ledger_current
+
3808  // --------------------------------------------------------------
+
3809  {"ledger_current: minimal.",
+
3810  __LINE__,
+
3811  {"ledger_current"},
+
3812  RPCCallTestData::no_exception,
+
3813  R"({
+
3814  "method" : "ledger_current",
+
3815  "params" : [
+
3816  {
+
3817  "api_version" : %MAX_API_VER%,
+
3818  }
+
3819  ]
+
3820  })"},
+
3821  {"ledger_current: too many arguments.",
+
3822  __LINE__,
+
3823  {"ledger_current", "today"},
+
3824  RPCCallTestData::no_exception,
+
3825  R"({
+
3826  "method" : "ledger_current",
+
3827  "params" : [
+
3828  {
+
3829  "error" : "badSyntax",
+
3830  "error_code" : 1,
+
3831  "error_message" : "Syntax error."
+
3832  }
+
3833  ]
+
3834  })"},
+
3835 
+
3836  // ledger_header
+
3837  // ---------------------------------------------------------------
+
3838  {"ledger_header: ledger index.",
+
3839  __LINE__,
+
3840  {"ledger_header", "4294967295"},
+
3841  RPCCallTestData::no_exception,
+
3842  R"({
+
3843  "method" : "ledger_header",
+
3844  "params" : [
+
3845  {
+
3846  "api_version" : %MAX_API_VER%,
+
3847  "ledger_index" : 4294967295
+
3848  }
+
3849  ]
+
3850  })"},
+
3851  {"ledger_header: ledger hash.",
+
3852  __LINE__,
+
3853  {"ledger_header",
+
3854  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
+
3855  RPCCallTestData::no_exception,
+
3856  R"({
+
3857  "method" : "ledger_header",
+
3858  "params" : [
+
3859  {
+
3860  "api_version" : %MAX_API_VER%,
+
3861  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
+
3862  }
+
3863  ]
+
3864  })"},
+
3865  {"ledger_header: too few arguments.",
+
3866  __LINE__,
+
3867  {
+
3868  "ledger_header",
+
3869  },
+
3870  RPCCallTestData::no_exception,
+
3871  R"({
+
3872  "method" : "ledger_header",
+
3873  "params" : [
+
3874  {
+
3875  "error" : "badSyntax",
+
3876  "error_code" : 1,
+
3877  "error_message" : "Syntax error."
+
3878  }
+
3879  ]
+
3880  })"},
+
3881  {"ledger_header: too many arguments.",
+
3882  __LINE__,
+
3883  {"ledger_header", "4294967295", "spare"},
+
3884  RPCCallTestData::no_exception,
+
3885  R"({
+
3886  "method" : "ledger_header",
+
3887  "params" : [
+
3888  {
+
3889  "error" : "badSyntax",
+
3890  "error_code" : 1,
+
3891  "error_message" : "Syntax error."
+
3892  }
+
3893  ]
+
3894  })"},
+
3895  {"ledger_header: text ledger index.",
+
3896  __LINE__,
+
3897  {"ledger_header", "current"},
+
3898  RPCCallTestData::no_exception,
+
3899  R"({
+
3900  "method" : "ledger_header",
+
3901  "params" : [
+
3902  {
+
3903  "api_version" : %MAX_API_VER%,
+
3904  "ledger_index" : 0
+
3905  }
+
3906  ]
+
3907  })"},
+
3908  {"ledger_header: ledger index too small.",
+
3909  __LINE__,
+
3910  {"ledger_header", "-1"},
+
3911  RPCCallTestData::no_exception,
+
3912  R"({
+
3913  "method" : "ledger_header",
+
3914  "params" : [
+
3915  {
+
3916  "api_version" : %MAX_API_VER%,
+
3917  "ledger_index" : 0
+
3918  }
+
3919  ]
+
3920  })"},
+
3921  {"ledger_header: ledger index too big.",
+
3922  __LINE__,
+
3923  {"ledger_header", "4294967296"},
+
3924  RPCCallTestData::no_exception,
+
3925  R"({
+
3926  "method" : "ledger_header",
+
3927  "params" : [
+
3928  {
+
3929  "api_version" : %MAX_API_VER%,
+
3930  "ledger_index" : 0
+
3931  }
+
3932  ]
+
3933  })"},
+
3934 
+
3935  // ledger_request
+
3936  // --------------------------------------------------------------
+
3937  {"ledger_request: ledger index.",
+
3938  __LINE__,
+
3939  {"ledger_request", "4294967295"},
+
3940  RPCCallTestData::no_exception,
+
3941  R"({
+
3942  "method" : "ledger_request",
+
3943  "params" : [
+
3944  {
+
3945  "api_version" : %MAX_API_VER%,
+
3946  "ledger_index" : 4294967295
+
3947  }
+
3948  ]
+
3949  })"},
+
3950  {"ledger_request: ledger hash.",
+
3951  __LINE__,
+
3952  {"ledger_request",
+
3953  "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"},
+
3954  RPCCallTestData::no_exception,
+
3955  R"({
+
3956  "method" : "ledger_request",
+
3957  "params" : [
+
3958  {
+
3959  "api_version" : %MAX_API_VER%,
+
3960  "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789"
+
3961  }
+
3962  ]
+
3963  })"},
+
3964  {"ledger_request: too few arguments.",
+
3965  __LINE__,
+
3966  {
+
3967  "ledger_request",
+
3968  },
+
3969  RPCCallTestData::no_exception,
+
3970  R"({
+
3971  "method" : "ledger_request",
+
3972  "params" : [
+
3973  {
+
3974  "error" : "badSyntax",
+
3975  "error_code" : 1,
+
3976  "error_message" : "Syntax error."
+
3977  }
+
3978  ]
+
3979  })"},
+
3980  {"ledger_request: too many arguments.",
+
3981  __LINE__,
+
3982  {"ledger_request", "4294967295", "spare"},
+
3983  RPCCallTestData::no_exception,
+
3984  R"({
+
3985  "method" : "ledger_request",
+
3986  "params" : [
+
3987  {
+
3988  "error" : "badSyntax",
+
3989  "error_code" : 1,
+
3990  "error_message" : "Syntax error."
+
3991  }
+
3992  ]
+
3993  })"},
+
3994  {"ledger_request: text ledger index.",
+
3995  __LINE__,
+
3996  {"ledger_request", "current"},
+
3997  RPCCallTestData::no_exception,
+
3998  R"({
+
3999  "method" : "ledger_request",
+
4000  "params" : [
+
4001  {
+
4002  "api_version" : %MAX_API_VER%,
+
4003  "ledger_index" : 0
+
4004  }
+
4005  ]
+
4006  })"},
+
4007  {"ledger_request: ledger index too small.",
+
4008  __LINE__,
+
4009  {"ledger_request", "-1"},
+
4010  RPCCallTestData::no_exception,
+
4011  R"({
+
4012  "method" : "ledger_request",
+
4013  "params" : [
+
4014  {
+
4015  "api_version" : %MAX_API_VER%,
+
4016  "ledger_index" : 0
+
4017  }
+
4018  ]
+
4019  })"},
+
4020  {"ledger_request: ledger index too big.",
+
4021  __LINE__,
+
4022  {"ledger_request", "4294967296"},
+
4023  RPCCallTestData::no_exception,
+
4024  R"({
+
4025  "method" : "ledger_request",
+
4026  "params" : [
+
4027  {
+
4028  "api_version" : %MAX_API_VER%,
+
4029  "ledger_index" : 0
+
4030  }
+
4031  ]
+
4032  })"},
+
4033 
+
4034  // log_level
+
4035  // -------------------------------------------------------------------
+
4036  {"log_level: minimal.",
+
4037  __LINE__,
+
4038  {
+
4039  "log_level",
+
4040  },
+
4041  RPCCallTestData::no_exception,
+
4042  R"({
+
4043  "method" : "log_level",
+
4044  "params" : [
+
4045  {
+
4046  "api_version" : %MAX_API_VER%,
+
4047  }
+
4048  ]
+
4049  })"},
+
4050  {"log_level: fatal.",
+
4051  __LINE__,
+
4052  {"log_level", "fatal"},
+
4053  RPCCallTestData::no_exception,
+
4054  R"({
+
4055  "method" : "log_level",
+
4056  "params" : [
+
4057  {
+
4058  "api_version" : %MAX_API_VER%,
+
4059  "severity" : "fatal"
+
4060  }
+
4061  ]
+
4062  })"},
+
4063  {"log_level: error.",
+
4064  __LINE__,
+
4065  {"log_level", "error"},
+
4066  RPCCallTestData::no_exception,
+
4067  R"({
+
4068  "method" : "log_level",
+
4069  "params" : [
+
4070  {
+
4071  "api_version" : %MAX_API_VER%,
+
4072  "severity" : "error"
+
4073  }
+
4074  ]
+
4075  })"},
+
4076  {"log_level: warn.",
+
4077  __LINE__,
+
4078  {"log_level", "warn"},
+
4079  RPCCallTestData::no_exception,
+
4080  R"({
+
4081  "method" : "log_level",
+
4082  "params" : [
+
4083  {
+
4084  "api_version" : %MAX_API_VER%,
+
4085  "severity" : "warn"
+
4086  }
+
4087  ]
+
4088  })"},
+
4089  {"log_level: debug.",
+
4090  __LINE__,
+
4091  {"log_level", "debug"},
+
4092  RPCCallTestData::no_exception,
+
4093  R"({
+
4094  "method" : "log_level",
+
4095  "params" : [
+
4096  {
+
4097  "api_version" : %MAX_API_VER%,
+
4098  "severity" : "debug"
+
4099  }
+
4100  ]
+
4101  })"},
+
4102  {"log_level: trace.",
+
4103  __LINE__,
+
4104  {"log_level", "trace"},
+
4105  RPCCallTestData::no_exception,
+
4106  R"({
+
4107  "method" : "log_level",
+
4108  "params" : [
+
4109  {
+
4110  "api_version" : %MAX_API_VER%,
+
4111  "severity" : "trace"
+
4112  }
+
4113  ]
+
4114  })"},
+
4115  {"log_level: base partition.",
+
4116  __LINE__,
+
4117  {"log_level", "base", "trace"},
+
4118  RPCCallTestData::no_exception,
+
4119  R"({
+
4120  "method" : "log_level",
+
4121  "params" : [
+
4122  {
+
4123  "api_version" : %MAX_API_VER%,
+
4124  "partition" : "base",
+
4125  "severity" : "trace"
+
4126  }
+
4127  ]
+
4128  })"},
+
4129  {"log_level: partiton_name.",
+
4130  __LINE__,
+
4131  {"log_level", "partition_name", "fatal"},
+
4132  RPCCallTestData::no_exception,
+
4133  R"({
+
4134  "method" : "log_level",
+
4135  "params" : [
+
4136  {
+
4137  "api_version" : %MAX_API_VER%,
+
4138  "partition" : "partition_name",
+
4139  "severity" : "fatal"
+
4140  }
+
4141  ]
+
4142  })"},
+
4143  {"log_level: too many arguments.",
+
4144  __LINE__,
+
4145  {"log_level", "partition_name", "fatal", "extra"},
+
4146  RPCCallTestData::no_exception,
+
4147  R"({
+
4148  "method" : "log_level",
+
4149  "params" : [
+
4150  {
+
4151  "error" : "badSyntax",
+
4152  "error_code" : 1,
+
4153  "error_message" : "Syntax error."
+
4154  }
+
4155  ]
+
4156  })"},
+
4157  {"log_level: invalid severity.",
+
4158  __LINE__,
+
4159  {"log_level", "err"},
+
4160  RPCCallTestData::no_exception,
+
4161  R"({
+
4162  "method" : "log_level",
+
4163  "params" : [
+
4164  {
+
4165  "api_version" : %MAX_API_VER%,
+
4166  "severity" : "err"
+
4167  }
+
4168  ]
+
4169  })"},
+
4170  {"log_level: swap partition name and severity.",
+
4171  __LINE__,
+
4172  {
+
4173  "log_level",
+
4174  "fatal",
+
4175  "partition_name",
+
4176  },
+
4177  RPCCallTestData::no_exception,
+
4178  R"({
+
4179  "method" : "log_level",
+
4180  "params" : [
+
4181  {
+
4182  "api_version" : %MAX_API_VER%,
+
4183  "partition" : "fatal",
+
4184  "severity" : "partition_name"
+
4185  }
+
4186  ]
+
4187  })"},
+
4188 
+
4189  // logrotate
+
4190  // -------------------------------------------------------------------
+
4191  {"logrotate: minimal.",
+
4192  __LINE__,
+
4193  {
+
4194  "logrotate",
+
4195  },
+
4196  RPCCallTestData::no_exception,
+
4197  R"({
+
4198  "method" : "logrotate",
+
4199  "params" : [
+
4200  {
+
4201  "api_version" : %MAX_API_VER%,
+
4202  }
+
4203  ]
+
4204  })"},
+
4205  {"logrotate: too many arguments.",
+
4206  __LINE__,
+
4207  {"logrotate", "extra"},
+
4208  RPCCallTestData::no_exception,
+
4209  R"({
+
4210  "method" : "logrotate",
+
4211  "params" : [
+
4212  {
+
4213  "error" : "badSyntax",
+
4214  "error_code" : 1,
+
4215  "error_message" : "Syntax error."
+
4216  }
+
4217  ]
+
4218  })"},
+
4219 
+
4220  // node_to_shard
+
4221  // -------------------------------------------------------------------
+
4222  {"node_to_shard: status.",
+
4223  __LINE__,
+
4224  {"node_to_shard", "status"},
+
4225  RPCCallTestData::no_exception,
+
4226  R"({
+
4227  "method" : "node_to_shard",
+
4228  "params" : [
+
4229  {
+
4230  "api_version" : %MAX_API_VER%,
+
4231  "action" : "status"
+
4232  }
+
4233  ]
+
4234  })"},
+
4235  {"node_to_shard: start.",
+
4236  __LINE__,
+
4237  {"node_to_shard", "start"},
+
4238  RPCCallTestData::no_exception,
+
4239  R"({
+
4240  "method" : "node_to_shard",
+
4241  "params" : [
+
4242  {
+
4243  "api_version" : %MAX_API_VER%,
+
4244  "action" : "start"
+
4245  }
+
4246  ]
+
4247  })"},
+
4248  {"node_to_shard: stop.",
+
4249  __LINE__,
+
4250  {"node_to_shard", "stop"},
+
4251  RPCCallTestData::no_exception,
+
4252  R"({
+
4253  "method" : "node_to_shard",
+
4254  "params" : [
+
4255  {
+
4256  "api_version" : %MAX_API_VER%,
+
4257  "action" : "stop"
+
4258  }
+
4259  ]
+
4260  })"},
+
4261  {"node_to_shard: too many arguments.",
+
4262  __LINE__,
+
4263  {"node_to_shard", "start", "stop"},
+
4264  RPCCallTestData::no_exception,
+
4265  R"({
+
4266  "method" : "node_to_shard",
+
4267  "params" : [
+
4268  {
+
4269  "error" : "badSyntax",
+
4270  "error_code" : 1,
+
4271  "error_message" : "Syntax error."
+
4272  }
+
4273  ]
+
4274  })"},
+
4275  {"node_to_shard: invalid argument.",
+
4276  __LINE__,
+
4277  {"node_to_shard", "invalid"},
+
4278  RPCCallTestData::no_exception,
+
4279  R"({
+
4280  "method" : "node_to_shard",
+
4281  "params" : [
+
4282  {
+
4283  "api_version" : %MAX_API_VER%,
+
4284  "action" : "invalid"
+
4285  }
+
4286  ]
+
4287  })"},
+
4288 
+
4289  // owner_info
+
4290  // ------------------------------------------------------------------
+
4291  {"owner_info: minimal.",
+
4292  __LINE__,
+
4293  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
4294  RPCCallTestData::no_exception,
+
4295  R"({
+
4296  "method" : "owner_info",
+
4297  "params" : [
+
4298  {
+
4299  "api_version" : %MAX_API_VER%,
+
4300  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"
+
4301  }
+
4302  ]
+
4303  })"},
+
4304  {"owner_info: with numeric ledger index.",
+
4305  __LINE__,
+
4306  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "987654321"},
+
4307  RPCCallTestData::no_exception,
+
4308  R"({
+
4309  "method" : "owner_info",
+
4310  "params" : [
+
4311  {
+
4312  "api_version" : %MAX_API_VER%,
+
4313  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4314  "ledger_index" : 987654321
+
4315  }
+
4316  ]
+
4317  })"},
+
4318  {"owner_info: with text ledger index.",
+
4319  __LINE__,
+
4320  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
4321  RPCCallTestData::no_exception,
+
4322  R"({
+
4323  "method" : "owner_info",
+
4324  "params" : [
+
4325  {
+
4326  "api_version" : %MAX_API_VER%,
+
4327  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4328  "ledger_index" : "validated"
+
4329  }
+
4330  ]
+
4331  })"},
+
4332  {"owner_info: with ledger hash.",
+
4333  __LINE__,
+
4334  {"owner_info",
+
4335  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4336  "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"},
+
4337  RPCCallTestData::no_exception,
+
4338  R"({
+
4339  "method" : "owner_info",
+
4340  "params" : [
+
4341  {
+
4342  "api_version" : %MAX_API_VER%,
+
4343  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4344  "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
+
4345  }
+
4346  ]
+
4347  })"},
+
4348  {"owner_info: with ledger index.",
+
4349  __LINE__,
+
4350  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "validated"},
+
4351  RPCCallTestData::no_exception,
+
4352  R"({
+
4353  "method" : "owner_info",
+
4354  "params" : [
+
4355  {
+
4356  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4357  "api_version" : %MAX_API_VER%,
+
4358  "ledger_index" : "validated"
+
4359  }
+
4360  ]
+
4361  })"},
+
4362  {"owner_info: too few arguments.",
+
4363  __LINE__,
+
4364  {
+
4365  "owner_info",
+
4366  },
+
4367  RPCCallTestData::no_exception,
+
4368  R"({
+
4369  "method" : "owner_info",
+
4370  "params" : [
+
4371  {
+
4372  "error" : "badSyntax",
+
4373  "error_code" : 1,
+
4374  "error_message" : "Syntax error."
+
4375  }
+
4376  ]
+
4377  })"},
+
4378  {"owner_info: too many arguments.",
+
4379  __LINE__,
+
4380  {
+
4381  "owner_info",
+
4382  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4383  "current",
+
4384  "extra1",
+
4385  "extra2",
+
4386  },
+
4387  RPCCallTestData::no_exception,
+
4388  R"({
+
4389  "method" : "owner_info",
+
4390  "params" : [
+
4391  {
+
4392  "error" : "badSyntax",
+
4393  "error_code" : 1,
+
4394  "error_message" : "Syntax error."
+
4395  }
+
4396  ]
+
4397  })"},
+
4398  {
+
4399  "owner_info: invalid accountID.",
+
4400  __LINE__,
+
4401  {
+
4402  "owner_info",
+
4403  "", // Note: very few values are detected as bad!
+
4404  },
+
4405  RPCCallTestData::no_exception,
+
4406  R"({
+
4407  "method" : "owner_info",
+
4408  "params" : [
+
4409  {
+
4410  "error" : "actMalformed",
+
4411  "error_code" : 35,
+
4412  "error_message" : "Account malformed."
+
4413  }
+
4414  ]
+
4415  })",
+
4416  },
+
4417  {
+
4418  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
4419  // cannot currently occur because jvParseLedger() always returns true.
+
4420  "owner_info: invalid ledger selection.",
+
4421  __LINE__,
+
4422  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
4423  RPCCallTestData::no_exception,
+
4424  R"({
+
4425  "method" : "owner_info",
+
4426  "params" : [
+
4427  {
+
4428  "api_version" : %MAX_API_VER%,
+
4429  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4430  "ledger_index" : 0
+
4431  }
+
4432  ]
+
4433  })",
+
4434  },
+
4435  {
+
4436  // Note: there is code in place to return rpcLGR_IDX_MALFORMED. That
+
4437  // cannot currently occur because jvParseLedger() always returns true.
+
4438  "owner_info: invalid ledger selection.",
+
4439  __LINE__,
+
4440  {"owner_info", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "no_ledger"},
+
4441  RPCCallTestData::no_exception,
+
4442  R"({
+
4443  "method" : "owner_info",
+
4444  "params" : [
+
4445  {
+
4446  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4447  "api_version" : %MAX_API_VER%,
+
4448  "ledger_index" : 0
+
4449  }
+
4450  ]
+
4451  })",
+
4452  },
+
4453 
+
4454  // peers
+
4455  // -----------------------------------------------------------------------
+
4456  {"peers: minimal.",
+
4457  __LINE__,
+
4458  {
+
4459  "peers",
+
4460  },
+
4461  RPCCallTestData::no_exception,
+
4462  R"({
+
4463  "method" : "peers",
+
4464  "params" : [
+
4465  {
+
4466  "api_version" : %MAX_API_VER%,
+
4467  }
+
4468  ]
+
4469  })"},
+
4470  {"peers: too many arguments.",
+
4471  __LINE__,
+
4472  {"peers", "extra"},
+
4473  RPCCallTestData::no_exception,
+
4474  R"({
+
4475  "method" : "peers",
+
4476  "params" : [
+
4477  {
+
4478  "error" : "badSyntax",
+
4479  "error_code" : 1,
+
4480  "error_message" : "Syntax error."
+
4481  }
+
4482  ]
+
4483  })"},
+
4484 
+
4485  // peer_reservations_add
+
4486  // -------------------------------------------------------
+
4487  {"peer_reservations_add: minimal.",
+
4488  __LINE__,
+
4489  {"peer_reservations_add", "public_key_string"},
+
4490  RPCCallTestData::no_exception,
+
4491  R"({
+
4492  "method" : "peer_reservations_add",
+
4493  "params" : [
+
4494  {
+
4495  "api_version" : %MAX_API_VER%,
+
4496  "public_key" : "public_key_string"
+
4497  }
+
4498  ]
+
4499  })"},
+
4500  {"peer_reservations_add: with description.",
+
4501  __LINE__,
+
4502  {"peer_reservations_add", "public_key_string", "public_key_description"},
+
4503  RPCCallTestData::no_exception,
+
4504  R"({
+
4505  "method" : "peer_reservations_add",
+
4506  "params" : [
+
4507  {
+
4508  "api_version" : %MAX_API_VER%,
+
4509  "description" : "public_key_description",
+
4510  "public_key" : "public_key_string"
+
4511  }
+
4512  ]
+
4513  })"},
+
4514  {"peer_reservations_add: too few arguments.",
+
4515  __LINE__,
+
4516  {"peer_reservations_add"},
+
4517  RPCCallTestData::no_exception,
+
4518  R"({
+
4519  "method" : "peer_reservations_add",
+
4520  "params" : [
+
4521  {
+
4522  "error" : "badSyntax",
+
4523  "error_code" : 1,
+
4524  "error_message" : "Syntax error."
+
4525  }
+
4526  ]
+
4527  })"},
+
4528  {"peer_reservations_add: too many arguments.",
+
4529  __LINE__,
+
4530  {"peer_reservations_add",
+
4531  "public_key_string",
+
4532  "public_key_description",
+
4533  "spare"},
+
4534  RPCCallTestData::no_exception,
+
4535  R"({
+
4536  "method" : "peer_reservations_add",
+
4537  "params" : [
+
4538  {
+
4539  "error" : "badSyntax",
+
4540  "error_code" : 1,
+
4541  "error_message" : "Syntax error."
+
4542  }
+
4543  ]
+
4544  })"},
+
4545 
+
4546  // peer_reservations_del
+
4547  // -------------------------------------------------------
+
4548  {"peer_reservations_del: minimal.",
+
4549  __LINE__,
+
4550  {"peer_reservations_del", "public_key_string"},
+
4551  RPCCallTestData::no_exception,
+
4552  R"({
+
4553  "method" : "peer_reservations_del",
+
4554  "params" : [
+
4555  {
+
4556  "api_version" : %MAX_API_VER%,
+
4557  "public_key" : "public_key_string"
+
4558  }
+
4559  ]
+
4560  })"},
+
4561  {"peer_reservations_del: too few arguments.",
+
4562  __LINE__,
+
4563  {"peer_reservations_del"},
+
4564  RPCCallTestData::no_exception,
+
4565  R"({
+
4566  "method" : "peer_reservations_del",
+
4567  "params" : [
+
4568  {
+
4569  "error" : "badSyntax",
+
4570  "error_code" : 1,
+
4571  "error_message" : "Syntax error."
+
4572  }
+
4573  ]
+
4574  })"},
+
4575  {"peer_reservations_del: too many arguments.",
+
4576  __LINE__,
+
4577  {"peer_reservations_del",
+
4578  "public_key_string",
+
4579  "public_key_description",
+
4580  "spare"},
+
4581  RPCCallTestData::no_exception,
+
4582  R"({
+
4583  "method" : "peer_reservations_del",
+
4584  "params" : [
+
4585  {
+
4586  "error" : "badSyntax",
+
4587  "error_code" : 1,
+
4588  "error_message" : "Syntax error."
+
4589  }
+
4590  ]
+
4591  })"},
+
4592 
+
4593  // ping
+
4594  // ------------------------------------------------------------------------
+
4595  {"ping: minimal.",
+
4596  __LINE__,
+
4597  {
+
4598  "ping",
+
4599  },
+
4600  RPCCallTestData::no_exception,
+
4601  R"({
+
4602  "method" : "ping",
+
4603  "params" : [
+
4604  {
+
4605  "api_version" : %MAX_API_VER%,
+
4606  }
+
4607  ]
+
4608  })"},
+
4609  {"ping: too many arguments.",
+
4610  __LINE__,
+
4611  {"ping", "extra"},
+
4612  RPCCallTestData::no_exception,
+
4613  R"({
+
4614  "method" : "ping",
+
4615  "params" : [
+
4616  {
+
4617  "error" : "badSyntax",
+
4618  "error_code" : 1,
+
4619  "error_message" : "Syntax error."
+
4620  }
+
4621  ]
+
4622  })"},
+
4623 
+
4624  // print
+
4625  // -----------------------------------------------------------------------
+
4626  {"print: minimal.",
+
4627  __LINE__,
+
4628  {
+
4629  "print",
+
4630  },
+
4631  RPCCallTestData::no_exception,
+
4632  R"({
+
4633  "method" : "print",
+
4634  "params" : [
+
4635  {
+
4636  "api_version" : %MAX_API_VER%,
+
4637  }
+
4638  ]
+
4639  })"},
+
4640  {// The docs indicate that no arguments are allowed. So should this error?
+
4641  "print: extra argument.",
+
4642  __LINE__,
+
4643  {"print", "extra"},
+
4644  RPCCallTestData::no_exception,
+
4645  R"({
+
4646  "method" : "print",
+
4647  "params" : [
+
4648  {
+
4649  "api_version" : %MAX_API_VER%,
+
4650  "params" : [ "extra" ]
+
4651  }
+
4652  ]
+
4653  })"},
+
4654  {"print: too many arguments.",
+
4655  __LINE__,
+
4656  {"print", "extra1", "extra2"},
+
4657  RPCCallTestData::no_exception,
+
4658  R"({
+
4659  "method" : "print",
+
4660  "params" : [
+
4661  {
+
4662  "error" : "badSyntax",
+
4663  "error_code" : 1,
+
4664  "error_message" : "Syntax error."
+
4665  }
+
4666  ]
+
4667  })"},
+
4668 
+
4669  // random
+
4670  // ----------------------------------------------------------------------
+
4671  {"random: minimal.",
+
4672  __LINE__,
+
4673  {
+
4674  "random",
+
4675  },
+
4676  RPCCallTestData::no_exception,
+
4677  R"({
+
4678  "method" : "random",
+
4679  "params" : [
+
4680  {
+
4681  "api_version" : %MAX_API_VER%,
+
4682  }
+
4683  ]
+
4684  })"},
+
4685  {"random: too many arguments.",
+
4686  __LINE__,
+
4687  {"random", "extra"},
+
4688  RPCCallTestData::no_exception,
+
4689  R"({
+
4690  "method" : "random",
+
4691  "params" : [
+
4692  {
+
4693  "error" : "badSyntax",
+
4694  "error_code" : 1,
+
4695  "error_message" : "Syntax error."
+
4696  }
+
4697  ]
+
4698  })"},
+
4699 
+
4700  // ripple_path_find
+
4701  // ------------------------------------------------------------
+
4702  {"ripple_path_find: minimal.",
+
4703  __LINE__,
+
4704  {
+
4705  "ripple_path_find",
+
4706  R"({"json_argument":true})",
+
4707  },
+
4708  RPCCallTestData::no_exception,
+
4709  R"({
+
4710  "method" : "ripple_path_find",
+
4711  "params" : [
+
4712  {
+
4713  "api_version" : %MAX_API_VER%,
+
4714  "json_argument" : true
+
4715  }
+
4716  ]
+
4717  })"},
+
4718  {"ripple_path_find: ledger index.",
+
4719  __LINE__,
+
4720  {"ripple_path_find", R"({"json_argument":true})", "4294967295"},
+
4721  RPCCallTestData::no_exception,
+
4722  R"({
+
4723  "method" : "ripple_path_find",
+
4724  "params" : [
+
4725  {
+
4726  "api_version" : %MAX_API_VER%,
+
4727  "json_argument" : true,
+
4728  "ledger_index" : 4294967295
+
4729  }
+
4730  ]
+
4731  })"},
+
4732  {"ripple_path_find: text ledger index.",
+
4733  __LINE__,
+
4734  {"ripple_path_find", R"({"json_argument":true})", "closed"},
+
4735  RPCCallTestData::no_exception,
+
4736  R"({
+
4737  "method" : "ripple_path_find",
+
4738  "params" : [
+
4739  {
+
4740  "api_version" : %MAX_API_VER%,
+
4741  "json_argument" : true,
+
4742  "ledger_index" : "closed"
+
4743  }
+
4744  ]
+
4745  })"},
+
4746  {"ripple_path_find: ledger hash.",
+
4747  __LINE__,
+
4748  {"ripple_path_find",
+
4749  R"({"json_argument":true})",
+
4750  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"},
+
4751  RPCCallTestData::no_exception,
+
4752  R"({
+
4753  "method" : "ripple_path_find",
+
4754  "params" : [
+
4755  {
+
4756  "api_version" : %MAX_API_VER%,
+
4757  "json_argument" : true,
+
4758  "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
4759  }
+
4760  ]
+
4761  })"},
+
4762 
+
4763  {"ripple_path_find: too few arguments.",
+
4764  __LINE__,
+
4765  {
+
4766  "ripple_path_find",
+
4767  },
+
4768  RPCCallTestData::no_exception,
+
4769  R"({
+
4770  "method" : "ripple_path_find",
+
4771  "params" : [
+
4772  {
+
4773  "error" : "badSyntax",
+
4774  "error_code" : 1,
+
4775  "error_message" : "Syntax error."
+
4776  }
+
4777  ]
+
4778  })"},
+
4779  {"ripple_path_find: too many arguments.",
+
4780  __LINE__,
+
4781  {"ripple_path_find", R"({"json_argument":true})", "current", "extra"},
+
4782  RPCCallTestData::no_exception,
+
4783  R"({
+
4784  "method" : "ripple_path_find",
+
4785  "params" : [
+
4786  {
+
4787  "error" : "badSyntax",
+
4788  "error_code" : 1,
+
4789  "error_message" : "Syntax error."
+
4790  }
+
4791  ]
+
4792  })"},
+
4793  {"ripple_path_find: invalid json (note extra comma).",
+
4794  __LINE__,
+
4795  {
+
4796  "ripple_path_find",
+
4797  R"({"json_argument":true,})",
+
4798  },
+
4799  RPCCallTestData::no_exception,
+
4800  R"({
+
4801  "method" : "ripple_path_find",
+
4802  "params" : [
+
4803  {
+
4804  "error" : "invalidParams",
+
4805  "error_code" : 31,
+
4806  "error_message" : "Invalid parameters."
+
4807  }
+
4808  ]
+
4809  })"},
+
4810  {"ripple_path_find: ledger index too small.",
+
4811  __LINE__,
+
4812  {"ripple_path_find", R"({"json_argument":true})", "-1"},
+
4813  RPCCallTestData::no_exception,
+
4814  R"({
+
4815  "method" : "ripple_path_find",
+
4816  "params" : [
+
4817  {
+
4818  "api_version" : %MAX_API_VER%,
+
4819  "json_argument" : true,
+
4820  "ledger_index" : 0
+
4821  }
+
4822  ]
+
4823  })"},
+
4824  {"ripple_path_find: ledger index too big.",
+
4825  __LINE__,
+
4826  {"ripple_path_find", R"({"json_argument":true})", "4294967296"},
+
4827  RPCCallTestData::no_exception,
+
4828  R"({
+
4829  "method" : "ripple_path_find",
+
4830  "params" : [
+
4831  {
+
4832  "api_version" : %MAX_API_VER%,
+
4833  "json_argument" : true,
+
4834  "ledger_index" : 0
+
4835  }
+
4836  ]
+
4837  })"},
+
4838  {"ripple_path_find: invalid text ledger index.",
+
4839  __LINE__,
+
4840  {"ripple_path_find", R"({"json_argument":true})", "cur"},
+
4841  RPCCallTestData::no_exception,
+
4842  R"({
+
4843  "method" : "ripple_path_find",
+
4844  "params" : [
+
4845  {
+
4846  "api_version" : %MAX_API_VER%,
+
4847  "json_argument" : true,
+
4848  "ledger_index" : 0
+
4849  }
+
4850  ]
+
4851  })"},
+
4852 
+
4853  // sign
+
4854  // ------------------------------------------------------------------------
+
4855  {"sign: minimal.",
+
4856  __LINE__,
+
4857  {
+
4858  "sign",
+
4859  "my_secret",
+
4860  R"({"json_argument":true})",
+
4861  },
+
4862  RPCCallTestData::no_exception,
+
4863  R"({
+
4864  "method" : "sign",
+
4865  "params" : [
+
4866  {
+
4867  "api_version" : %MAX_API_VER%,
+
4868  "secret" : "my_secret",
+
4869  "tx_json" : {
+
4870  "json_argument" : true
+
4871  }
+
4872  }
+
4873  ]
+
4874  })"},
+
4875  {"sign: offline.",
+
4876  __LINE__,
+
4877  {"sign", "my_secret", R"({"json_argument":true})", "offline"},
+
4878  RPCCallTestData::no_exception,
+
4879  R"({
+
4880  "method" : "sign",
+
4881  "params" : [
+
4882  {
+
4883  "api_version" : %MAX_API_VER%,
+
4884  "offline" : true,
+
4885  "secret" : "my_secret",
+
4886  "tx_json" : {
+
4887  "json_argument" : true
+
4888  }
+
4889  }
+
4890  ]
+
4891  })"},
+
4892  {"sign: too few arguments.",
+
4893  __LINE__,
+
4894  {"sign", "contents_of_blob"},
+
4895  RPCCallTestData::no_exception,
+
4896  R"({
+
4897  "method" : "sign",
+
4898  "params" : [
+
4899  {
+
4900  "error" : "badSyntax",
+
4901  "error_code" : 1,
+
4902  "error_message" : "Syntax error."
+
4903  }
+
4904  ]
+
4905  })"},
+
4906  {"sign: too many arguments.",
+
4907  __LINE__,
+
4908  {"sign", "my_secret", R"({"json_argument":true})", "offline", "extra"},
+
4909  RPCCallTestData::no_exception,
+
4910  R"({
+
4911  "method" : "sign",
+
4912  "params" : [
+
4913  {
+
4914  "error" : "badSyntax",
+
4915  "error_code" : 1,
+
4916  "error_message" : "Syntax error."
+
4917  }
+
4918  ]
+
4919  })"},
+
4920  {"sign: invalid JSON (note extra comma).",
+
4921  __LINE__,
+
4922  {
+
4923  "sign",
+
4924  "my_secret",
+
4925  R"({"json_argument":true,})",
+
4926  },
+
4927  RPCCallTestData::no_exception,
+
4928  R"({
+
4929  "method" : "sign",
+
4930  "params" : [
+
4931  {
+
4932  "error" : "invalidParams",
+
4933  "error_code" : 31,
+
4934  "error_message" : "Invalid parameters."
+
4935  }
+
4936  ]
+
4937  })"},
+
4938  {"sign: invalid final argument.",
+
4939  __LINE__,
+
4940  {"sign", "my_secret", R"({"json_argument":true})", "offlin"},
+
4941  RPCCallTestData::no_exception,
+
4942  R"({
+
4943  "method" : "sign",
+
4944  "params" : [
+
4945  {
+
4946  "error" : "invalidParams",
+
4947  "error_code" : 31,
+
4948  "error_message" : "Invalid parameters."
+
4949  }
+
4950  ]
+
4951  })"},
+
4952 
+
4953  // sign_for
+
4954  // --------------------------------------------------------------------
+
4955  {"sign_for: minimal.",
+
4956  __LINE__,
+
4957  {
+
4958  "sign_for",
+
4959  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4960  "my_secret",
+
4961  R"({"json_argument":true})",
+
4962  },
+
4963  RPCCallTestData::no_exception,
+
4964  R"({
+
4965  "method" : "sign_for",
+
4966  "params" : [
+
4967  {
+
4968  "api_version" : %MAX_API_VER%,
+
4969  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4970  "secret" : "my_secret",
+
4971  "tx_json" : {
+
4972  "json_argument" : true
+
4973  }
+
4974  }
+
4975  ]
+
4976  })"},
+
4977  {"sign_for: offline.",
+
4978  __LINE__,
+
4979  {"sign_for",
+
4980  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4981  "my_secret",
+
4982  R"({"json_argument":true})",
+
4983  "offline"},
+
4984  RPCCallTestData::no_exception,
+
4985  R"({
+
4986  "method" : "sign_for",
+
4987  "params" : [
+
4988  {
+
4989  "api_version" : %MAX_API_VER%,
+
4990  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
4991  "offline" : true,
+
4992  "secret" : "my_secret",
+
4993  "tx_json" : {
+
4994  "json_argument" : true
+
4995  }
+
4996  }
+
4997  ]
+
4998  })"},
+
4999  {"sign_for: too few arguments.",
+
5000  __LINE__,
+
5001  {
+
5002  "sign_for",
+
5003  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5004  "my_secret",
+
5005  },
+
5006  RPCCallTestData::no_exception,
+
5007  R"({
+
5008  "method" : "sign_for",
+
5009  "params" : [
+
5010  {
+
5011  "error" : "badSyntax",
+
5012  "error_code" : 1,
+
5013  "error_message" : "Syntax error."
+
5014  }
+
5015  ]
+
5016  })"},
+
5017  {"sign_for: too many arguments.",
+
5018  __LINE__,
+
5019  {"sign_for",
+
5020  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5021  "my_secret",
+
5022  R"({"json_argument":true})",
+
5023  "offline",
+
5024  "extra"},
+
5025  RPCCallTestData::no_exception,
+
5026  R"({
+
5027  "method" : "sign_for",
+
5028  "params" : [
+
5029  {
+
5030  "error" : "badSyntax",
+
5031  "error_code" : 1,
+
5032  "error_message" : "Syntax error."
+
5033  }
+
5034  ]
+
5035  })"},
+
5036  {"sign_for: invalid json (note extra comma).",
+
5037  __LINE__,
+
5038  {
+
5039  "sign_for",
+
5040  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5041  "my_secret",
+
5042  R"({"json_argument":true,})",
+
5043  },
+
5044  RPCCallTestData::no_exception,
+
5045  R"({
+
5046  "method" : "sign_for",
+
5047  "params" : [
+
5048  {
+
5049  "error" : "invalidParams",
+
5050  "error_code" : 31,
+
5051  "error_message" : "Invalid parameters."
+
5052  }
+
5053  ]
+
5054  })"},
+
5055  {"sign_for: invalid final argument.",
+
5056  __LINE__,
+
5057  {"sign_for",
+
5058  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5059  "my_secret",
+
5060  R"({"json_argument":true})",
+
5061  "ofline"},
+
5062  RPCCallTestData::no_exception,
+
5063  R"({
+
5064  "method" : "sign_for",
+
5065  "params" : [
+
5066  {
+
5067  "error" : "invalidParams",
+
5068  "error_code" : 31,
+
5069  "error_message" : "Invalid parameters."
+
5070  }
+
5071  ]
+
5072  })"},
+
5073 
+
5074  // submit
+
5075  // ----------------------------------------------------------------------
+
5076  {"submit: blob.",
+
5077  __LINE__,
+
5078  {"submit", "the blob is unvalidated and may be any length..."},
+
5079  RPCCallTestData::no_exception,
+
5080  R"({
+
5081  "method" : "submit",
+
5082  "params" : [
+
5083  {
+
5084  "api_version" : %MAX_API_VER%,
+
5085  "tx_blob" : "the blob is unvalidated and may be any length..."
+
5086  }
+
5087  ]
+
5088  })"},
+
5089  {"submit: json.",
+
5090  __LINE__,
+
5091  {
+
5092  "submit",
+
5093  "my_secret",
+
5094  R"({"json_argument":true})",
+
5095  },
+
5096  RPCCallTestData::no_exception,
+
5097  R"({
+
5098  "method" : "submit",
+
5099  "params" : [
+
5100  {
+
5101  "api_version" : %MAX_API_VER%,
+
5102  "secret" : "my_secret",
+
5103  "tx_json" : {
+
5104  "json_argument" : true
+
5105  }
+
5106  }
+
5107  ]
+
5108  })"},
+
5109  {"submit: too few arguments.",
+
5110  __LINE__,
+
5111  {
+
5112  "submit",
+
5113  },
+
5114  RPCCallTestData::no_exception,
+
5115  R"({
+
5116  "method" : "submit",
+
5117  "params" : [
+
5118  {
+
5119  "error" : "badSyntax",
+
5120  "error_code" : 1,
+
5121  "error_message" : "Syntax error."
+
5122  }
+
5123  ]
+
5124  })"},
+
5125  {// Note: I believe this _ought_ to be detected as too many arguments.
+
5126  "submit: four arguments.",
+
5127  __LINE__,
+
5128  {"submit", "my_secret", R"({"json_argument":true})", "offline"},
+
5129  RPCCallTestData::no_exception,
+
5130  R"({
+
5131  "method" : "submit",
+
5132  "params" : [
+
5133  {
+
5134  "api_version" : %MAX_API_VER%,
+
5135  "offline" : true,
+
5136  "secret" : "my_secret",
+
5137  "tx_json" : {
+
5138  "json_argument" : true
+
5139  }
+
5140  }
+
5141  ]
+
5142  })"},
+
5143  {"submit: too many arguments.",
+
5144  __LINE__,
+
5145  {"submit", "my_secret", R"({"json_argument":true})", "offline", "extra"},
+
5146  RPCCallTestData::no_exception,
+
5147  R"({
+
5148  "method" : "submit",
+
5149  "params" : [
+
5150  {
+
5151  "error" : "badSyntax",
+
5152  "error_code" : 1,
+
5153  "error_message" : "Syntax error."
+
5154  }
+
5155  ]
+
5156  })"},
+
5157  {"submit: invalid json (note extra comma).",
+
5158  __LINE__,
+
5159  {
+
5160  "submit",
+
5161  "my_secret",
+
5162  R"({"json_argument":true,})",
+
5163  },
+
5164  RPCCallTestData::no_exception,
+
5165  R"({
+
5166  "method" : "submit",
+
5167  "params" : [
+
5168  {
+
5169  "error" : "invalidParams",
+
5170  "error_code" : 31,
+
5171  "error_message" : "Invalid parameters."
+
5172  }
+
5173  ]
+
5174  })"},
+
5175  {"submit: last argument not \"offline\".",
+
5176  __LINE__,
+
5177  {"submit", "my_secret", R"({"json_argument":true})", "offlne"},
+
5178  RPCCallTestData::no_exception,
+
5179  R"({
+
5180  "method" : "submit",
+
5181  "params" : [
+
5182  {
+
5183  "error" : "invalidParams",
+
5184  "error_code" : 31,
+
5185  "error_message" : "Invalid parameters."
+
5186  }
+
5187  ]
+
5188  })"},
+
5189 
+
5190  // submit_multisigned
+
5191  // ----------------------------------------------------------
+
5192  {"submit_multisigned: json.",
+
5193  __LINE__,
+
5194  {
+
5195  "submit_multisigned",
+
5196  R"({"json_argument":true})",
+
5197  },
+
5198  RPCCallTestData::no_exception,
+
5199  R"({
+
5200  "method" : "submit_multisigned",
+
5201  "params" : [
+
5202  {
+
5203  "api_version" : %MAX_API_VER%,
+
5204  "tx_json" : {
+
5205  "json_argument" : true
+
5206  }
+
5207  }
+
5208  ]
+
5209  })"},
+
5210  {"submit_multisigned: too few arguments.",
+
5211  __LINE__,
+
5212  {
+
5213  "submit_multisigned",
+
5214  },
+
5215  RPCCallTestData::no_exception,
+
5216  R"({
+
5217  "method" : "submit_multisigned",
+
5218  "params" : [
+
5219  {
+
5220  "error" : "badSyntax",
+
5221  "error_code" : 1,
+
5222  "error_message" : "Syntax error."
+
5223  }
+
5224  ]
+
5225  })"},
+
5226  {"submit_multisigned: too many arguments.",
+
5227  __LINE__,
+
5228  {"submit_multisigned", R"({"json_argument":true})", "extra"},
+
5229  RPCCallTestData::no_exception,
+
5230  R"({
+
5231  "method" : "submit_multisigned",
+
5232  "params" : [
+
5233  {
+
5234  "error" : "badSyntax",
+
5235  "error_code" : 1,
+
5236  "error_message" : "Syntax error."
+
5237  }
+
5238  ]
+
5239  })"},
+
5240  {"submit_multisigned: invalid json (note extra comma).",
+
5241  __LINE__,
+
5242  {
+
5243  "submit_multisigned",
+
5244  R"({"json_argument":true,})",
+
5245  },
+
5246  RPCCallTestData::no_exception,
+
5247  R"({
+
5248  "method" : "submit_multisigned",
+
5249  "params" : [
+
5250  {
+
5251  "error" : "invalidParams",
+
5252  "error_code" : 31,
+
5253  "error_message" : "Invalid parameters."
+
5254  }
+
5255  }
+
5256  ]
+
5257  })"},
+
5258 
+
5259  // server_info
+
5260  // -----------------------------------------------------------------
+
5261  {"server_info: minimal.",
+
5262  __LINE__,
+
5263  {
+
5264  "server_info",
+
5265  },
+
5266  RPCCallTestData::no_exception,
+
5267  R"({
+
5268  "method" : "server_info",
+
5269  "params" : [
+
5270  {
+
5271  "api_version" : %MAX_API_VER%,
+
5272  }
+
5273  ]
+
5274  })"},
+
5275  {"server_info: counters.",
+
5276  __LINE__,
+
5277  {"server_info", "counters"},
+
5278  RPCCallTestData::no_exception,
+
5279  R"({
+
5280  "method" : "server_info",
+
5281  "params" : [
+
5282  {
+
5283  "api_version" : %MAX_API_VER%,
+
5284  "counters" : true
+
5285  }
+
5286  ]
+
5287  })"},
+
5288  {"server_info: too many arguments.",
+
5289  __LINE__,
+
5290  {"server_info", "counters", "extra"},
+
5291  RPCCallTestData::no_exception,
+
5292  R"({
+
5293  "method" : "server_info",
+
5294  "params" : [
+
5295  {
+
5296  "error" : "badSyntax",
+
5297  "error_code" : 1,
+
5298  "error_message" : "Syntax error."
+
5299  }
+
5300  ]
+
5301  })"},
+
5302  {"server_info: non-counters argument.",
+
5303  __LINE__,
+
5304  {"server_info", "counter"},
+
5305  RPCCallTestData::no_exception,
+
5306  R"({
+
5307  "method" : "server_info",
+
5308  "params" : [
+
5309  {
+
5310  "api_version" : %MAX_API_VER%,
+
5311  }
+
5312  ]
+
5313  })"},
+
5314 
+
5315  // server_state
+
5316  // ----------------------------------------------------------------
+
5317  {"server_state: minimal.",
+
5318  __LINE__,
+
5319  {
+
5320  "server_state",
+
5321  },
+
5322  RPCCallTestData::no_exception,
+
5323  R"({
+
5324  "method" : "server_state",
+
5325  "params" : [
+
5326  {
+
5327  "api_version" : %MAX_API_VER%,
+
5328  }
+
5329  ]
+
5330  })"},
+
5331  {"server_state: counters.",
+
5332  __LINE__,
+
5333  {"server_state", "counters"},
+
5334  RPCCallTestData::no_exception,
+
5335  R"({
+
5336  "method" : "server_state",
+
5337  "params" : [
+
5338  {
+
5339  "api_version" : %MAX_API_VER%,
+
5340  "counters" : true
+
5341  }
+
5342  ]
+
5343  })"},
+
5344  {"server_state: too many arguments.",
+
5345  __LINE__,
+
5346  {"server_state", "counters", "extra"},
+
5347  RPCCallTestData::no_exception,
+
5348  R"({
+
5349  "method" : "server_state",
+
5350  "params" : [
+
5351  {
+
5352  "error" : "badSyntax",
+
5353  "error_code" : 1,
+
5354  "error_message" : "Syntax error."
+
5355  }
+
5356  ]
+
5357  })"},
+
5358  {"server_state: non-counters argument.",
+
5359  __LINE__,
+
5360  {"server_state", "counter"},
+
5361  RPCCallTestData::no_exception,
+
5362  R"({
+
5363  "method" : "server_state",
+
5364  "params" : [
+
5365  {
+
5366  "api_version" : %MAX_API_VER%,
+
5367  }
+
5368  ]
+
5369  })"},
+
5370 
+
5371  // stop
+
5372  // ------------------------------------------------------------------------
+
5373  {"stop: minimal.",
+
5374  __LINE__,
+
5375  {
+
5376  "stop",
+
5377  },
+
5378  RPCCallTestData::no_exception,
+
5379  R"({
+
5380  "method" : "stop",
+
5381  "params" : [
+
5382  {
+
5383  "api_version" : %MAX_API_VER%,
+
5384  }
+
5385  ]
+
5386  })"},
+
5387  {"stop: too many arguments.",
+
5388  __LINE__,
+
5389  {"stop", "extra"},
+
5390  RPCCallTestData::no_exception,
+
5391  R"({
+
5392  "method" : "stop",
+
5393  "params" : [
+
5394  {
+
5395  "error" : "badSyntax",
+
5396  "error_code" : 1,
+
5397  "error_message" : "Syntax error."
+
5398  }
+
5399  ]
+
5400  })"},
+
5401 
+
5402  // transaction_entry
+
5403  // -----------------------------------------------------------
+
5404  {"transaction_entry: ledger index.",
+
5405  __LINE__,
+
5406  {"transaction_entry",
+
5407  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5408  "4294967295"},
+
5409  RPCCallTestData::no_exception,
+
5410  R"({
+
5411  "method" : "transaction_entry",
+
5412  "params" : [
+
5413  {
+
5414  "api_version" : %MAX_API_VER%,
+
5415  "ledger_index" : 4294967295,
+
5416  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
5417  }
+
5418  ]
+
5419  })"},
+
5420  {"transaction_entry: text ledger index.",
+
5421  __LINE__,
+
5422  {"transaction_entry",
+
5423  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5424  "current"},
+
5425  RPCCallTestData::no_exception,
+
5426  R"({
+
5427  "method" : "transaction_entry",
+
5428  "params" : [
+
5429  {
+
5430  "api_version" : %MAX_API_VER%,
+
5431  "ledger_index" : "current",
+
5432  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
5433  }
+
5434  ]
+
5435  })"},
+
5436  {"transaction_entry: ledger hash.",
+
5437  __LINE__,
+
5438  {"transaction_entry",
+
5439  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5440  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210"},
+
5441  RPCCallTestData::no_exception,
+
5442  R"({
+
5443  "method" : "transaction_entry",
+
5444  "params" : [
+
5445  {
+
5446  "api_version" : %MAX_API_VER%,
+
5447  "ledger_hash" : "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210",
+
5448  "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV"
+
5449  }
+
5450  ]
+
5451  })"},
+
5452  {"transaction_entry: too few arguments.",
+
5453  __LINE__,
+
5454  {
+
5455  "transaction_entry",
+
5456  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5457  },
+
5458  RPCCallTestData::no_exception,
+
5459  R"({
+
5460  "method" : "transaction_entry",
+
5461  "params" : [
+
5462  {
+
5463  "error" : "badSyntax",
+
5464  "error_code" : 1,
+
5465  "error_message" : "Syntax error."
+
5466  }
+
5467  ]
+
5468  })"},
+
5469  {"transaction_entry: too many arguments.",
+
5470  __LINE__,
+
5471  {"transaction_entry",
+
5472  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5473  "validated",
+
5474  "extra"},
+
5475  RPCCallTestData::no_exception,
+
5476  R"({
+
5477  "method" : "transaction_entry",
+
5478  "params" : [
+
5479  {
+
5480  "error" : "badSyntax",
+
5481  "error_code" : 1,
+
5482  "error_message" : "Syntax error."
+
5483  }
+
5484  ]
+
5485  })"},
+
5486  {"transaction_entry: short tx_hash.",
+
5487  __LINE__,
+
5488  {
+
5489  "transaction_entry",
+
5490  "123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5491  "validated",
+
5492  },
+
5493  RPCCallTestData::no_exception,
+
5494  R"({
+
5495  "method" : "transaction_entry",
+
5496  "params" : [
+
5497  {
+
5498  "error" : "invalidParams",
+
5499  "error_code" : 31,
+
5500  "error_message" : "Invalid parameters."
+
5501  }
+
5502  ]
+
5503  })"},
+
5504  {"transaction_entry: long tx_hash.",
+
5505  __LINE__,
+
5506  {
+
5507  "transaction_entry",
+
5508  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUVW",
+
5509  "validated",
+
5510  },
+
5511  RPCCallTestData::no_exception,
+
5512  R"({
+
5513  "method" : "transaction_entry",
+
5514  "params" : [
+
5515  {
+
5516  "error" : "invalidParams",
+
5517  "error_code" : 31,
+
5518  "error_message" : "Invalid parameters."
+
5519  }
+
5520  ]
+
5521  })"},
+
5522  {"transaction_entry: small ledger index.",
+
5523  __LINE__,
+
5524  {
+
5525  "transaction_entry",
+
5526  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5527  "0",
+
5528  },
+
5529  RPCCallTestData::no_exception,
+
5530  R"({
+
5531  "method" : "transaction_entry",
+
5532  "params" : [
+
5533  {
+
5534  "error" : "invalidParams",
+
5535  "error_code" : 31,
+
5536  "error_message" : "Invalid parameters."
+
5537  }
+
5538  ]
+
5539  })"},
+
5540  {"transaction_entry: large ledger index.",
+
5541  __LINE__,
+
5542  {
+
5543  "transaction_entry",
+
5544  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5545  "4294967296",
+
5546  },
+
5547  RPCCallTestData::no_exception,
+
5548  R"({
+
5549  "method" : "transaction_entry",
+
5550  "params" : [
+
5551  {
+
5552  "error" : "invalidParams",
+
5553  "error_code" : 31,
+
5554  "error_message" : "Invalid parameters."
+
5555  }
+
5556  ]
+
5557  })"},
+
5558  {"transaction_entry: short ledger hash.",
+
5559  __LINE__,
+
5560  {
+
5561  "transaction_entry",
+
5562  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5563  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA987654321",
+
5564  },
+
5565  RPCCallTestData::no_exception,
+
5566  R"({
+
5567  "method" : "transaction_entry",
+
5568  "params" : [
+
5569  {
+
5570  "error" : "invalidParams",
+
5571  "error_code" : 31,
+
5572  "error_message" : "Invalid parameters."
+
5573  }
+
5574  ]
+
5575  })"},
+
5576  {"transaction_entry: long ledger hash.",
+
5577  __LINE__,
+
5578  {
+
5579  "transaction_entry",
+
5580  "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV",
+
5581  "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210Z",
+
5582  },
+
5583  RPCCallTestData::no_exception,
+
5584  R"({
+
5585  "method" : "transaction_entry",
+
5586  "params" : [
+
5587  {
+
5588  "error" : "invalidParams",
+
5589  "error_code" : 31,
+
5590  "error_message" : "Invalid parameters."
+
5591  }
+
5592  ]
+
5593  })"},
+
5594 
+
5595  // tx
+
5596  // --------------------------------------------------------------------------
+
5597  {"tx: ctid. minimal",
+
5598  __LINE__,
+
5599  {"tx", "FFFFFFFFFFFFFFFF", "1", "2"},
+
5600  RPCCallTestData::no_exception,
+
5601  R"({
+
5602  "method" : "tx",
+
5603  "params" : [
+
5604  {
+
5605  "api_version" : %MAX_API_VER%,
+
5606  "ctid" : "FFFFFFFFFFFFFFFF",
+
5607  "max_ledger" : "2",
+
5608  "min_ledger" : "1"
+
5609  }
+
5610  ]
+
5611  })"},
+
5612  {"tx: ctid. binary",
+
5613  __LINE__,
+
5614  {"tx", "FFFFFFFFFFFFFFFF", "binary", "1", "2"},
+
5615  RPCCallTestData::no_exception,
+
5616  R"({
+
5617  "method" : "tx",
+
5618  "params" : [
+
5619  {
+
5620  "api_version" : %MAX_API_VER%,
+
5621  "binary" : true,
+
5622  "ctid" : "FFFFFFFFFFFFFFFF",
+
5623  "max_ledger" : "2",
+
5624  "min_ledger" : "1"
+
5625  }
+
5626  ]
+
5627  })"},
+
5628  {"tx: minimal.",
+
5629  __LINE__,
+
5630  {"tx", "transaction_hash_is_not_validated"},
+
5631  RPCCallTestData::no_exception,
+
5632  R"({
+
5633  "method" : "tx",
+
5634  "params" : [
+
5635  {
+
5636  "api_version" : %MAX_API_VER%,
+
5637  "transaction" : "transaction_hash_is_not_validated"
+
5638  }
+
5639  ]
+
5640  })"},
+
5641  {"tx: binary.",
+
5642  __LINE__,
+
5643  {"tx", "transaction_hash_is_not_validated", "binary"},
+
5644  RPCCallTestData::no_exception,
+
5645  R"({
+
5646  "method" : "tx",
+
5647  "params" : [
+
5648  {
+
5649  "api_version" : %MAX_API_VER%,
+
5650  "binary" : true,
+
5651  "transaction" : "transaction_hash_is_not_validated"
+
5652  }
+
5653  ]
+
5654  })"},
+
5655  {"tx: too few arguments.",
+
5656  __LINE__,
+
5657  {
+
5658  "tx",
+
5659  },
+
5660  RPCCallTestData::no_exception,
+
5661  R"({
+
5662  "method" : "tx",
+
5663  "params" : [
+
5664  {
+
5665  "error" : "badSyntax",
+
5666  "error_code" : 1,
+
5667  "error_message" : "Syntax error."
+
5668  }
+
5669  ]
+
5670  })"},
+
5671  {"tx: too many arguments.",
+
5672  __LINE__,
+
5673  {"tx", "transaction_hash_is_not_validated", "binary", "1", "2", "extra"},
+
5674  RPCCallTestData::no_exception,
+
5675  R"({
+
5676  "method" : "tx",
+
5677  "params" : [
+
5678  {
+
5679  "error" : "badSyntax",
+
5680  "error_code" : 1,
+
5681  "error_message" : "Syntax error."
+
5682  }
+
5683  ]
+
5684  })"},
+
5685  {"tx: invalid final argument is apparently ignored.",
+
5686  __LINE__,
+
5687  {"tx", "transaction_hash_is_not_validated", "bin"},
+
5688  RPCCallTestData::no_exception,
+
5689  R"({
+
5690  "method" : "tx",
+
5691  "params" : [
+
5692  {
+
5693  "api_version" : %MAX_API_VER%,
+
5694  "transaction" : "transaction_hash_is_not_validated"
+
5695  }
+
5696  ]
+
5697  })"},
+
5698 
+
5699  // tx_account
+
5700  // ------------------------------------------------------------------
+
5701  {"tx_account: minimal.",
+
5702  __LINE__,
+
5703  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"},
+
5704  RPCCallTestData::no_exception,
+
5705  R"({
+
5706  "method" : "tx_account",
+
5707  "params" : [
+
5708  {
+
5709  "api_version" : %MAX_API_VER%,
+
5710  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5711  }
+
5712  ]
+
5713  })"},
+
5714  {"tx_account: ledger_index .",
+
5715  __LINE__,
+
5716  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "4294967295"},
+
5717  RPCCallTestData::no_exception,
+
5718  R"({
+
5719  "method" : "tx_account",
+
5720  "params" : [
+
5721  {
+
5722  "api_version" : %MAX_API_VER%,
+
5723  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5724  "ledger_index" : 4294967295
+
5725  }
+
5726  ]
+
5727  })"},
+
5728  {"tx_account: ledger_index plus trailing params.",
+
5729  __LINE__,
+
5730  {"tx_account",
+
5731  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5732  "707",
+
5733  "forward",
+
5734  "binary",
+
5735  "count"},
+
5736  RPCCallTestData::no_exception,
+
5737  R"({
+
5738  "method" : "tx_account",
+
5739  "params" : [
+
5740  {
+
5741  "api_version" : %MAX_API_VER%,
+
5742  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5743  "binary" : true,
+
5744  "count" : true,
+
5745  "forward" : true,
+
5746  "ledger_index" : 707
+
5747  }
+
5748  ]
+
5749  })"},
+
5750  {"tx_account: ledger_index_min and _max.",
+
5751  __LINE__,
+
5752  {"tx_account",
+
5753  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5754  "2147483647",
+
5755  "2147483647"},
+
5756  RPCCallTestData::no_exception,
+
5757  R"({
+
5758  "method" : "tx_account",
+
5759  "params" : [
+
5760  {
+
5761  "api_version" : %MAX_API_VER%,
+
5762  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5763  "ledger_index_max" : 2147483647,
+
5764  "ledger_index_min" : 2147483647
+
5765  }
+
5766  ]
+
5767  })"},
+
5768  {"tx_account: ledger_index_min and _max plus trailing params.",
+
5769  __LINE__,
+
5770  {"tx_account",
+
5771  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5772  "33333",
+
5773  "2147483647",
+
5774  "binary",
+
5775  "count",
+
5776  "forward"},
+
5777  RPCCallTestData::no_exception,
+
5778  R"({
+
5779  "method" : "tx_account",
+
5780  "params" : [
+
5781  {
+
5782  "api_version" : %MAX_API_VER%,
+
5783  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5784  "binary" : true,
+
5785  "count" : true,
+
5786  "forward" : true,
+
5787  "ledger_index_max" : 2147483647,
+
5788  "ledger_index_min" : 33333
+
5789  }
+
5790  ]
+
5791  })"},
+
5792  {"tx_account: ledger_index_min and _max plus limit.",
+
5793  __LINE__,
+
5794  {"tx_account",
+
5795  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5796  "-1",
+
5797  "2147483647",
+
5798  "2147483647"},
+
5799  RPCCallTestData::no_exception,
+
5800  R"({
+
5801  "method" : "tx_account",
+
5802  "params" : [
+
5803  {
+
5804  "api_version" : %MAX_API_VER%,
+
5805  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5806  "ledger_index_max" : 2147483647,
+
5807  "ledger_index_min" : -1,
+
5808  "limit" : 2147483647
+
5809  }
+
5810  ]
+
5811  })"},
+
5812  {"tx_account: ledger_index_min and _max, limit, trailing args.",
+
5813  __LINE__,
+
5814  {"tx_account",
+
5815  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
5816  "1",
-
5817  "-1",
-
5818  "count",
-
5819  "forward",
-
5820  "binary"},
-
5821  RPCCallTestData::no_exception,
-
5822  R"({
-
5823  "method" : "tx_account",
-
5824  "params" : [
-
5825  {
-
5826  "api_version" : %MAX_API_VER%,
-
5827  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5828  "binary" : true,
-
5829  "count" : true,
-
5830  "forward" : true,
-
5831  "ledger_index_max" : 1,
-
5832  "ledger_index_min" : 1,
-
5833  "limit" : -1
-
5834  }
-
5835  ]
-
5836  })"},
-
5837  {"tx_account: too few arguments.",
-
5838  __LINE__,
-
5839  {
-
5840  "tx_account",
-
5841  },
-
5842  RPCCallTestData::no_exception,
-
5843  R"({
-
5844  "method" : "tx_account",
-
5845  "params" : [
-
5846  {
-
5847  "error" : "badSyntax",
-
5848  "error_code" : 1,
-
5849  "error_message" : "Syntax error."
-
5850  }
-
5851  ]
-
5852  })"},
-
5853  {"tx_account: too many arguments.",
-
5854  __LINE__,
-
5855  {"tx_account",
-
5856  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5857  "589",
-
5858  "590",
-
5859  "67",
-
5860  "extra",
-
5861  "descending",
-
5862  "count",
-
5863  "binary"},
-
5864  RPCCallTestData::no_exception,
-
5865  R"({
-
5866  "method" : "tx_account",
-
5867  "params" : [
-
5868  {
-
5869  "error" : "badSyntax",
-
5870  "error_code" : 1,
-
5871  "error_message" : "Syntax error."
-
5872  }
-
5873  ]
-
5874  })"},
-
5875  {
-
5876  "tx_account: invalid accountID.",
-
5877  __LINE__,
-
5878  {"tx_account", "rHb9CJAWyB4rj9!VRWn96DkukG4bwdtyTh"},
-
5879  RPCCallTestData::no_exception,
-
5880  R"({
-
5881  "method" : "tx_account",
-
5882  "params" : [
-
5883  {
-
5884  "error" : "actMalformed",
-
5885  "error_code" : 35,
-
5886  "error_message" : "Account malformed."
-
5887  }
-
5888  ]
-
5889  })",
-
5890  },
-
5891  {
-
5892  // Note: not currently detected as bad input.
-
5893  "tx_account: invalid ledger.",
-
5894  __LINE__,
-
5895  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-478.7"},
-
5896  RPCCallTestData::no_exception,
-
5897  R"({
-
5898  "method" : "tx_account",
-
5899  "params" : [
-
5900  {
-
5901  "api_version" : %MAX_API_VER%,
-
5902  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5903  "ledger_index" : 0
-
5904  }
-
5905  ]
-
5906  })",
-
5907  },
-
5908  {
-
5909  "tx_account: max less than min.",
-
5910  __LINE__,
-
5911  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"},
-
5912  RPCCallTestData::no_exception,
-
5913  RPC::apiMaximumSupportedVersion == 1 ?
-
5914  R"({
-
5915  "method" : "tx_account",
-
5916  "params" : [
-
5917  {
-
5918  "error" : "lgrIdxsInvalid",
-
5919  "error_code" : 55,
-
5920  "error_message" : "Ledger indexes invalid."
-
5921  }
-
5922  ]
-
5923  })"
-
5924  :
-
5925  R"({
-
5926  "method" : "tx_account",
-
5927  "params" : [
-
5928  {
-
5929  "error" : "notSynced",
-
5930  "error_code" : 55,
-
5931  "error_message" : "Not synced to the network."
-
5932  }
-
5933  ]
-
5934  })",
-
5935  },
-
5936  {
-
5937  // Note: this really shouldn't throw, but does at the moment.
-
5938  "tx_account: min large but still valid.",
-
5939  __LINE__,
-
5940  {"tx_account",
-
5941  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5942  "2147483648",
-
5943  "2147483648"},
-
5944  RPCCallTestData::bad_cast,
-
5945  R"()",
-
5946  },
-
5947  {
-
5948  // Note: this really shouldn't throw, but does at the moment.
-
5949  "tx_account: max large but still valid.",
-
5950  __LINE__,
-
5951  {"tx_account",
-
5952  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5953  "2147483647",
-
5954  "2147483648"},
-
5955  RPCCallTestData::bad_cast,
-
5956  R"()",
-
5957  },
-
5958  {
-
5959  // Note: this really shouldn't throw, but does at the moment.
-
5960  "tx_account: large limit.",
-
5961  __LINE__,
-
5962  {"tx_account",
-
5963  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5964  "-1",
+
5817  "1",
+
5818  "-1",
+
5819  "count",
+
5820  "forward",
+
5821  "binary"},
+
5822  RPCCallTestData::no_exception,
+
5823  R"({
+
5824  "method" : "tx_account",
+
5825  "params" : [
+
5826  {
+
5827  "api_version" : %MAX_API_VER%,
+
5828  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5829  "binary" : true,
+
5830  "count" : true,
+
5831  "forward" : true,
+
5832  "ledger_index_max" : 1,
+
5833  "ledger_index_min" : 1,
+
5834  "limit" : -1
+
5835  }
+
5836  ]
+
5837  })"},
+
5838  {"tx_account: too few arguments.",
+
5839  __LINE__,
+
5840  {
+
5841  "tx_account",
+
5842  },
+
5843  RPCCallTestData::no_exception,
+
5844  R"({
+
5845  "method" : "tx_account",
+
5846  "params" : [
+
5847  {
+
5848  "error" : "badSyntax",
+
5849  "error_code" : 1,
+
5850  "error_message" : "Syntax error."
+
5851  }
+
5852  ]
+
5853  })"},
+
5854  {"tx_account: too many arguments.",
+
5855  __LINE__,
+
5856  {"tx_account",
+
5857  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5858  "589",
+
5859  "590",
+
5860  "67",
+
5861  "extra",
+
5862  "descending",
+
5863  "count",
+
5864  "binary"},
+
5865  RPCCallTestData::no_exception,
+
5866  R"({
+
5867  "method" : "tx_account",
+
5868  "params" : [
+
5869  {
+
5870  "error" : "badSyntax",
+
5871  "error_code" : 1,
+
5872  "error_message" : "Syntax error."
+
5873  }
+
5874  ]
+
5875  })"},
+
5876  {
+
5877  "tx_account: invalid accountID.",
+
5878  __LINE__,
+
5879  {"tx_account", "rHb9CJAWyB4rj9!VRWn96DkukG4bwdtyTh"},
+
5880  RPCCallTestData::no_exception,
+
5881  R"({
+
5882  "method" : "tx_account",
+
5883  "params" : [
+
5884  {
+
5885  "error" : "actMalformed",
+
5886  "error_code" : 35,
+
5887  "error_message" : "Account malformed."
+
5888  }
+
5889  ]
+
5890  })",
+
5891  },
+
5892  {
+
5893  // Note: not currently detected as bad input.
+
5894  "tx_account: invalid ledger.",
+
5895  __LINE__,
+
5896  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-478.7"},
+
5897  RPCCallTestData::no_exception,
+
5898  R"({
+
5899  "method" : "tx_account",
+
5900  "params" : [
+
5901  {
+
5902  "api_version" : %MAX_API_VER%,
+
5903  "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5904  "ledger_index" : 0
+
5905  }
+
5906  ]
+
5907  })",
+
5908  },
+
5909  {
+
5910  "tx_account: max less than min.",
+
5911  __LINE__,
+
5912  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"},
+
5913  RPCCallTestData::no_exception,
+
5914  RPC::apiMaximumSupportedVersion == 1 ?
+
5915  R"({
+
5916  "method" : "tx_account",
+
5917  "params" : [
+
5918  {
+
5919  "error" : "lgrIdxsInvalid",
+
5920  "error_code" : 55,
+
5921  "error_message" : "Ledger indexes invalid."
+
5922  }
+
5923  ]
+
5924  })"
+
5925  :
+
5926  R"({
+
5927  "method" : "tx_account",
+
5928  "params" : [
+
5929  {
+
5930  "error" : "notSynced",
+
5931  "error_code" : 55,
+
5932  "error_message" : "Not synced to the network."
+
5933  }
+
5934  ]
+
5935  })",
+
5936  },
+
5937  {
+
5938  // Note: this really shouldn't throw, but does at the moment.
+
5939  "tx_account: min large but still valid.",
+
5940  __LINE__,
+
5941  {"tx_account",
+
5942  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5943  "2147483648",
+
5944  "2147483648"},
+
5945  RPCCallTestData::bad_cast,
+
5946  R"()",
+
5947  },
+
5948  {
+
5949  // Note: this really shouldn't throw, but does at the moment.
+
5950  "tx_account: max large but still valid.",
+
5951  __LINE__,
+
5952  {"tx_account",
+
5953  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
+
5954  "2147483647",
+
5955  "2147483648"},
+
5956  RPCCallTestData::bad_cast,
+
5957  R"()",
+
5958  },
+
5959  {
+
5960  // Note: this really shouldn't throw, but does at the moment.
+
5961  "tx_account: large limit.",
+
5962  __LINE__,
+
5963  {"tx_account",
+
5964  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
5965  "-1",
-
5966  "2147483648"},
-
5967  RPCCallTestData::bad_cast,
-
5968  R"()",
-
5969  },
-
5970  {
-
5971  // Note: this really shouldn't throw, but does at the moment.
-
5972  "tx_account: non-integer min.",
-
5973  __LINE__,
-
5974  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Binary", "-1"},
-
5975  RPCCallTestData::bad_cast,
-
5976  R"()",
-
5977  },
-
5978  {
-
5979  // Note: this really shouldn't throw, but does at the moment.
-
5980  "tx_account: non-integer max.",
-
5981  __LINE__,
-
5982  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "counts"},
-
5983  RPCCallTestData::bad_cast,
-
5984  R"()",
-
5985  },
-
5986  {
-
5987  // Note: this really shouldn't throw, but does at the moment.
-
5988  "tx_account: non-integer limit.",
-
5989  __LINE__,
-
5990  {"tx_account",
-
5991  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
-
5992  "-1",
+
5966  "-1",
+
5967  "2147483648"},
+
5968  RPCCallTestData::bad_cast,
+
5969  R"()",
+
5970  },
+
5971  {
+
5972  // Note: this really shouldn't throw, but does at the moment.
+
5973  "tx_account: non-integer min.",
+
5974  __LINE__,
+
5975  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Binary", "-1"},
+
5976  RPCCallTestData::bad_cast,
+
5977  R"()",
+
5978  },
+
5979  {
+
5980  // Note: this really shouldn't throw, but does at the moment.
+
5981  "tx_account: non-integer max.",
+
5982  __LINE__,
+
5983  {"tx_account", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "-1", "counts"},
+
5984  RPCCallTestData::bad_cast,
+
5985  R"()",
+
5986  },
+
5987  {
+
5988  // Note: this really shouldn't throw, but does at the moment.
+
5989  "tx_account: non-integer limit.",
+
5990  __LINE__,
+
5991  {"tx_account",
+
5992  "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
5993  "-1",
-
5994  "decending"},
-
5995  RPCCallTestData::bad_cast,
-
5996  R"()",
-
5997  },
-
5998 
-
5999  // tx_history
-
6000  // ------------------------------------------------------------------
-
6001  {"tx_history: minimal.",
-
6002  __LINE__,
-
6003  {"tx_history", "0"},
-
6004  RPCCallTestData::no_exception,
-
6005  R"({
-
6006  "method" : "tx_history",
-
6007  "params" : [
-
6008  {
-
6009  "api_version" : %MAX_API_VER%,
-
6010  "start" : 0
-
6011  }
-
6012  ]
-
6013  })"},
-
6014  {"tx_history: too few arguments.",
-
6015  __LINE__,
-
6016  {
-
6017  "tx_history",
-
6018  },
-
6019  RPCCallTestData::no_exception,
-
6020  R"({
-
6021  "method" : "tx_history",
-
6022  "params" : [
-
6023  {
-
6024  "error" : "badSyntax",
-
6025  "error_code" : 1,
-
6026  "error_message" : "Syntax error."
-
6027  }
-
6028  ]
-
6029  })"},
-
6030  {"tx_history: too many arguments.",
-
6031  __LINE__,
-
6032  {"tx_history", "0", "1"},
-
6033  RPCCallTestData::no_exception,
-
6034  R"({
-
6035  "method" : "tx_history",
-
6036  "params" : [
-
6037  {
-
6038  "error" : "badSyntax",
-
6039  "error_code" : 1,
-
6040  "error_message" : "Syntax error."
-
6041  }
-
6042  ]
-
6043  })"},
-
6044  {
-
6045  // Note: this really shouldn't throw, but does at the moment.
-
6046  "tx_history: start too small.",
-
6047  __LINE__,
-
6048  {"tx_history", "-1"},
-
6049  RPCCallTestData::bad_cast,
-
6050  R"()",
-
6051  },
-
6052  {
-
6053  // Note: this really shouldn't throw, but does at the moment.
-
6054  "tx_history: start too big.",
-
6055  __LINE__,
-
6056  {"tx_history", "4294967296"},
-
6057  RPCCallTestData::bad_cast,
-
6058  R"()",
-
6059  },
-
6060  {
-
6061  // Note: this really shouldn't throw, but does at the moment.
-
6062  "tx_history: start not integer.",
-
6063  __LINE__,
-
6064  {"tx_history", "beginning"},
-
6065  RPCCallTestData::bad_cast,
-
6066  R"()",
-
6067  },
-
6068 
-
6069  // unl_list
-
6070  // --------------------------------------------------------------------
-
6071  {"unl_list: minimal.",
-
6072  __LINE__,
-
6073  {
-
6074  "unl_list",
-
6075  },
-
6076  RPCCallTestData::no_exception,
-
6077  R"({
-
6078  "method" : "unl_list",
-
6079  "params" : [
-
6080  {
-
6081  "api_version" : %MAX_API_VER%,
-
6082  }
-
6083  ]
-
6084  })"},
-
6085  {"unl_list: too many arguments.",
-
6086  __LINE__,
-
6087  {"unl_list", "extra"},
-
6088  RPCCallTestData::no_exception,
-
6089  R"({
-
6090  "method" : "unl_list",
-
6091  "params" : [
-
6092  {
-
6093  "error" : "badSyntax",
-
6094  "error_code" : 1,
-
6095  "error_message" : "Syntax error."
-
6096  }
-
6097  ]
-
6098  })"},
-
6099 
-
6100  // validation_create
-
6101  // -----------------------------------------------------------
-
6102  {"validation_create: minimal.",
-
6103  __LINE__,
-
6104  {
-
6105  "validation_create",
-
6106  },
-
6107  RPCCallTestData::no_exception,
-
6108  R"({
-
6109  "method" : "validation_create",
-
6110  "params" : [
-
6111  {
-
6112  "api_version" : %MAX_API_VER%,
-
6113  }
-
6114  ]
-
6115  })"},
-
6116  {"validation_create: with secret.",
-
6117  __LINE__,
-
6118  {"validation_create", "the form of the secret is not validated"},
-
6119  RPCCallTestData::no_exception,
-
6120  R"({
-
6121  "method" : "validation_create",
-
6122  "params" : [
-
6123  {
-
6124  "api_version" : %MAX_API_VER%,
-
6125  "secret" : "the form of the secret is not validated"
-
6126  }
-
6127  ]
-
6128  })"},
-
6129  {"validation_create: too many arguments.",
-
6130  __LINE__,
-
6131  {"validation_create", "the form of the secret is not validated", "extra"},
-
6132  RPCCallTestData::no_exception,
-
6133  R"({
-
6134  "method" : "validation_create",
-
6135  "params" : [
-
6136  {
-
6137  "error" : "badSyntax",
-
6138  "error_code" : 1,
-
6139  "error_message" : "Syntax error."
-
6140  }
-
6141  ]
-
6142  })"},
-
6143 
-
6144  // version
-
6145  // ---------------------------------------------------------------------
-
6146  {"version: minimal.",
-
6147  __LINE__,
-
6148  {
-
6149  "version",
-
6150  },
-
6151  RPCCallTestData::no_exception,
-
6152  R"({
-
6153  "method" : "version",
-
6154  "params" : [
-
6155  {
-
6156  "api_version" : %MAX_API_VER%,
-
6157  }
-
6158  ]
-
6159  })"},
-
6160  {"version: too many arguments.",
-
6161  __LINE__,
-
6162  {"version", "extra"},
-
6163  RPCCallTestData::no_exception,
-
6164  R"({
-
6165  "method" : "version",
-
6166  "params" : [
-
6167  {
-
6168  "error" : "badSyntax",
-
6169  "error_code" : 1,
-
6170  "error_message" : "Syntax error."
-
6171  }
-
6172  ]
-
6173  })"},
-
6174 
-
6175  // wallet_propose
-
6176  // --------------------------------------------------------------
-
6177  {"wallet_propose: minimal.",
-
6178  __LINE__,
-
6179  {
-
6180  "wallet_propose",
-
6181  },
-
6182  RPCCallTestData::no_exception,
-
6183  R"({
-
6184  "method" : "wallet_propose",
-
6185  "params" : [
-
6186  {
-
6187  "api_version" : %MAX_API_VER%,
-
6188  }
-
6189  ]
-
6190  })"},
-
6191  {"wallet_propose: with passphrase.",
-
6192  __LINE__,
-
6193  {"wallet_propose", "the form of the passphrase is not validated"},
-
6194  RPCCallTestData::no_exception,
-
6195  R"({
-
6196  "method" : "wallet_propose",
-
6197  "params" : [
-
6198  {
-
6199  "api_version" : %MAX_API_VER%,
-
6200  "passphrase" : "the form of the passphrase is not validated"
-
6201  }
-
6202  ]
-
6203  })"},
-
6204  {"wallet_propose: too many arguments.",
-
6205  __LINE__,
-
6206  {"wallet_propose", "the form of the passphrase is not validated", "extra"},
-
6207  RPCCallTestData::no_exception,
-
6208  R"({
-
6209  "method" : "wallet_propose",
-
6210  "params" : [
-
6211  {
-
6212  "error" : "badSyntax",
-
6213  "error_code" : 1,
-
6214  "error_message" : "Syntax error."
-
6215  }
-
6216  ]
-
6217  })"},
-
6218 
-
6219  // internal
-
6220  // --------------------------------------------------------------------
-
6221  {"internal: minimal.",
-
6222  __LINE__,
-
6223  {"internal", "command_name"},
-
6224  RPCCallTestData::no_exception,
-
6225  R"({
-
6226  "method" : "internal",
-
6227  "params" : [
-
6228  {
-
6229  "api_version" : %MAX_API_VER%,
-
6230  "internal_command" : "command_name",
-
6231  "params" : []
-
6232  }
-
6233  ]
-
6234  })"},
-
6235  {"internal: with parameters.",
-
6236  __LINE__,
-
6237  {"internal",
-
6238  "command_name",
-
6239  "string_arg",
-
6240  "1",
-
6241  "-1",
-
6242  "4294967296",
-
6243  "3.14159"},
-
6244  RPCCallTestData::no_exception,
-
6245  R"({
-
6246  "method" : "internal",
-
6247  "params" : [
-
6248  {
-
6249  "api_version" : %MAX_API_VER%,
-
6250  "internal_command" : "command_name",
-
6251  "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
-
6252  }
-
6253  ]
-
6254  })"},
-
6255  {"internal: too few arguments.",
-
6256  __LINE__,
-
6257  {
-
6258  "internal",
-
6259  },
-
6260  RPCCallTestData::no_exception,
-
6261  R"({
-
6262  "method" : "internal",
-
6263  "params" : [
-
6264  {
-
6265  "error" : "badSyntax",
-
6266  "error_code" : 1,
-
6267  "error_message" : "Syntax error."
-
6268  }
-
6269  ]
-
6270  })"},
-
6271 
-
6272  // path_find
-
6273  // -------------------------------------------------------------------
-
6274  {"path_find: minimal.",
-
6275  __LINE__,
-
6276  {
-
6277  "path_find",
-
6278  },
-
6279  RPCCallTestData::no_exception,
-
6280  R"({
-
6281  "method" : "path_find",
-
6282  "params" : [
-
6283  {
-
6284  "error" : "noEvents",
-
6285  "error_code" : 7,
-
6286  "error_message" : "Current transport does not support events."
-
6287  }
-
6288  ]
-
6289  })"},
-
6290  {"path_find: with arguments.",
-
6291  __LINE__,
-
6292  {"path_find", "string_arg", "1", "-1", "4294967296", "3.14159"},
-
6293  RPCCallTestData::no_exception,
-
6294  R"({
-
6295  "method" : "path_find",
-
6296  "params" : [
-
6297  {
-
6298  "error" : "noEvents",
-
6299  "error_code" : 7,
-
6300  "error_message" : "Current transport does not support events."
-
6301  }
-
6302  ]
-
6303  })"},
-
6304 
-
6305  // subscribe
-
6306  // -------------------------------------------------------------------
-
6307  {"subscribe: minimal.",
-
6308  __LINE__,
-
6309  {
-
6310  "subscribe",
-
6311  },
-
6312  RPCCallTestData::no_exception,
-
6313  R"({
-
6314  "method" : "subscribe",
-
6315  "params" : [
-
6316  {
-
6317  "error" : "noEvents",
-
6318  "error_code" : 7,
-
6319  "error_message" : "Current transport does not support events."
-
6320  }
-
6321  ]
-
6322  })"},
-
6323  {"subscribe: with arguments.",
-
6324  __LINE__,
-
6325  {"subscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
-
6326  RPCCallTestData::no_exception,
-
6327  R"({
-
6328  "method" : "subscribe",
-
6329  "params" : [
-
6330  {
-
6331  "error" : "noEvents",
-
6332  "error_code" : 7,
-
6333  "error_message" : "Current transport does not support events."
-
6334  }
-
6335  ]
-
6336  })"},
-
6337 
-
6338  // unsubscribe
-
6339  // -----------------------------------------------------------------
-
6340  {"unsubscribe: minimal.",
-
6341  __LINE__,
-
6342  {
-
6343  "unsubscribe",
-
6344  },
-
6345  RPCCallTestData::no_exception,
-
6346  R"({
-
6347  "method" : "unsubscribe",
-
6348  "params" : [
-
6349  {
-
6350  "error" : "noEvents",
-
6351  "error_code" : 7,
-
6352  "error_message" : "Current transport does not support events."
-
6353  }
-
6354  ]
-
6355  })"},
-
6356  {"unsubscribe: with arguments.",
-
6357  __LINE__,
-
6358  {"unsubscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
-
6359  RPCCallTestData::no_exception,
-
6360  R"({
-
6361  "method" : "unsubscribe",
-
6362  "params" : [
-
6363  {
-
6364  "error" : "noEvents",
-
6365  "error_code" : 7,
-
6366  "error_message" : "Current transport does not support events."
-
6367  }
-
6368  ]
-
6369  })"},
-
6370 
-
6371  // unknown_command
-
6372  // -------------------------------------------------------------
-
6373  {"unknown_command: minimal.",
-
6374  __LINE__,
-
6375  {
-
6376  "unknown_command",
-
6377  },
-
6378  RPCCallTestData::no_exception,
-
6379  R"({
-
6380  "method" : "unknown_command",
-
6381  "params" : [
-
6382  {
-
6383  "api_version" : %MAX_API_VER%,
-
6384  }
-
6385  ]
-
6386  })"},
-
6387  {"unknown_command: with arguments.",
-
6388  __LINE__,
-
6389  {"unknown_command", "string_arg", "1", "-1", "4294967296", "3.14159"},
-
6390  RPCCallTestData::no_exception,
-
6391  R"({
-
6392  "method" : "unknown_command",
-
6393  "params" : [
-
6394  {
-
6395  "api_version" : %MAX_API_VER%,
-
6396  "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
-
6397  }
-
6398  ]
-
6399  })"},
-
6400 };
-
6401 
-
6402 std::string
-
6403 updateAPIVersionString(const char* const req)
-
6404 {
-
6405  static std::string version_str =
-
6406  std::to_string(RPC::apiMaximumSupportedVersion);
-
6407  static auto place_holder = "%MAX_API_VER%";
-
6408  std::string jr(req);
-
6409  boost::replace_all(jr, place_holder, version_str);
-
6410  return jr;
-
6411 }
-
6412 
-
6413 std::unique_ptr<Config>
-
6414 makeNetworkConfig(uint32_t networkID)
-
6415 {
-
6416  using namespace test::jtx;
-
6417  return envconfig([&](std::unique_ptr<Config> cfg) {
-
6418  cfg->NETWORK_ID = networkID;
-
6419  return cfg;
-
6420  });
-
6421 }
-
6422 
-
6423 class RPCCall_test : public beast::unit_test::suite
-
6424 {
-
6425 public:
-
6426  void
-
6427  testRPCCall()
-
6428  {
-
6429  testcase << "RPCCall";
-
6430 
-
6431  test::jtx::Env env(
-
6432  *this, makeNetworkConfig(11111)); // Used only for its Journal.
-
6433 
-
6434  // For each RPCCall test.
-
6435  for (RPCCallTestData const& rpcCallTest : rpcCallTestArray)
-
6436  {
-
6437  std::vector<std::string> const args{
-
6438  rpcCallTest.args.begin(), rpcCallTest.args.end()};
-
6439 
-
6440  // Note that, over the long term, none of these tests should
-
6441  // throw. But, for the moment, some of them do. So handle it.
-
6442  Json::Value got;
-
6443  try
-
6444  {
-
6445  got = cmdLineToJSONRPC(args, env.journal);
-
6446  }
-
6447  catch (std::bad_cast const&)
-
6448  {
-
6449  if ((rpcCallTest.throwsWhat == RPCCallTestData::bad_cast) &&
-
6450  (std::strlen(rpcCallTest.exp) == 0))
-
6451  {
-
6452  pass();
-
6453  }
-
6454  else
-
6455  {
-
6456  fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
-
6457  }
-
6458  // Try the next test.
-
6459  continue;
-
6460  }
-
6461 
-
6462  Json::Value exp;
-
6463  Json::Reader{}.parse(updateAPIVersionString(rpcCallTest.exp), exp);
-
6464 
-
6465  // Lambda to remove the "params[0u]:error_code" field if present.
-
6466  // Error codes are not expected to be stable between releases.
-
6467  auto rmErrorCode = [](Json::Value& json) {
-
6468  if (json.isMember(jss::params) && json[jss::params].isArray() &&
-
6469  json[jss::params].size() > 0 &&
-
6470  json[jss::params][0u].isObject())
-
6471  {
-
6472  json[jss::params][0u].removeMember(jss::error_code);
-
6473  }
-
6474  };
-
6475  rmErrorCode(got);
-
6476  rmErrorCode(exp);
-
6477 
-
6478  // Pass if we didn't expect a throw and we got what we expected.
-
6479  if ((rpcCallTest.throwsWhat == RPCCallTestData::no_exception) &&
-
6480  (got == exp))
-
6481  {
-
6482  pass();
-
6483  }
-
6484  else
-
6485  {
-
6486  fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
-
6487  }
-
6488  }
-
6489  }
-
6490 
-
6491  void
-
6492  run() override
-
6493  {
-
6494  testRPCCall();
-
6495  }
-
6496 };
-
6497 
-
6498 BEAST_DEFINE_TESTSUITE(RPCCall, app, ripple);
-
6499 
-
6500 } // namespace test
-
6501 } // namespace ripple
+
5994  "-1",
+
5995  "decending"},
+
5996  RPCCallTestData::bad_cast,
+
5997  R"()",
+
5998  },
+
5999 
+
6000  // tx_history
+
6001  // ------------------------------------------------------------------
+
6002  {"tx_history: minimal.",
+
6003  __LINE__,
+
6004  {"tx_history", "0"},
+
6005  RPCCallTestData::no_exception,
+
6006  R"({
+
6007  "method" : "tx_history",
+
6008  "params" : [
+
6009  {
+
6010  "api_version" : %MAX_API_VER%,
+
6011  "start" : 0
+
6012  }
+
6013  ]
+
6014  })"},
+
6015  {"tx_history: too few arguments.",
+
6016  __LINE__,
+
6017  {
+
6018  "tx_history",
+
6019  },
+
6020  RPCCallTestData::no_exception,
+
6021  R"({
+
6022  "method" : "tx_history",
+
6023  "params" : [
+
6024  {
+
6025  "error" : "badSyntax",
+
6026  "error_code" : 1,
+
6027  "error_message" : "Syntax error."
+
6028  }
+
6029  ]
+
6030  })"},
+
6031  {"tx_history: too many arguments.",
+
6032  __LINE__,
+
6033  {"tx_history", "0", "1"},
+
6034  RPCCallTestData::no_exception,
+
6035  R"({
+
6036  "method" : "tx_history",
+
6037  "params" : [
+
6038  {
+
6039  "error" : "badSyntax",
+
6040  "error_code" : 1,
+
6041  "error_message" : "Syntax error."
+
6042  }
+
6043  ]
+
6044  })"},
+
6045  {
+
6046  // Note: this really shouldn't throw, but does at the moment.
+
6047  "tx_history: start too small.",
+
6048  __LINE__,
+
6049  {"tx_history", "-1"},
+
6050  RPCCallTestData::bad_cast,
+
6051  R"()",
+
6052  },
+
6053  {
+
6054  // Note: this really shouldn't throw, but does at the moment.
+
6055  "tx_history: start too big.",
+
6056  __LINE__,
+
6057  {"tx_history", "4294967296"},
+
6058  RPCCallTestData::bad_cast,
+
6059  R"()",
+
6060  },
+
6061  {
+
6062  // Note: this really shouldn't throw, but does at the moment.
+
6063  "tx_history: start not integer.",
+
6064  __LINE__,
+
6065  {"tx_history", "beginning"},
+
6066  RPCCallTestData::bad_cast,
+
6067  R"()",
+
6068  },
+
6069 
+
6070  // unl_list
+
6071  // --------------------------------------------------------------------
+
6072  {"unl_list: minimal.",
+
6073  __LINE__,
+
6074  {
+
6075  "unl_list",
+
6076  },
+
6077  RPCCallTestData::no_exception,
+
6078  R"({
+
6079  "method" : "unl_list",
+
6080  "params" : [
+
6081  {
+
6082  "api_version" : %MAX_API_VER%,
+
6083  }
+
6084  ]
+
6085  })"},
+
6086  {"unl_list: too many arguments.",
+
6087  __LINE__,
+
6088  {"unl_list", "extra"},
+
6089  RPCCallTestData::no_exception,
+
6090  R"({
+
6091  "method" : "unl_list",
+
6092  "params" : [
+
6093  {
+
6094  "error" : "badSyntax",
+
6095  "error_code" : 1,
+
6096  "error_message" : "Syntax error."
+
6097  }
+
6098  ]
+
6099  })"},
+
6100 
+
6101  // validation_create
+
6102  // -----------------------------------------------------------
+
6103  {"validation_create: minimal.",
+
6104  __LINE__,
+
6105  {
+
6106  "validation_create",
+
6107  },
+
6108  RPCCallTestData::no_exception,
+
6109  R"({
+
6110  "method" : "validation_create",
+
6111  "params" : [
+
6112  {
+
6113  "api_version" : %MAX_API_VER%,
+
6114  }
+
6115  ]
+
6116  })"},
+
6117  {"validation_create: with secret.",
+
6118  __LINE__,
+
6119  {"validation_create", "the form of the secret is not validated"},
+
6120  RPCCallTestData::no_exception,
+
6121  R"({
+
6122  "method" : "validation_create",
+
6123  "params" : [
+
6124  {
+
6125  "api_version" : %MAX_API_VER%,
+
6126  "secret" : "the form of the secret is not validated"
+
6127  }
+
6128  ]
+
6129  })"},
+
6130  {"validation_create: too many arguments.",
+
6131  __LINE__,
+
6132  {"validation_create", "the form of the secret is not validated", "extra"},
+
6133  RPCCallTestData::no_exception,
+
6134  R"({
+
6135  "method" : "validation_create",
+
6136  "params" : [
+
6137  {
+
6138  "error" : "badSyntax",
+
6139  "error_code" : 1,
+
6140  "error_message" : "Syntax error."
+
6141  }
+
6142  ]
+
6143  })"},
+
6144 
+
6145  // version
+
6146  // ---------------------------------------------------------------------
+
6147  {"version: minimal.",
+
6148  __LINE__,
+
6149  {
+
6150  "version",
+
6151  },
+
6152  RPCCallTestData::no_exception,
+
6153  R"({
+
6154  "method" : "version",
+
6155  "params" : [
+
6156  {
+
6157  "api_version" : %MAX_API_VER%,
+
6158  }
+
6159  ]
+
6160  })"},
+
6161  {"version: too many arguments.",
+
6162  __LINE__,
+
6163  {"version", "extra"},
+
6164  RPCCallTestData::no_exception,
+
6165  R"({
+
6166  "method" : "version",
+
6167  "params" : [
+
6168  {
+
6169  "error" : "badSyntax",
+
6170  "error_code" : 1,
+
6171  "error_message" : "Syntax error."
+
6172  }
+
6173  ]
+
6174  })"},
+
6175 
+
6176  // wallet_propose
+
6177  // --------------------------------------------------------------
+
6178  {"wallet_propose: minimal.",
+
6179  __LINE__,
+
6180  {
+
6181  "wallet_propose",
+
6182  },
+
6183  RPCCallTestData::no_exception,
+
6184  R"({
+
6185  "method" : "wallet_propose",
+
6186  "params" : [
+
6187  {
+
6188  "api_version" : %MAX_API_VER%,
+
6189  }
+
6190  ]
+
6191  })"},
+
6192  {"wallet_propose: with passphrase.",
+
6193  __LINE__,
+
6194  {"wallet_propose", "the form of the passphrase is not validated"},
+
6195  RPCCallTestData::no_exception,
+
6196  R"({
+
6197  "method" : "wallet_propose",
+
6198  "params" : [
+
6199  {
+
6200  "api_version" : %MAX_API_VER%,
+
6201  "passphrase" : "the form of the passphrase is not validated"
+
6202  }
+
6203  ]
+
6204  })"},
+
6205  {"wallet_propose: too many arguments.",
+
6206  __LINE__,
+
6207  {"wallet_propose", "the form of the passphrase is not validated", "extra"},
+
6208  RPCCallTestData::no_exception,
+
6209  R"({
+
6210  "method" : "wallet_propose",
+
6211  "params" : [
+
6212  {
+
6213  "error" : "badSyntax",
+
6214  "error_code" : 1,
+
6215  "error_message" : "Syntax error."
+
6216  }
+
6217  ]
+
6218  })"},
+
6219 
+
6220  // internal
+
6221  // --------------------------------------------------------------------
+
6222  {"internal: minimal.",
+
6223  __LINE__,
+
6224  {"internal", "command_name"},
+
6225  RPCCallTestData::no_exception,
+
6226  R"({
+
6227  "method" : "internal",
+
6228  "params" : [
+
6229  {
+
6230  "api_version" : %MAX_API_VER%,
+
6231  "internal_command" : "command_name",
+
6232  "params" : []
+
6233  }
+
6234  ]
+
6235  })"},
+
6236  {"internal: with parameters.",
+
6237  __LINE__,
+
6238  {"internal",
+
6239  "command_name",
+
6240  "string_arg",
+
6241  "1",
+
6242  "-1",
+
6243  "4294967296",
+
6244  "3.14159"},
+
6245  RPCCallTestData::no_exception,
+
6246  R"({
+
6247  "method" : "internal",
+
6248  "params" : [
+
6249  {
+
6250  "api_version" : %MAX_API_VER%,
+
6251  "internal_command" : "command_name",
+
6252  "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
+
6253  }
+
6254  ]
+
6255  })"},
+
6256  {"internal: too few arguments.",
+
6257  __LINE__,
+
6258  {
+
6259  "internal",
+
6260  },
+
6261  RPCCallTestData::no_exception,
+
6262  R"({
+
6263  "method" : "internal",
+
6264  "params" : [
+
6265  {
+
6266  "error" : "badSyntax",
+
6267  "error_code" : 1,
+
6268  "error_message" : "Syntax error."
+
6269  }
+
6270  ]
+
6271  })"},
+
6272 
+
6273  // path_find
+
6274  // -------------------------------------------------------------------
+
6275  {"path_find: minimal.",
+
6276  __LINE__,
+
6277  {
+
6278  "path_find",
+
6279  },
+
6280  RPCCallTestData::no_exception,
+
6281  R"({
+
6282  "method" : "path_find",
+
6283  "params" : [
+
6284  {
+
6285  "error" : "noEvents",
+
6286  "error_code" : 7,
+
6287  "error_message" : "Current transport does not support events."
+
6288  }
+
6289  ]
+
6290  })"},
+
6291  {"path_find: with arguments.",
+
6292  __LINE__,
+
6293  {"path_find", "string_arg", "1", "-1", "4294967296", "3.14159"},
+
6294  RPCCallTestData::no_exception,
+
6295  R"({
+
6296  "method" : "path_find",
+
6297  "params" : [
+
6298  {
+
6299  "error" : "noEvents",
+
6300  "error_code" : 7,
+
6301  "error_message" : "Current transport does not support events."
+
6302  }
+
6303  ]
+
6304  })"},
+
6305 
+
6306  // subscribe
+
6307  // -------------------------------------------------------------------
+
6308  {"subscribe: minimal.",
+
6309  __LINE__,
+
6310  {
+
6311  "subscribe",
+
6312  },
+
6313  RPCCallTestData::no_exception,
+
6314  R"({
+
6315  "method" : "subscribe",
+
6316  "params" : [
+
6317  {
+
6318  "error" : "noEvents",
+
6319  "error_code" : 7,
+
6320  "error_message" : "Current transport does not support events."
+
6321  }
+
6322  ]
+
6323  })"},
+
6324  {"subscribe: with arguments.",
+
6325  __LINE__,
+
6326  {"subscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
+
6327  RPCCallTestData::no_exception,
+
6328  R"({
+
6329  "method" : "subscribe",
+
6330  "params" : [
+
6331  {
+
6332  "error" : "noEvents",
+
6333  "error_code" : 7,
+
6334  "error_message" : "Current transport does not support events."
+
6335  }
+
6336  ]
+
6337  })"},
+
6338 
+
6339  // unsubscribe
+
6340  // -----------------------------------------------------------------
+
6341  {"unsubscribe: minimal.",
+
6342  __LINE__,
+
6343  {
+
6344  "unsubscribe",
+
6345  },
+
6346  RPCCallTestData::no_exception,
+
6347  R"({
+
6348  "method" : "unsubscribe",
+
6349  "params" : [
+
6350  {
+
6351  "error" : "noEvents",
+
6352  "error_code" : 7,
+
6353  "error_message" : "Current transport does not support events."
+
6354  }
+
6355  ]
+
6356  })"},
+
6357  {"unsubscribe: with arguments.",
+
6358  __LINE__,
+
6359  {"unsubscribe", "string_arg", "1", "-1", "4294967296", "3.14159"},
+
6360  RPCCallTestData::no_exception,
+
6361  R"({
+
6362  "method" : "unsubscribe",
+
6363  "params" : [
+
6364  {
+
6365  "error" : "noEvents",
+
6366  "error_code" : 7,
+
6367  "error_message" : "Current transport does not support events."
+
6368  }
+
6369  ]
+
6370  })"},
+
6371 
+
6372  // unknown_command
+
6373  // -------------------------------------------------------------
+
6374  {"unknown_command: minimal.",
+
6375  __LINE__,
+
6376  {
+
6377  "unknown_command",
+
6378  },
+
6379  RPCCallTestData::no_exception,
+
6380  R"({
+
6381  "method" : "unknown_command",
+
6382  "params" : [
+
6383  {
+
6384  "api_version" : %MAX_API_VER%,
+
6385  }
+
6386  ]
+
6387  })"},
+
6388  {"unknown_command: with arguments.",
+
6389  __LINE__,
+
6390  {"unknown_command", "string_arg", "1", "-1", "4294967296", "3.14159"},
+
6391  RPCCallTestData::no_exception,
+
6392  R"({
+
6393  "method" : "unknown_command",
+
6394  "params" : [
+
6395  {
+
6396  "api_version" : %MAX_API_VER%,
+
6397  "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ]
+
6398  }
+
6399  ]
+
6400  })"},
+
6401 };
+
6402 
+
6403 std::string
+
6404 updateAPIVersionString(const char* const req)
+
6405 {
+
6406  static std::string version_str =
+
6407  std::to_string(RPC::apiMaximumSupportedVersion);
+
6408  static auto place_holder = "%MAX_API_VER%";
+
6409  std::string jr(req);
+
6410  boost::replace_all(jr, place_holder, version_str);
+
6411  return jr;
+
6412 }
+
6413 
+
6414 std::unique_ptr<Config>
+
6415 makeNetworkConfig(uint32_t networkID)
+
6416 {
+
6417  using namespace test::jtx;
+
6418  return envconfig([&](std::unique_ptr<Config> cfg) {
+
6419  cfg->NETWORK_ID = networkID;
+
6420  return cfg;
+
6421  });
+
6422 }
+
6423 
+
6424 class RPCCall_test : public beast::unit_test::suite
+
6425 {
+
6426 public:
+
6427  void
+
6428  testRPCCall()
+
6429  {
+
6430  testcase << "RPCCall";
+
6431 
+
6432  test::jtx::Env env(
+
6433  *this, makeNetworkConfig(11111)); // Used only for its Journal.
+
6434 
+
6435  // For each RPCCall test.
+
6436  for (RPCCallTestData const& rpcCallTest : rpcCallTestArray)
+
6437  {
+
6438  std::vector<std::string> const args{
+
6439  rpcCallTest.args.begin(), rpcCallTest.args.end()};
+
6440 
+
6441  // Note that, over the long term, none of these tests should
+
6442  // throw. But, for the moment, some of them do. So handle it.
+
6443  Json::Value got;
+
6444  try
+
6445  {
+
6446  got = jtx::cmdToJSONRPC(args, env.journal);
+
6447  }
+
6448  catch (std::bad_cast const&)
+
6449  {
+
6450  if ((rpcCallTest.throwsWhat == RPCCallTestData::bad_cast) &&
+
6451  (std::strlen(rpcCallTest.exp) == 0))
+
6452  {
+
6453  pass();
+
6454  }
+
6455  else
+
6456  {
+
6457  fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
+
6458  }
+
6459  // Try the next test.
+
6460  continue;
+
6461  }
+
6462 
+
6463  Json::Value exp;
+
6464  Json::Reader{}.parse(updateAPIVersionString(rpcCallTest.exp), exp);
+
6465 
+
6466  // Lambda to remove the "params[0u]:error_code" field if present.
+
6467  // Error codes are not expected to be stable between releases.
+
6468  auto rmErrorCode = [](Json::Value& json) {
+
6469  if (json.isMember(jss::params) && json[jss::params].isArray() &&
+
6470  json[jss::params].size() > 0 &&
+
6471  json[jss::params][0u].isObject())
+
6472  {
+
6473  json[jss::params][0u].removeMember(jss::error_code);
+
6474  }
+
6475  };
+
6476  rmErrorCode(got);
+
6477  rmErrorCode(exp);
+
6478 
+
6479  // Pass if we didn't expect a throw and we got what we expected.
+
6480  if ((rpcCallTest.throwsWhat == RPCCallTestData::no_exception) &&
+
6481  (got == exp))
+
6482  {
+
6483  pass();
+
6484  }
+
6485  else
+
6486  {
+
6487  fail(rpcCallTest.description, __FILE__, rpcCallTest.line);
+
6488  }
+
6489  }
+
6490  }
+
6491 
+
6492  void
+
6493  run() override
+
6494  {
+
6495  testRPCCall();
+
6496  }
+
6497 };
+
6498 
+
6499 BEAST_DEFINE_TESTSUITE(RPCCall, app, ripple);
+
6500 
+
6501 } // namespace test
+
6502 } // namespace ripple
ripple::test::jtx::json
Inject raw JSON.
Definition: jtx_json.h:31
std::strlen
T strlen(T... args)
-
ripple::test::RPCCallTestData::no_exception
@ no_exception
Definition: RPCCall_test.cpp:40
+
ripple::test::RPCCallTestData::no_exception
@ no_exception
Definition: RPCCall_test.cpp:41
std::string
STL class.
vector
-
ripple::test::RPCCallTestData::args
const std::vector< char const * > args
Definition: RPCCall_test.cpp:37
+
ripple::test::RPCCallTestData::args
const std::vector< char const * > args
Definition: RPCCall_test.cpp:38
ripple::test::jtx::Env::journal
const beast::Journal journal
Definition: Env.h:145
Json::Reader
Unserialize a JSON document into a Value.
Definition: json_reader.h:36
ripple::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:49
-
ripple::test::makeNetworkConfig
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
Definition: RPCCall_test.cpp:6414
+
ripple::test::makeNetworkConfig
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
Definition: RPCCall_test.cpp:6415
std::bad_cast
STL class.
ripple::test::RPCCallTestData::operator=
RPCCallTestData & operator=(RPCCallTestData const &)=delete
-
ripple::test::RPCCallTestData::RPCCallTestData
RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, char const *exp_)
Definition: RPCCall_test.cpp:46
-
ripple::test::RPCCallTestData::throwsWhat
const Exception throwsWhat
Definition: RPCCall_test.cpp:41
+
ripple::test::RPCCallTestData::RPCCallTestData
RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, char const *exp_)
Definition: RPCCall_test.cpp:47
+
ripple::test::RPCCallTestData::throwsWhat
const Exception throwsWhat
Definition: RPCCall_test.cpp:42
std::to_string
T to_string(T... args)
-
ripple::test::RPCCallTestData::bad_cast
@ bad_cast
Definition: RPCCall_test.cpp:40
-
ripple::test::rpcCallTestArray
static const RPCCallTestData rpcCallTestArray[]
Definition: RPCCall_test.cpp:69
-
ripple::test::RPCCall_test::testRPCCall
void testRPCCall()
Definition: RPCCall_test.cpp:6427
+
ripple::test::jtx::cmdToJSONRPC
Json::Value cmdToJSONRPC(std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
Given a rippled unit test rpc command, return the corresponding JSON.
Definition: utility.cpp:79
+
ripple::test::RPCCallTestData::bad_cast
@ bad_cast
Definition: RPCCall_test.cpp:41
+
ripple::test::rpcCallTestArray
static const RPCCallTestData rpcCallTestArray[]
Definition: RPCCall_test.cpp:70
+
ripple::test::RPCCall_test::testRPCCall
void testRPCCall()
Definition: RPCCall_test.cpp:6428
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
-
ripple::test::RPCCallTestData::Exception
Exception
Definition: RPCCall_test.cpp:40
-
ripple::test::RPCCallTestData
Definition: RPCCall_test.cpp:32
-
ripple::cmdLineToJSONRPC
Json::Value cmdLineToJSONRPC(std::vector< std::string > const &args, beast::Journal j)
Given a rippled command line, return the corresponding JSON.
Definition: RPCCall.cpp:1514
-
ripple::test::RPCCallTestData::exp
char const *const exp
Definition: RPCCall_test.cpp:44
-
ripple::test::RPCCallTestData::description
char const *const description
Definition: RPCCall_test.cpp:34
+
ripple::test::RPCCallTestData::Exception
Exception
Definition: RPCCall_test.cpp:41
+
ripple::test::RPCCallTestData
Definition: RPCCall_test.cpp:33
+
ripple::test::RPCCallTestData::exp
char const *const exp
Definition: RPCCall_test.cpp:45
+
ripple::test::RPCCallTestData::description
char const *const description
Definition: RPCCall_test.cpp:35
std::vector::begin
T begin(T... args)
ripple::test::RPCCallTestData::RPCCallTestData
RPCCallTestData()=delete
Json::Reader::parse
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
Definition: json_reader.cpp:74
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
std::string::end
T end(T... args)
std::unique_ptr
STL class.
-
ripple::test::RPCCallTestData::line
const int line
Definition: RPCCall_test.cpp:35
+
ripple::test::RPCCallTestData::line
const int line
Definition: RPCCall_test.cpp:36
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:117
-
ripple::test::RPCCall_test::run
void run() override
Definition: RPCCall_test.cpp:6492
+
ripple::test::RPCCall_test::run
void run() override
Definition: RPCCall_test.cpp:6493
Json::Value
Represents a JSON value.
Definition: json_value.h:145
-
ripple::test::updateAPIVersionString
std::string updateAPIVersionString(const char *const req)
Definition: RPCCall_test.cpp:6403
-
ripple::test::RPCCall_test
Definition: RPCCall_test.cpp:6423
+
ripple::test::updateAPIVersionString
std::string updateAPIVersionString(const char *const req)
Definition: RPCCall_test.cpp:6404
+
ripple::test::RPCCall_test
Definition: RPCCall_test.cpp:6424
initializer_list
ripple::test::BEAST_DEFINE_TESTSUITE
BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple)
diff --git a/RPCSub_8cpp_source.html b/RPCSub_8cpp_source.html index fa7029423c..f9f6671b51 100644 --- a/RPCSub_8cpp_source.html +++ b/RPCSub_8cpp_source.html @@ -358,7 +358,7 @@ $(function() {
beast::Journal::debug
Stream debug() const
Definition: Journal.h:314
std::make_pair
T make_pair(T... args)
ripple::parsedURL::domain
std::string domain
Definition: StringUtilities.h:125
-
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1711
+
ripple::RPCCall::fromNetwork
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition: RPCCall.cpp:1686
ripple::RPCSubImp::j_
const beast::Journal j_
Definition: RPCSub.cpp:204
ripple::RPCSubImp::RPCSubImp
RPCSubImp(InfoSub::Source &source, boost::asio::io_service &io_service, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)
Definition: RPCSub.cpp:34
std::ref
T ref(T... args)
diff --git a/XChain__test_8cpp_source.html b/XChain__test_8cpp_source.html index 4a6436b325..0a778f9b93 100644 --- a/XChain__test_8cpp_source.html +++ b/XChain__test_8cpp_source.html @@ -5199,7 +5199,7 @@ $(function() {
ripple::test::Balance::Balance
Balance(T &env, jtx::Account const &account)
Definition: XChain_test.cpp:255
ripple::test::XChainSim_test::ChainStateTrack::receive
void receive(jtx::Account const &acct, STAmount amt, std::uint64_t divisor=1)
Definition: XChain_test.cpp:4385
vector
-
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:470
+
ripple::test::jtx::Env::enableFeature
void enableFeature(uint256 const feature)
Definition: Env.cpp:476
std::vector::size
T size(T... args)
ripple::test::XChain_test::testXChainCreateBridge
void testXChainCreateBridge()
Definition: XChain_test.cpp:436
ripple::STXChainBridge::ChainType::issuing
@ issuing
diff --git a/attester_8cpp_source.html b/attester_8cpp_source.html index c07b0f5eff..999229f443 100644 --- a/attester_8cpp_source.html +++ b/attester_8cpp_source.html @@ -156,7 +156,7 @@ $(function() {
ripple::test::jtx::sign_create_account_attestation
Buffer sign_create_account_attestation(PublicKey const &pk, SecretKey const &sk, STXChainBridge const &bridge, AccountID const &sendingAccount, STAmount const &sendingAmount, STAmount const &rewardAmount, AccountID const &rewardAccount, bool wasLockingChainSend, std::uint64_t createCount, AccountID const &dst)
Definition: attester.cpp:56
ripple::Attestations::AttestationClaim::message
static std::vector< std::uint8_t > message(STXChainBridge const &bridge, AccountID const &sendingAccount, STAmount const &sendingAmount, AccountID const &rewardAccount, bool wasLockingChainSend, std::uint64_t claimID, std::optional< AccountID > const &dst)
Definition: XChainAttestations.cpp:215
ripple::Buffer
Like std::vector<char> but better.
Definition: Buffer.h:35
-
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:44
+
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:46
ripple::test::jtx::bridge
Json::Value bridge(Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)
Definition: xchain_bridge.cpp:40
ripple::test::jtx::sign_claim_attestation
Buffer sign_claim_attestation(PublicKey const &pk, SecretKey const &sk, STXChainBridge const &bridge, AccountID const &sendingAccount, STAmount const &sendingAmount, AccountID const &rewardAccount, bool wasLockingChainSend, std::uint64_t claimID, std::optional< AccountID > const &dst)
Definition: attester.cpp:33
ripple::base_uint< 160, detail::AccountIDTag >
diff --git a/classripple_1_1test_1_1RPCCall__test.html b/classripple_1_1test_1_1RPCCall__test.html index d82d24427c..03d3087f4a 100644 --- a/classripple_1_1test_1_1RPCCall__test.html +++ b/classripple_1_1test_1_1RPCCall__test.html @@ -100,7 +100,7 @@ Public Member Functions

Detailed Description

-

Definition at line 6423 of file RPCCall_test.cpp.

+

Definition at line 6424 of file RPCCall_test.cpp.

Member Function Documentation

◆ testRPCCall()

@@ -117,7 +117,7 @@ Public Member Functions
-

Definition at line 6427 of file RPCCall_test.cpp.

+

Definition at line 6428 of file RPCCall_test.cpp.

@@ -144,7 +144,7 @@ Public Member Functions
-

Definition at line 6492 of file RPCCall_test.cpp.

+

Definition at line 6493 of file RPCCall_test.cpp.

diff --git a/classripple_1_1test_1_1jtx_1_1Env.html b/classripple_1_1test_1_1jtx_1_1Env.html index 1e29436adc..2f9456a03d 100644 --- a/classripple_1_1test_1_1jtx_1_1Env.html +++ b/classripple_1_1test_1_1jtx_1_1Env.html @@ -1606,7 +1606,7 @@ effects.
-

Definition at line 470 of file Env.cpp.

+

Definition at line 476 of file Env.cpp.

@@ -1626,7 +1626,7 @@ effects.
-

Definition at line 478 of file Env.cpp.

+

Definition at line 484 of file Env.cpp.

diff --git a/compression__test_8cpp_source.html b/compression__test_8cpp_source.html index 4a10ce5039..2fb26e3a0f 100644 --- a/compression__test_8cpp_source.html +++ b/compression__test_8cpp_source.html @@ -649,7 +649,7 @@ $(function() {
ripple::test::compression_test::buildGetObjectByHash
std::shared_ptr< protocol::TMGetObjectByHash > buildGetObjectByHash()
Definition: compression_test.cpp:293
ripple::SHAMapNodeID
Identifies a node inside a SHAMap.
Definition: SHAMapNodeID.h:33
ripple::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:49
-
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:44
+
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:46
ripple::LedgerHeader::txHash
uint256 txHash
Definition: LedgerHeader.h:50
ripple::test::compression_test
Definition: compression_test.cpp:72
ripple::base_uint::data
pointer data()
Definition: base_uint.h:122
diff --git a/jtx__json_8cpp_source.html b/jtx__json_8cpp_source.html index aaa532a9a2..b1c10462dd 100644 --- a/jtx__json_8cpp_source.html +++ b/jtx__json_8cpp_source.html @@ -134,7 +134,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test::jtx::json::jv_
Json::Value jv_
Definition: jtx_json.h:34
std
STL namespace.
-
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:35
+
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:37
Json::Value::begin
const_iterator begin() const
Definition: json_value.cpp:1046
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:117
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/multisign_8cpp_source.html b/multisign_8cpp_source.html index 915d89e6e2..732862185b 100644 --- a/multisign_8cpp_source.html +++ b/multisign_8cpp_source.html @@ -187,7 +187,7 @@ $(function() {
sstream
ripple::sfSignerWeight
const SF_UINT16 sfSignerWeight
-
ripple::test::jtx::parse_error
Thrown when parse fails.
Definition: utility.h:34
+
ripple::test::jtx::parse_error
Thrown when parse fails.
Definition: utility.h:35
ripple::sfSigners
const SField sfSigners
ripple::Slice
An immutable linear range of bytes.
Definition: Slice.h:44
std::vector
STL class.
@@ -224,7 +224,7 @@ $(function() {
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::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
-
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:35
+
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:37
ripple::buildMultiSigningData
Serializer buildMultiSigningData(STObject const &obj, AccountID const &signingID)
Return a Serializer suitable for computing a multisigning TxnSignature.
Definition: Sign.cpp:87
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:117
Json::Value
Represents a JSON value.
Definition: json_value.h:145
diff --git a/namespacemembers_c.html b/namespacemembers_c.html index 7f14c0de72..92c9c9e92e 100644 --- a/namespacemembers_c.html +++ b/namespacemembers_c.html @@ -275,8 +275,8 @@ $(function() {
  • closeReasonToString() : ripple
  • -
  • cmdLineToJSONRPC() -: ripple +
  • cmdToJSONRPC() +: ripple::test::jtx
  • codePointToUTF8() : Json diff --git a/namespacemembers_func_c.html b/namespacemembers_func_c.html index 08675d76e0..2d08d4fdb2 100644 --- a/namespacemembers_func_c.html +++ b/namespacemembers_func_c.html @@ -228,8 +228,8 @@ $(function() {
  • closeReasonToString() : ripple
  • -
  • cmdLineToJSONRPC() -: ripple +
  • cmdToJSONRPC() +: ripple::test::jtx
  • codePointToUTF8() : Json diff --git a/namespacemembers_func_r.html b/namespacemembers_func_r.html index a35706f915..d82bb8ec1b 100644 --- a/namespacemembers_func_r.html +++ b/namespacemembers_func_r.html @@ -242,10 +242,10 @@ $(function() { : ripple
  • rpcClient() -: ripple +: ripple
  • -
  • rpcCmdLineToJson() -: ripple +
  • rpcCmdToJson() +: ripple
  • rpcError() : ripple diff --git a/namespacemembers_r.html b/namespacemembers_r.html index a358e9ee65..3924b58959 100644 --- a/namespacemembers_r.html +++ b/namespacemembers_r.html @@ -395,10 +395,10 @@ $(function() { : ripple
  • rpcClient() -: ripple +: ripple
  • -
  • rpcCmdLineToJson() -: ripple +
  • rpcCmdToJson() +: ripple
  • rpcCOMMAND_MISSING : ripple diff --git a/namespacemembers_s.html b/namespacemembers_s.html index 0e66612b23..7ae8debf45 100644 --- a/namespacemembers_s.html +++ b/namespacemembers_s.html @@ -1282,12 +1282,12 @@ $(function() {
  • sterilize() : ripple
  • -
  • Stopwatch -: ripple -
  • stopwatch() : ripple
  • +
  • Stopwatch +: ripple +
  • stpath() : ripple::test::jtx
  • diff --git a/namespacemembers_t.html b/namespacemembers_t.html index 8980ed91e6..e3e012d482 100644 --- a/namespacemembers_t.html +++ b/namespacemembers_t.html @@ -1034,12 +1034,12 @@ $(function() {
  • trustDelete() : ripple
  • -
  • TrustFlag -: ripple::test -
  • trustFlag() : ripple::test
  • +
  • TrustFlag +: ripple::test +
  • ttACCOUNT_DELETE : ripple
  • diff --git a/namespaceripple.html b/namespaceripple.html index 544b580f8c..e2051643cc 100644 --- a/namespaceripple.html +++ b/namespaceripple.html @@ -3643,14 +3643,11 @@ Functions   std::string JSONRPCRequest (std::string const &strMethod, Json::Value const &params, Json::Value const &id)   -static Json::Value rpcCmdLineToJson (std::vector< std::string > const &args, Json::Value &retParams, beast::Journal j) -  -Json::Value cmdLineToJSONRPC (std::vector< std::string > const &args, beast::Journal j) - Given a rippled command line, return the corresponding JSON. More...
    -  -std::pair< int, Json::ValuerpcClient (std::vector< std::string > const &args, Config const &config, Logs &logs, std::unordered_map< std::string, std::string > const &headers={}) - Internal invocation of RPC client. More...
    -  +Json::Value rpcCmdToJson (std::vector< std::string > const &args, Json::Value &retParams, unsigned int apiVersion, beast::Journal j) +  +std::pair< int, Json::ValuerpcClient (std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers={}) + Internal invocation of RPC client. More...
    Json::Value rpcError (int iError)   bool isRpcError (Json::Value jvResult) @@ -27202,17 +27199,14 @@ template<class Clock , class Duration , class Rep , class Period > - -

    ◆ rpcCmdLineToJson()

    + +

    ◆ rpcCmdToJson()

    - - - - - -
    - + @@ -27226,37 +27220,8 @@ template<class Clock , class Duration , class Rep , class Period > - - - - - - - - -
    static Json::Value ripple::rpcCmdLineToJson Json::Value ripple::rpcCmdToJson ( std::vector< std::string > const &  args,
    beast::Journal j 
    )
    -
    -static
    -
    - -

    Definition at line 1476 of file RPCCall.cpp.

    - -
    -
    - -

    ◆ cmdLineToJSONRPC()

    - -
    -
    - - - - - - + + @@ -27272,14 +27237,12 @@ template<class Clock , class Duration , class Rep , class Period >
    Json::Value ripple::cmdLineToJSONRPC (std::vector< std::string > const & args, unsigned int apiVersion,
    -

    Given a rippled command line, return the corresponding JSON.

    - -

    Definition at line 1514 of file RPCCall.cpp.

    +

    Definition at line 1476 of file RPCCall.cpp.

    - -

    ◆ rpcClient()

    + +

    ◆ rpcClient()

    @@ -27302,11 +27265,17 @@ template<class Clock , class Duration , class Rep , class Period >
    Logslogs, + + + + unsigned int  + apiVersion, + std::unordered_map< std::string, std::string > const &  - headers  + headers = {}  @@ -27317,8 +27286,9 @@ template<class Clock , class Duration , class Rep , class Period >

    Internal invocation of RPC client.

    +

    Used by both rippled command line as well as rippled unit tests

    -

    Definition at line 1545 of file RPCCall.cpp.

    +

    Definition at line 1517 of file RPCCall.cpp.

    diff --git a/namespaceripple_1_1RPCCall.html b/namespaceripple_1_1RPCCall.html index 67d9578823..548cbacbac 100644 --- a/namespaceripple_1_1RPCCall.html +++ b/namespaceripple_1_1RPCCall.html @@ -117,7 +117,7 @@ Functions
    -

    Definition at line 1696 of file RPCCall.cpp.

    +

    Definition at line 1670 of file RPCCall.cpp.

    @@ -213,7 +213,7 @@ Functions
    -

    Definition at line 1711 of file RPCCall.cpp.

    +

    Definition at line 1686 of file RPCCall.cpp.

    diff --git a/namespaceripple_1_1test.html b/namespaceripple_1_1test.html index 55d33cd0f5..0b151cb5f3 100644 --- a/namespaceripple_1_1test.html +++ b/namespaceripple_1_1test.html @@ -6980,7 +6980,7 @@ template<typename PreVote = decltype(defaultPreVote)>
    -

    Definition at line 6403 of file RPCCall_test.cpp.

    +

    Definition at line 6404 of file RPCCall_test.cpp.

    @@ -7000,7 +7000,7 @@ template<typename PreVote = decltype(defaultPreVote)>
    -

    Definition at line 6414 of file RPCCall_test.cpp.

    +

    Definition at line 6415 of file RPCCall_test.cpp.

    @@ -7481,7 +7481,7 @@ template<typename PreVote = decltype(defaultPreVote)>
    -

    Definition at line 69 of file RPCCall_test.cpp.

    +

    Definition at line 70 of file RPCCall_test.cpp.

    diff --git a/namespaceripple_1_1test_1_1jtx.html b/namespaceripple_1_1test_1_1jtx.html index e6679364e2..f3c6e0fe8c 100644 --- a/namespaceripple_1_1test_1_1jtx.html +++ b/namespaceripple_1_1test_1_1jtx.html @@ -494,6 +494,9 @@ Functions void fill_seq (Json::Value &jv, ReadView const &view)  Set the sequence number automatically. More...
      +Json::Value cmdToJSONRPC (std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion=RPC::apiMaximumSupportedVersion) + Given a rippled unit test rpc command, return the corresponding JSON. More...
    Json::Value bridge (Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)   Json::Value bridge_rpc (Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue) @@ -3417,7 +3420,7 @@ template<typename T >

    Convert JSON to STObject.

    This throws on failure, the JSON must be correct.

    Note
    Testing malformed JSON is beyond the scope of this set of unit test routines.
    -

    Definition at line 35 of file utility.cpp.

    +

    Definition at line 37 of file utility.cpp.

    @@ -3450,7 +3453,7 @@ template<typename T >

    Sign automatically.

    Note
    This only works on accounts with multi-signing off.
    -

    Definition at line 44 of file utility.cpp.

    +

    Definition at line 46 of file utility.cpp.

    @@ -3482,7 +3485,7 @@ template<typename T >

    Set the fee automatically.

    -

    Definition at line 55 of file utility.cpp.

    +

    Definition at line 57 of file utility.cpp.

    @@ -3514,7 +3517,45 @@ template<typename T >

    Set the sequence number automatically.

    -

    Definition at line 63 of file utility.cpp.

    +

    Definition at line 65 of file utility.cpp.

    + + + + +

    ◆ cmdToJSONRPC()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Json::Value ripple::test::jtx::cmdToJSONRPC (std::vector< std::string > const & args,
    beast::Journal j,
    unsigned int apiVersion 
    )
    +
    + +

    Given a rippled unit test rpc command, return the corresponding JSON.

    + +

    Definition at line 79 of file utility.cpp.

    diff --git a/search/all_10.js b/search/all_10.js index 17ff188e8b..efb0750f0a 100644 --- a/search/all_10.js +++ b/search/all_10.js @@ -527,7 +527,7 @@ var searchData= ['propagatenosquelch_7963',['propagateNoSquelch',['../classripple_1_1test_1_1reduce__relay__test.html#a3a74c7472a14e78e6e23b9e83560344e',1,'ripple::test::reduce_relay_test']]], ['propertystream_7964',['PropertyStream',['../classbeast_1_1PropertyStream.html',1,'beast::PropertyStream'],['../classbeast_1_1PropertyStream.html#a5a30f51c3aecb5b1fe993e773a930c5c',1,'beast::PropertyStream::PropertyStream()']]], ['propertystream_5ftest_7965',['PropertyStream_test',['../classbeast_1_1PropertyStream__test.html',1,'beast']]], - ['proposal_7966',['proposal',['../classripple_1_1TrafficCount.html#adbaee77c7a063c9aac783e54594aeda7ae7dce5bae6aaf31f79826a9eeb0ef3f2',1,'ripple::TrafficCount::proposal()'],['../classripple_1_1RCLCxPeerPos.html#abaaee52d3710a96e8c78aa725646b46e',1,'ripple::RCLCxPeerPos::proposal()'],['../classripple_1_1test_1_1csf_1_1Peer_1_1Position.html#a1de04b0e3fd869af5632c1d6f0405884',1,'ripple::test::csf::Peer::Position::proposal()'],['../classripple_1_1RCLCxPeerPos.html#abd97b534644867746e414c2ea73edd3d',1,'ripple::RCLCxPeerPos::Proposal()'],['../namespaceripple_1_1test_1_1csf.html#aa28290938888ccb2f8a78b0efc23b7c1',1,'ripple::test::csf::Proposal()'],['../namespaceripple.html#ad5143ceada01141772ae4aab984f94bdab314439bc1697845de3749d51dca7c15',1,'ripple::proposal()']]], + ['proposal_7966',['proposal',['../classripple_1_1TrafficCount.html#adbaee77c7a063c9aac783e54594aeda7ae7dce5bae6aaf31f79826a9eeb0ef3f2',1,'ripple::TrafficCount::proposal()'],['../classripple_1_1RCLCxPeerPos.html#abaaee52d3710a96e8c78aa725646b46e',1,'ripple::RCLCxPeerPos::proposal()'],['../classripple_1_1test_1_1csf_1_1Peer_1_1Position.html#a1de04b0e3fd869af5632c1d6f0405884',1,'ripple::test::csf::Peer::Position::proposal()'],['../classripple_1_1RCLCxPeerPos.html#abd97b534644867746e414c2ea73edd3d',1,'ripple::RCLCxPeerPos::Proposal()'],['../namespaceripple.html#ad5143ceada01141772ae4aab984f94bdab314439bc1697845de3749d51dca7c15',1,'ripple::proposal()'],['../namespaceripple_1_1test_1_1csf.html#aa28290938888ccb2f8a78b0efc23b7c1',1,'ripple::test::csf::Proposal()']]], ['proposal_5f_7967',['proposal_',['../classripple_1_1RCLCxPeerPos.html#a4627b53b1aabff09d542d7d05cc3e2d1',1,'ripple::RCLCxPeerPos::proposal_()'],['../classripple_1_1test_1_1csf_1_1Peer_1_1Position.html#adb45363af3245fd6cee2b62be1eaee52',1,'ripple::test::csf::Peer::Position::proposal_()']]], ['proposal_5ft_7968',['Proposal_t',['../classripple_1_1Consensus.html#af5bd2845bc56bd54e10b21c25bad7c9f',1,'ripple::Consensus::Proposal_t()'],['../structripple_1_1ConsensusResult.html#a8a6d1227ecbc6afb5b2e240ec099ce5c',1,'ripple::ConsensusResult::Proposal_t()']]], ['proposaluniqueid_7969',['proposalUniqueId',['../namespaceripple.html#a0f5de38ef7c5157e23527a0e6a720a22',1,'ripple']]], diff --git a/search/all_12.js b/search/all_12.js index 718e277a7f..9dc80d1f16 100644 --- a/search/all_12.js +++ b/search/all_12.js @@ -589,8 +589,8 @@ var searchData= ['rpccalltestdata_8698',['RPCCallTestData',['../structripple_1_1test_1_1RPCCallTestData.html',1,'ripple::test::RPCCallTestData'],['../structripple_1_1test_1_1RPCCallTestData.html#a37b89bf14fecb506b1b6de81b17613e7',1,'ripple::test::RPCCallTestData::RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, char const *exp_)'],['../structripple_1_1test_1_1RPCCallTestData.html#ab37aaf643e887b4270baae9421d8c861',1,'ripple::test::RPCCallTestData::RPCCallTestData()=delete'],['../structripple_1_1test_1_1RPCCallTestData.html#ad3a7535c0bfae677836b73090d002267',1,'ripple::test::RPCCallTestData::RPCCallTestData(RPCCallTestData const &)=delete'],['../structripple_1_1test_1_1RPCCallTestData.html#a7c71c581db16a9646e752feb0728f933',1,'ripple::test::RPCCallTestData::RPCCallTestData(RPCCallTestData &&)=delete']]], ['rpcchannel_5famt_5fmalformed_8699',['rpcCHANNEL_AMT_MALFORMED',['../namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932a60badd0db2ef5b154d6101fe7b845e39',1,'ripple']]], ['rpcchannel_5fmalformed_8700',['rpcCHANNEL_MALFORMED',['../namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932aa67c34c5d359f52c3f1fdcf2ce06dbc9',1,'ripple']]], - ['rpcclient_8701',['rpcClient',['../namespaceripple.html#a425645d42dd2466ffc69e73fc6861b3d',1,'ripple']]], - ['rpccmdlinetojson_8702',['rpcCmdLineToJson',['../namespaceripple.html#ab72afa7b2b33324b108c550dbc0a3c1f',1,'ripple']]], + ['rpcclient_8701',['rpcClient',['../namespaceripple.html#a1675cc24642888c8fd2c1b39923086b0',1,'ripple']]], + ['rpccmdtojson_8702',['rpcCmdToJson',['../namespaceripple.html#ab4682f4bd2ebab9ae978712b0e2ea894',1,'ripple']]], ['rpccommand_5fmissing_8703',['rpcCOMMAND_MISSING',['../namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932ab86d56c66edde43e490eec3de23deb47',1,'ripple']]], ['rpcdb_5fdeserialization_8704',['rpcDB_DESERIALIZATION',['../namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932aec50f1af38ef002318ef8f19ca27560c',1,'ripple']]], ['rpcdst_5fact_5fmalformed_8705',['rpcDST_ACT_MALFORMED',['../namespaceripple.html#a32d6d3ce1a48272b677d2c88b1d30932ac88bf3c7097096c5ed0fc4d354e91950',1,'ripple']]], diff --git a/search/all_13.js b/search/all_13.js index 9cfb09868d..32eed7e540 100644 --- a/search/all_13.js +++ b/search/all_13.js @@ -1302,7 +1302,7 @@ var searchData= ['stoppingcondition_5f_10099',['stoppingCondition_',['../classripple_1_1ApplicationImp.html#aead0bcc47804041f6727f3a34e094889',1,'ripple::ApplicationImp']]], ['stoppingmutex_5f_10100',['stoppingMutex_',['../classripple_1_1ApplicationImp.html#a6c73944d28b7a2d166c6f7358a8705cb',1,'ripple::ApplicationImp']]], ['stopsignaled_10101',['stopSignaled',['../structripple_1_1PerfLog__test_1_1Fixture.html#a70ce6eccc7d946525b18e5e87b901038',1,'ripple::PerfLog_test::Fixture']]], - ['stopwatch_10102',['Stopwatch',['../namespaceripple.html#abfbcd3fa60b2ddb83f5b2991900fe153',1,'ripple::Stopwatch()'],['../namespaceripple.html#ac70521ab6e1277870a9e400e7a08e937',1,'ripple::stopwatch()']]], + ['stopwatch_10102',['stopwatch',['../namespaceripple.html#ac70521ab6e1277870a9e400e7a08e937',1,'ripple::stopwatch()'],['../namespaceripple.html#abfbcd3fa60b2ddb83f5b2991900fe153',1,'ripple::Stopwatch()']]], ['stopwatch_5f_10103',['stopwatch_',['../classripple_1_1test_1_1jtx_1_1Env.html#ae5faa973b34c76e125045048ff896274',1,'ripple::test::jtx::Env']]], ['store_10104',['Store',['../classripple_1_1PeerFinder_1_1Store.html',1,'ripple::PeerFinder::Store'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_bool::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_char16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_char32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_fast16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_fast32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_fast64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_fast8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_least16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_least32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_least64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_int_least8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_intmax_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_intptr_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_llong::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_long::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_ptrdiff_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic_ref/store.html',1,'std::atomic_ref::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_schar::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_short::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_size_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uchar::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_fast16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_fast32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_fast64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_fast8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_least16_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_least32_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_least64_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uint_least8_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uintmax_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_uintptr_t::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_ullong::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_ulong::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_ushort::store()'],['http://en.cppreference.com/w/cpp/atomic/atomic/store.html',1,'std::atomic_wchar_t::store()'],['../classripple_1_1NodeStore_1_1MemoryBackend.html#a40130939ef641571abf616a970d63957',1,'ripple::NodeStore::MemoryBackend::store()'],['../classripple_1_1NodeStore_1_1NuDBBackend.html#a00c5d2a5073f3318fc0e52f255a1c212',1,'ripple::NodeStore::NuDBBackend::store()'],['../classripple_1_1NodeStore_1_1NullBackend.html#ad3d41ab83222e39efd5aaebf39160df8',1,'ripple::NodeStore::NullBackend::store()'],['../classripple_1_1NodeStore_1_1Backend.html#a8862f8d96713c985c3169e57cbb260c2',1,'ripple::NodeStore::Backend::store()'],['../classripple_1_1NodeStore_1_1Database.html#a7da2336581ee3348aad97c0d885658d0',1,'ripple::NodeStore::Database::store()'],['../classripple_1_1NodeStore_1_1BatchWriter.html#a42b3434b00f66603124653fbf691ad26',1,'ripple::NodeStore::BatchWriter::store()'],['../classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a5f23a54188aa2329d979c937d932dbaf',1,'ripple::NodeStore::DatabaseNodeImp::store()'],['../classripple_1_1NodeStore_1_1DatabaseRotatingImp.html#a7992d0dd009c5b855c331c73872c946d',1,'ripple::NodeStore::DatabaseRotatingImp::store()'],['../classripple_1_1NodeStore_1_1DatabaseShardImp.html#aa2a32f28cb0b4e0a5097205410c346eb',1,'ripple::NodeStore::DatabaseShardImp::store()'],['../classripple_1_1NodeStore_1_1DeterministicShard.html#a423e64a4166430c7ece27cc4c5b9130d',1,'ripple::NodeStore::DeterministicShard::store()']]], ['storebatch_10105',['storeBatch',['../classripple_1_1NodeStore_1_1MemoryBackend.html#ab677b7560cd27c159ad78e1412513d5f',1,'ripple::NodeStore::MemoryBackend::storeBatch()'],['../classripple_1_1NodeStore_1_1NuDBBackend.html#a4e9abc2a44a3501131709dcd6d5c509a',1,'ripple::NodeStore::NuDBBackend::storeBatch()'],['../classripple_1_1NodeStore_1_1NullBackend.html#ac3d735a9706df0a50c08a2a737ebeb3d',1,'ripple::NodeStore::NullBackend::storeBatch()'],['../classripple_1_1NodeStore_1_1Backend.html#acb1f22b4101841e695477646c95376a7',1,'ripple::NodeStore::Backend::storeBatch()'],['../classripple_1_1NodeStore_1_1TestBase.html#a5bd5d36de98ec8e56c5c3da9148ae72f',1,'ripple::NodeStore::TestBase::storeBatch(Backend &backend, Batch const &batch)'],['../classripple_1_1NodeStore_1_1TestBase.html#a50f8fd79e970626074538cf54ca8432f',1,'ripple::NodeStore::TestBase::storeBatch(Database &db, Batch const &batch)']]], diff --git a/search/all_14.js b/search/all_14.js index 6783bd1f32..30c1dc0f51 100644 --- a/search/all_14.js +++ b/search/all_14.js @@ -1336,7 +1336,7 @@ var searchData= ['throwfieldnotfound_11674',['throwFieldNotFound',['../namespaceripple.html#af0a467a958f129b28547a25cda377e90',1,'ripple']]], ['throwswhat_11675',['throwsWhat',['../structripple_1_1test_1_1RPCCallTestData.html#ad95588db2404d70d20ed662e9530b416',1,'ripple::test::RPCCallTestData']]], ['tick_11676',['tick',['../classripple_1_1ConsensusTimer.html#aa1622d363e3b90aa2b36c772c1bc9b1f',1,'ripple::ConsensusTimer::tick(std::chrono::milliseconds fixed)'],['../classripple_1_1ConsensusTimer.html#ae7dd7a076b15810123615aa8718981d0',1,'ripple::ConsensusTimer::tick(time_point tp)']]], - ['ticket_11677',['ticket',['../classripple_1_1SeqProxy.html#a5f784f2f26fb8ede1c7386011509beadab1fd5ef0f4ad79f202682b28d8803bbc',1,'ripple::SeqProxy::ticket()'],['../namespaceripple_1_1keylet.html#ae59cd86187ff4936a91b183ec2ea1bf9',1,'ripple::keylet::ticket()'],['../namespaceripple.html#a22768e0a41b646442c98d38f2f2a307bacd819f2eff20b61bcf41bc22df219217',1,'ripple::TICKET()']]], + ['ticket_11677',['ticket',['../classripple_1_1SeqProxy.html#a5f784f2f26fb8ede1c7386011509beadab1fd5ef0f4ad79f202682b28d8803bbc',1,'ripple::SeqProxy::ticket()'],['../namespaceripple.html#a22768e0a41b646442c98d38f2f2a307bacd819f2eff20b61bcf41bc22df219217',1,'ripple::TICKET()'],['../namespaceripple_1_1keylet.html#ae59cd86187ff4936a91b183ec2ea1bf9',1,'ripple::keylet::ticket()']]], ['ticket_5ft_11678',['ticket_t',['../structripple_1_1keylet_1_1ticket__t.html',1,'ripple::keylet::ticket_t'],['../structripple_1_1keylet_1_1ticket__t.html#a61bfed35f0bb0bfb5b3a0b4a5ba80b69',1,'ripple::keylet::ticket_t::ticket_t()']]], ['ticket_5ftest_11679',['Ticket_test',['../classripple_1_1Ticket__test.html',1,'ripple']]], ['ticketcount_11680',['ticketCount',['../classripple_1_1Clawback__test.html#a4131aa42c04adcc21d66c9c15d877624',1,'ripple::Clawback_test::ticketCount()'],['../classripple_1_1NFToken0__test.html#a5ae4dbb7e2c9e5c84c3f448cca5ccc08',1,'ripple::NFToken0_test::ticketCount()']]], @@ -1626,7 +1626,7 @@ var searchData= ['trustedvalidations_11964',['trustedValidations',['../classripple_1_1AmendmentSet.html#a6d6b63ea4b09a0b012667c79aff07528',1,'ripple::AmendmentSet']]], ['trustedvalidations_5f_11965',['trustedValidations_',['../classripple_1_1AmendmentSet.html#a08f7a2888e1f8767713d045a114975c9',1,'ripple::AmendmentSet']]], ['trustedvotes_11966',['TrustedVotes',['../classripple_1_1TrustedVotes.html',1,'ripple::TrustedVotes'],['../classripple_1_1TrustedVotes.html#a3d752f8a8137c54441bd754db241b286',1,'ripple::TrustedVotes::TrustedVotes()=default'],['../classripple_1_1TrustedVotes.html#abe5928a3f6fa4cf32bc180a88978e4bf',1,'ripple::TrustedVotes::TrustedVotes(TrustedVotes const &rhs)=delete']]], - ['trustflag_11967',['trustFlag',['../namespaceripple_1_1test.html#a6879dc19e056b84550387698c4c38ec4',1,'ripple::test::trustFlag(TrustFlag f, bool useHigh)'],['../namespaceripple_1_1test.html#acf39cc44acdd6b5089f2076897fa3911',1,'ripple::test::TrustFlag()']]], + ['trustflag_11967',['TrustFlag',['../namespaceripple_1_1test.html#acf39cc44acdd6b5089f2076897fa3911',1,'ripple::test::TrustFlag()'],['../namespaceripple_1_1test.html#a6879dc19e056b84550387698c4c38ec4',1,'ripple::test::trustFlag(TrustFlag f, bool useHigh)']]], ['trustgraph_11968',['TrustGraph',['../classripple_1_1test_1_1csf_1_1TrustGraph.html',1,'ripple::test::csf::TrustGraph< Peer >'],['../classripple_1_1test_1_1csf_1_1TrustGraph.html#ad71fd7d9762e7c9b25ef2f27514afd9f',1,'ripple::test::csf::TrustGraph::TrustGraph()'],['../structripple_1_1test_1_1csf_1_1Peer.html#a570755672f7b6ec1c2bb96570882c166',1,'ripple::test::csf::Peer::trustGraph()'],['../classripple_1_1test_1_1csf_1_1Sim.html#a8bc47ca290010d8a2637da1cd274a605',1,'ripple::test::csf::Sim::trustGraph()']]], ['trustgraph_3c_20ripple_3a_3atest_3a_3acsf_3a_3apeer_20_2a_20_3e_11969',['TrustGraph< ripple::test::csf::Peer * >',['../classripple_1_1test_1_1csf_1_1TrustGraph.html',1,'ripple::test::csf']]], ['trustlinebase_11970',['TrustLineBase',['../classripple_1_1TrustLineBase.html',1,'ripple::TrustLineBase'],['../classripple_1_1TrustLineBase.html#a710bb727f7f0b4d0872fcca8eaed8768',1,'ripple::TrustLineBase::TrustLineBase(std::shared_ptr< SLE const > const &sle, AccountID const &viewAccount)'],['../classripple_1_1TrustLineBase.html#ae0423b9670b43791ebddc47fc329256f',1,'ripple::TrustLineBase::TrustLineBase(TrustLineBase const &)=default'],['../classripple_1_1TrustLineBase.html#a74bdbbfaa6b36d1c4444faaa507012e9',1,'ripple::TrustLineBase::TrustLineBase(TrustLineBase &&)=default']]], diff --git a/search/all_3.js b/search/all_3.js index 346ff0874e..f5260afe03 100644 --- a/search/all_3.js +++ b/search/all_3.js @@ -393,7 +393,7 @@ var searchData= ['cmaxnativen_1486',['cMaxNativeN',['../classripple_1_1STAmount.html#aec883ced71610cf0715b26a5420f7cc2',1,'ripple::STAmount']]], ['cmaxoffset_1487',['cMaxOffset',['../classripple_1_1STAmount.html#a84ebd351b1c12b5467b59c9cd4d1640f',1,'ripple::STAmount']]], ['cmaxvalue_1488',['cMaxValue',['../classripple_1_1STAmount.html#af88c7b9a2ee49408f4fd17e1ee9f20df',1,'ripple::STAmount']]], - ['cmdlinetojsonrpc_1489',['cmdLineToJSONRPC',['../namespaceripple.html#aa9714d222b28553ab9f4e9baf34be4ff',1,'ripple']]], + ['cmdtojsonrpc_1489',['cmdToJSONRPC',['../namespaceripple_1_1test_1_1jtx.html#a145fb5e66071d636501a3aeae90f48f4',1,'ripple::test::jtx']]], ['cminoffset_1490',['cMinOffset',['../classripple_1_1STAmount.html#ade4056a07e14fcd243fd2609eedba34d',1,'ripple::STAmount']]], ['cminvalue_1491',['cMinValue',['../classripple_1_1STAmount.html#ad845bc67616b999387da6badf56f7290',1,'ripple::STAmount']]], ['cmpbyclaimid_1492',['CmpByClaimID',['../structripple_1_1Attestations_1_1CmpByClaimID.html',1,'ripple::Attestations']]], diff --git a/search/functions_12.js b/search/functions_12.js index ba01a1bea2..4ec6e9cc0e 100644 --- a/search/functions_12.js +++ b/search/functions_12.js @@ -286,8 +286,8 @@ var searchData= ['rpc_21155',['rpc',['../classripple_1_1test_1_1jtx_1_1Env.html#a0f3a59ffc07ea469d2999d1ae0aeea77',1,'ripple::test::jtx::Env::rpc(std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)'],['../classripple_1_1test_1_1jtx_1_1Env.html#adc4b1e4d47d06b334509103556dca071',1,'ripple::test::jtx::Env::rpc(std::string const &cmd, Args &&... args)']]], ['rpccallimp_21156',['RPCCallImp',['../structripple_1_1RPCCallImp.html#a32512463f0b70d4fcc36aec0536ab066',1,'ripple::RPCCallImp']]], ['rpccalltestdata_21157',['RPCCallTestData',['../structripple_1_1test_1_1RPCCallTestData.html#a37b89bf14fecb506b1b6de81b17613e7',1,'ripple::test::RPCCallTestData::RPCCallTestData(char const *description_, int line_, std::initializer_list< char const * > const &args_, Exception throwsWhat_, char const *exp_)'],['../structripple_1_1test_1_1RPCCallTestData.html#ab37aaf643e887b4270baae9421d8c861',1,'ripple::test::RPCCallTestData::RPCCallTestData()=delete'],['../structripple_1_1test_1_1RPCCallTestData.html#ad3a7535c0bfae677836b73090d002267',1,'ripple::test::RPCCallTestData::RPCCallTestData(RPCCallTestData const &)=delete'],['../structripple_1_1test_1_1RPCCallTestData.html#a7c71c581db16a9646e752feb0728f933',1,'ripple::test::RPCCallTestData::RPCCallTestData(RPCCallTestData &&)=delete']]], - ['rpcclient_21158',['rpcClient',['../namespaceripple.html#a425645d42dd2466ffc69e73fc6861b3d',1,'ripple']]], - ['rpccmdlinetojson_21159',['rpcCmdLineToJson',['../namespaceripple.html#ab72afa7b2b33324b108c550dbc0a3c1f',1,'ripple']]], + ['rpcclient_21158',['rpcClient',['../namespaceripple.html#a1675cc24642888c8fd2c1b39923086b0',1,'ripple']]], + ['rpccmdtojson_21159',['rpcCmdToJson',['../namespaceripple.html#ab4682f4bd2ebab9ae978712b0e2ea894',1,'ripple']]], ['rpcend_21160',['rpcEnd',['../classripple_1_1perf_1_1PerfLogImp.html#a09db64fc2f2fda2ce5baed6593246e3a',1,'ripple::perf::PerfLogImp']]], ['rpcerror_21161',['rpcError',['../classripple_1_1perf_1_1PerfLog.html#aec6c9ca532af5e940134aaf26b8c2d35',1,'ripple::perf::PerfLog::rpcError()'],['../classripple_1_1perf_1_1PerfLogImp.html#a0f417799122c7322f8d9ac1cabdc391d',1,'ripple::perf::PerfLogImp::rpcError()'],['../classripple_1_1perf_1_1PerfLogTest.html#a17348014d576d8f891775c55a59b48e5',1,'ripple::perf::PerfLogTest::rpcError()'],['../namespaceripple.html#a67869382f83fd55cf3096d2591a57b07',1,'ripple::rpcError()']]], ['rpcerrorstring_21162',['rpcErrorString',['../namespaceripple.html#a23f02900cac703bddf91fff471cb9d65',1,'ripple']]], diff --git a/search/functions_3.js b/search/functions_3.js index 7ebeb7346b..2a421d0620 100644 --- a/search/functions_3.js +++ b/search/functions_3.js @@ -260,7 +260,7 @@ var searchData= ['cluster_5ftest_17334',['cluster_test',['../classripple_1_1tests_1_1cluster__test.html#a25904f394cdb0da99158c1f40703ce9b',1,'ripple::tests::cluster_test']]], ['clusternode_17335',['ClusterNode',['../classripple_1_1ClusterNode.html#a12ed0ed73d1952de4c7cac76a758f3cf',1,'ripple::ClusterNode::ClusterNode()=delete'],['../classripple_1_1ClusterNode.html#a9494a278e3118a17b53cdc00b93cbb69',1,'ripple::ClusterNode::ClusterNode(PublicKey const &identity, std::string const &name, std::uint32_t fee=0, NetClock::time_point rtime=NetClock::time_point{})']]], ['cmatch_17336',['cmatch',['http://en.cppreference.com/w/cpp/regex/match_results/match_results.html',1,'std::cmatch']]], - ['cmdlinetojsonrpc_17337',['cmdLineToJSONRPC',['../namespaceripple.html#aa9714d222b28553ab9f4e9baf34be4ff',1,'ripple']]], + ['cmdtojsonrpc_17337',['cmdToJSONRPC',['../namespaceripple_1_1test_1_1jtx.html#a145fb5e66071d636501a3aeae90f48f4',1,'ripple::test::jtx']]], ['code_17338',['code',['http://en.cppreference.com/w/cpp/thread/future_error/code.html',1,'std::future_error::code()'],['http://en.cppreference.com/w/cpp/regex/regex_error/code.html',1,'std::regex_error::code()'],['http://en.cppreference.com/w/cpp/error/system_error/code.html',1,'std::system_error::code()']]], ['codecvt_17339',['codecvt',['http://en.cppreference.com/w/cpp/locale/codecvt/codecvt.html',1,'std::codecvt']]], ['codecvt_5fbyname_17340',['codecvt_byname',['http://en.cppreference.com/w/cpp/locale/codecvt_byname.html',1,'std::codecvt_byname']]], diff --git a/sig_8cpp_source.html b/sig_8cpp_source.html index f5b52e8f3d..3eb71b6717 100644 --- a/sig_8cpp_source.html +++ b/sig_8cpp_source.html @@ -115,7 +115,7 @@ $(function() {
    ripple::test::jtx::sig::manual_
    bool manual_
    Definition: sig.h:37
    ripple::test::jtx::sig::operator()
    void operator()(Env &, JTx &jt) const
    Definition: sig.cpp:28
    -
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:44
    +
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:46
    ripple::test::jtx::JTx
    Execution context for applying a JSON transaction.
    Definition: JTx.h:42
    ripple::test::jtx::JTx::signer
    std::function< void(Env &, JTx &)> signer
    Definition: JTx.h:51
    ripple::test::jtx::sig::account_
    std::optional< Account > account_
    Definition: sig.h:38
    diff --git a/structripple_1_1test_1_1RPCCallTestData.html b/structripple_1_1test_1_1RPCCallTestData.html index 7d35633b33..f73b74073d 100644 --- a/structripple_1_1test_1_1RPCCallTestData.html +++ b/structripple_1_1test_1_1RPCCallTestData.html @@ -121,7 +121,7 @@ Public Attributes

    Detailed Description

    -

    Definition at line 32 of file RPCCall_test.cpp.

    +

    Definition at line 33 of file RPCCall_test.cpp.

    Member Enumeration Documentation

    ◆ Exception

    @@ -139,7 +139,7 @@ Public Attributes bad_cast  -

    Definition at line 40 of file RPCCall_test.cpp.

    +

    Definition at line 41 of file RPCCall_test.cpp.

    @@ -188,7 +188,7 @@ Public Attributes
    -

    Definition at line 46 of file RPCCall_test.cpp.

    +

    Definition at line 47 of file RPCCall_test.cpp.

    @@ -335,7 +335,7 @@ Public Attributes
    -

    Definition at line 34 of file RPCCall_test.cpp.

    +

    Definition at line 35 of file RPCCall_test.cpp.

    @@ -351,7 +351,7 @@ Public Attributes
    -

    Definition at line 35 of file RPCCall_test.cpp.

    +

    Definition at line 36 of file RPCCall_test.cpp.

    @@ -367,7 +367,7 @@ Public Attributes
    -

    Definition at line 37 of file RPCCall_test.cpp.

    +

    Definition at line 38 of file RPCCall_test.cpp.

    @@ -383,7 +383,7 @@ Public Attributes
    -

    Definition at line 41 of file RPCCall_test.cpp.

    +

    Definition at line 42 of file RPCCall_test.cpp.

    @@ -399,7 +399,7 @@ Public Attributes
    -

    Definition at line 44 of file RPCCall_test.cpp.

    +

    Definition at line 45 of file RPCCall_test.cpp.

    diff --git a/structripple_1_1test_1_1jtx_1_1parse__error.html b/structripple_1_1test_1_1jtx_1_1parse__error.html index 162293462e..69ed1dc4d4 100644 --- a/structripple_1_1test_1_1jtx_1_1parse__error.html +++ b/structripple_1_1test_1_1jtx_1_1parse__error.html @@ -105,7 +105,7 @@ Public Member Functions

    Detailed Description

    Thrown when parse fails.

    -

    Definition at line 34 of file utility.h.

    +

    Definition at line 35 of file utility.h.

    Constructor & Destructor Documentation

    ◆ parse_error()

    @@ -133,7 +133,7 @@ template<class String >
    -

    Definition at line 37 of file utility.h.

    +

    Definition at line 38 of file utility.h.

    diff --git a/utility_8cpp_source.html b/utility_8cpp_source.html index 19461d5f41..c23102704e 100644 --- a/utility_8cpp_source.html +++ b/utility_8cpp_source.html @@ -89,92 +89,133 @@ $(function() {
    18 //==============================================================================
    19 
    20 #include <ripple/basics/contract.h>
    -
    21 #include <ripple/protocol/ErrorCodes.h>
    -
    22 #include <ripple/protocol/HashPrefix.h>
    -
    23 #include <ripple/protocol/Indexes.h>
    -
    24 #include <ripple/protocol/STParsedJSON.h>
    -
    25 #include <ripple/protocol/UintTypes.h>
    -
    26 #include <ripple/protocol/jss.h>
    -
    27 #include <cstring>
    -
    28 #include <test/jtx/utility.h>
    -
    29 
    -
    30 namespace ripple {
    -
    31 namespace test {
    -
    32 namespace jtx {
    -
    33 
    -
    34 STObject
    -
    35 parse(Json::Value const& jv)
    -
    36 {
    -
    37  STParsedJSONObject p("tx_json", jv);
    -
    38  if (!p.object)
    -
    39  Throw<parse_error>(rpcErrorString(p.error));
    -
    40  return std::move(*p.object);
    -
    41 }
    -
    42 
    -
    43 void
    -
    44 sign(Json::Value& jv, Account const& account)
    -
    45 {
    -
    46  jv[jss::SigningPubKey] = strHex(account.pk().slice());
    -
    47  Serializer ss;
    -
    48  ss.add32(HashPrefix::txSign);
    -
    49  parse(jv).addWithoutSigningFields(ss);
    -
    50  auto const sig = ripple::sign(account.pk(), account.sk(), ss.slice());
    -
    51  jv[jss::TxnSignature] = strHex(Slice{sig.data(), sig.size()});
    -
    52 }
    -
    53 
    -
    54 void
    -
    55 fill_fee(Json::Value& jv, ReadView const& view)
    -
    56 {
    -
    57  if (jv.isMember(jss::Fee))
    -
    58  return;
    -
    59  jv[jss::Fee] = to_string(view.fees().base);
    -
    60 }
    -
    61 
    -
    62 void
    -
    63 fill_seq(Json::Value& jv, ReadView const& view)
    -
    64 {
    -
    65  if (jv.isMember(jss::Sequence))
    -
    66  return;
    -
    67  auto const account = parseBase58<AccountID>(jv[jss::Account].asString());
    -
    68  if (!account)
    -
    69  Throw<parse_error>("unexpected invalid Account");
    -
    70  auto const ar = view.read(keylet::account(*account));
    -
    71  if (!ar)
    -
    72  Throw<parse_error>("unexpected missing account root");
    -
    73  jv[jss::Sequence] = ar->getFieldU32(sfSequence);
    -
    74 }
    -
    75 
    -
    76 } // namespace jtx
    -
    77 } // namespace test
    -
    78 } // namespace ripple
    +
    21 #include <ripple/json/Object.h>
    +
    22 #include <ripple/net/RPCCall.h>
    +
    23 #include <ripple/protocol/ErrorCodes.h>
    +
    24 #include <ripple/protocol/HashPrefix.h>
    +
    25 #include <ripple/protocol/Indexes.h>
    +
    26 #include <ripple/protocol/STParsedJSON.h>
    +
    27 #include <ripple/protocol/UintTypes.h>
    +
    28 #include <ripple/protocol/jss.h>
    +
    29 #include <cstring>
    +
    30 #include <test/jtx/utility.h>
    +
    31 
    +
    32 namespace ripple {
    +
    33 namespace test {
    +
    34 namespace jtx {
    +
    35 
    +
    36 STObject
    +
    37 parse(Json::Value const& jv)
    +
    38 {
    +
    39  STParsedJSONObject p("tx_json", jv);
    +
    40  if (!p.object)
    +
    41  Throw<parse_error>(rpcErrorString(p.error));
    +
    42  return std::move(*p.object);
    +
    43 }
    +
    44 
    +
    45 void
    +
    46 sign(Json::Value& jv, Account const& account)
    +
    47 {
    +
    48  jv[jss::SigningPubKey] = strHex(account.pk().slice());
    +
    49  Serializer ss;
    +
    50  ss.add32(HashPrefix::txSign);
    +
    51  parse(jv).addWithoutSigningFields(ss);
    +
    52  auto const sig = ripple::sign(account.pk(), account.sk(), ss.slice());
    +
    53  jv[jss::TxnSignature] = strHex(Slice{sig.data(), sig.size()});
    +
    54 }
    +
    55 
    +
    56 void
    +
    57 fill_fee(Json::Value& jv, ReadView const& view)
    +
    58 {
    +
    59  if (jv.isMember(jss::Fee))
    +
    60  return;
    +
    61  jv[jss::Fee] = to_string(view.fees().base);
    +
    62 }
    +
    63 
    +
    64 void
    +
    65 fill_seq(Json::Value& jv, ReadView const& view)
    +
    66 {
    +
    67  if (jv.isMember(jss::Sequence))
    +
    68  return;
    +
    69  auto const account = parseBase58<AccountID>(jv[jss::Account].asString());
    +
    70  if (!account)
    +
    71  Throw<parse_error>("unexpected invalid Account");
    +
    72  auto const ar = view.read(keylet::account(*account));
    +
    73  if (!ar)
    +
    74  Throw<parse_error>("unexpected missing account root");
    +
    75  jv[jss::Sequence] = ar->getFieldU32(sfSequence);
    +
    76 }
    +
    77 
    +
    78 Json::Value
    +
    79 cmdToJSONRPC(
    +
    80  std::vector<std::string> const& args,
    +
    81  beast::Journal j,
    +
    82  unsigned int apiVersion)
    +
    83 {
    +
    84  Json::Value jv = Json::Value(Json::objectValue);
    +
    85  auto const paramsObj = rpcCmdToJson(args, jv, apiVersion, j);
    +
    86 
    +
    87  // Re-use jv to return our formatted result.
    +
    88  jv.clear();
    +
    89 
    +
    90  // Allow parser to rewrite method.
    +
    91  jv[jss::method] = paramsObj.isMember(jss::method)
    +
    92  ? paramsObj[jss::method].asString()
    +
    93  : args[0];
    +
    94 
    +
    95  // If paramsObj is not empty, put it in a [params] array.
    +
    96  if (paramsObj.begin() != paramsObj.end())
    +
    97  {
    +
    98  auto& paramsArray = Json::setArray(jv, jss::params);
    +
    99  paramsArray.append(paramsObj);
    +
    100  }
    +
    101  if (paramsObj.isMember(jss::jsonrpc))
    +
    102  jv[jss::jsonrpc] = paramsObj[jss::jsonrpc];
    +
    103  if (paramsObj.isMember(jss::ripplerpc))
    +
    104  jv[jss::ripplerpc] = paramsObj[jss::ripplerpc];
    +
    105  if (paramsObj.isMember(jss::id))
    +
    106  jv[jss::id] = paramsObj[jss::id];
    +
    107  return jv;
    +
    108 }
    +
    109 
    +
    110 } // namespace jtx
    +
    111 } // namespace test
    +
    112 } // namespace ripple
    cstring
    ripple::rpcErrorString
    std::string rpcErrorString(Json::Value const &jv)
    Returns a single string with the contents of an RPC error.
    Definition: ErrorCodes.cpp:212
    ripple::Slice
    An immutable linear range of bytes.
    Definition: Slice.h:44
    ripple::sfSequence
    const SF_UINT32 sfSequence
    +
    std::vector< std::string >
    ripple::ReadView::fees
    virtual Fees const & fees() const =0
    Returns the fees for the base ledger.
    -
    ripple::test::jtx::fill_seq
    void fill_seq(Json::Value &jv, ReadView const &view)
    Set the sequence number automatically.
    Definition: utility.cpp:63
    +
    ripple::rpcCmdToJson
    Json::Value rpcCmdToJson(std::vector< std::string > const &args, Json::Value &retParams, unsigned int apiVersion, beast::Journal j)
    Definition: RPCCall.cpp:1476
    +
    ripple::test::jtx::fill_seq
    void fill_seq(Json::Value &jv, ReadView const &view)
    Set the sequence number automatically.
    Definition: utility.cpp:65
    ripple::STParsedJSONObject
    Holds the serialized result of parsing an input JSON object.
    Definition: STParsedJSON.h:31
    -
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:44
    +
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:46
    ripple::STParsedJSONObject::object
    std::optional< STObject > object
    The STObject if the parse was successful.
    Definition: STParsedJSON.h:50
    ripple::STParsedJSONObject::error
    Json::Value error
    On failure, an appropriate set of error values.
    Definition: STParsedJSON.h:53
    +
    Json::objectValue
    @ objectValue
    object value (collection of name/value pairs).
    Definition: json_value.h:43
    ripple::keylet::account
    Keylet account(AccountID const &id) noexcept
    AccountID root.
    Definition: Indexes.cpp:142
    -
    ripple::test::jtx::fill_fee
    void fill_fee(Json::Value &jv, ReadView const &view)
    Set the fee automatically.
    Definition: utility.cpp:55
    +
    ripple::test::jtx::fill_fee
    void fill_fee(Json::Value &jv, ReadView const &view)
    Set the fee automatically.
    Definition: utility.cpp:57
    +
    ripple::test::jtx::cmdToJSONRPC
    Json::Value cmdToJSONRPC(std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
    Given a rippled unit test rpc command, return the corresponding JSON.
    Definition: utility.cpp:79
    ripple::Serializer::slice
    Slice slice() const noexcept
    Definition: Serializer.h:64
    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::test::jtx::sig
    Set the regular signature on a JTx.
    Definition: sig.h:34
    ripple::STObject::addWithoutSigningFields
    void addWithoutSigningFields(Serializer &s) const
    Definition: STObject.h:892
    ripple::ReadView::read
    virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
    Return the state item associated with a key.
    +
    Json::setArray
    Json::Value & setArray(Json::Value &, Json::StaticString const &key)
    Add a new subarray at a named key in a Json object.
    Definition: Object.h:414
    ripple::Serializer
    Definition: Serializer.h:40
    ripple::ReadView
    A view into a ledger.
    Definition: ReadView.h:54
    ripple
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition: RCLCensorshipDetector.h:29
    +
    Json::Value::clear
    void clear()
    Remove all object members and array elements.
    Definition: json_value.cpp:753
    ripple::sign
    Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &m)
    Generate a signature for a message.
    Definition: SecretKey.cpp:238
    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::Serializer::add32
    int add32(std::uint32_t i)
    Definition: Serializer.cpp:38
    ripple::strHex
    std::string strHex(FwdIt begin, FwdIt end)
    Definition: strHex.h:30
    ripple::HashPrefix::txSign
    @ txSign
    inner transaction to sign
    -
    ripple::test::jtx::parse
    STObject parse(Json::Value const &jv)
    Convert JSON to STObject.
    Definition: utility.cpp:35
    +
    ripple::test::jtx::parse
    STObject parse(Json::Value const &jv)
    Convert JSON to STObject.
    Definition: utility.cpp:37
    ripple::Fees::base
    XRPAmount base
    Definition: protocol/Fees.h:34
    Json::Value
    Represents a JSON value.
    Definition: json_value.h:145
    diff --git a/utility_8h_source.html b/utility_8h_source.html index 3229314b5b..0074fd7352 100644 --- a/utility_8h_source.html +++ b/utility_8h_source.html @@ -94,52 +94,63 @@ $(function() {
    23 #include <ripple/app/ledger/Ledger.h>
    24 #include <ripple/json/json_value.h>
    25 #include <ripple/protocol/STObject.h>
    -
    26 #include <stdexcept>
    -
    27 #include <test/jtx/Account.h>
    -
    28 
    -
    29 namespace ripple {
    -
    30 namespace test {
    -
    31 namespace jtx {
    -
    32 
    -
    34 struct parse_error : std::logic_error
    -
    35 {
    -
    36  template <class String>
    -
    37  explicit parse_error(String const& s) : logic_error(s)
    -
    38  {
    -
    39  }
    -
    40 };
    -
    41 
    -
    47 STObject
    -
    48 parse(Json::Value const& jv);
    -
    49 
    -
    53 void
    -
    54 sign(Json::Value& jv, Account const& account);
    -
    55 
    -
    57 void
    -
    58 fill_fee(Json::Value& jv, ReadView const& view);
    -
    59 
    -
    61 void
    -
    62 fill_seq(Json::Value& jv, ReadView const& view);
    -
    63 
    -
    64 } // namespace jtx
    -
    65 } // namespace test
    -
    66 } // namespace ripple
    -
    67 
    -
    68 #endif
    +
    26 #include <ripple/rpc/impl/RPCHelpers.h>
    +
    27 #include <stdexcept>
    +
    28 #include <test/jtx/Account.h>
    +
    29 
    +
    30 namespace ripple {
    +
    31 namespace test {
    +
    32 namespace jtx {
    +
    33 
    +
    35 struct parse_error : std::logic_error
    +
    36 {
    +
    37  template <class String>
    +
    38  explicit parse_error(String const& s) : logic_error(s)
    +
    39  {
    +
    40  }
    +
    41 };
    +
    42 
    +
    48 STObject
    +
    49 parse(Json::Value const& jv);
    +
    50 
    +
    54 void
    +
    55 sign(Json::Value& jv, Account const& account);
    +
    56 
    +
    58 void
    +
    59 fill_fee(Json::Value& jv, ReadView const& view);
    +
    60 
    +
    62 void
    +
    63 fill_seq(Json::Value& jv, ReadView const& view);
    +
    64 
    +
    66 Json::Value
    +
    67 cmdToJSONRPC(
    +
    68  std::vector<std::string> const& args,
    +
    69  beast::Journal j,
    +
    70  unsigned int apiVersion = RPC::apiMaximumSupportedVersion);
    +
    71 
    +
    72 } // namespace jtx
    +
    73 } // namespace test
    +
    74 } // namespace ripple
    +
    75 
    +
    76 #endif
    -
    ripple::test::jtx::parse_error
    Thrown when parse fails.
    Definition: utility.h:34
    -
    ripple::test::jtx::fill_seq
    void fill_seq(Json::Value &jv, ReadView const &view)
    Set the sequence number automatically.
    Definition: utility.cpp:63
    -
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:44
    +
    ripple::test::jtx::parse_error
    Thrown when parse fails.
    Definition: utility.h:35
    +
    std::vector< std::string >
    +
    ripple::test::jtx::fill_seq
    void fill_seq(Json::Value &jv, ReadView const &view)
    Set the sequence number automatically.
    Definition: utility.cpp:65
    +
    ripple::test::jtx::sign
    void sign(Json::Value &jv, Account const &account)
    Sign automatically.
    Definition: utility.cpp:46
    stdexcept
    -
    ripple::test::jtx::fill_fee
    void fill_fee(Json::Value &jv, ReadView const &view)
    Set the fee automatically.
    Definition: utility.cpp:55
    +
    ripple::test::jtx::fill_fee
    void fill_fee(Json::Value &jv, ReadView const &view)
    Set the fee automatically.
    Definition: utility.cpp:57
    +
    ripple::test::jtx::cmdToJSONRPC
    Json::Value cmdToJSONRPC(std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
    Given a rippled unit test rpc command, return the corresponding JSON.
    Definition: utility.cpp:79
    std::logic_error
    STL class.
    +
    beast::Journal
    A generic endpoint for log messages.
    Definition: Journal.h:58
    ripple::STObject
    Definition: STObject.h:52
    ripple::ReadView
    A view into a ledger.
    Definition: ReadView.h:54
    ripple
    Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
    Definition: RCLCensorshipDetector.h:29
    +
    ripple::RPC::apiMaximumSupportedVersion
    constexpr unsigned int apiMaximumSupportedVersion
    Definition: RPCHelpers.h:243
    ripple::test::jtx::Account
    Immutable cryptographic account descriptor.
    Definition: Account.h:37
    -
    ripple::test::jtx::parse
    STObject parse(Json::Value const &jv)
    Convert JSON to STObject.
    Definition: utility.cpp:35
    +
    ripple::test::jtx::parse
    STObject parse(Json::Value const &jv)
    Convert JSON to STObject.
    Definition: utility.cpp:37
    Json::Value
    Represents a JSON value.
    Definition: json_value.h:145
    -
    ripple::test::jtx::parse_error::parse_error
    parse_error(String const &s)
    Definition: utility.h:37
    +
    ripple::test::jtx::parse_error::parse_error
    parse_error(String const &s)
    Definition: utility.h:38