rippled
Env.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <test/jtx/balance.h>
21 #include <test/jtx/Env.h>
22 #include <test/jtx/fee.h>
23 #include <test/jtx/flags.h>
24 #include <test/jtx/pay.h>
25 #include <test/jtx/trust.h>
26 #include <test/jtx/require.h>
27 #include <test/jtx/seq.h>
28 #include <test/jtx/sig.h>
29 #include <test/jtx/utility.h>
30 #include <test/jtx/JSONRPCClient.h>
31 #include <ripple/app/ledger/LedgerMaster.h>
32 #include <ripple/consensus/LedgerTiming.h>
33 #include <ripple/app/misc/NetworkOPs.h>
34 #include <ripple/app/misc/TxQ.h>
35 #include <ripple/basics/contract.h>
36 #include <ripple/basics/Slice.h>
37 #include <ripple/json/to_string.h>
38 #include <ripple/net/HTTPClient.h>
39 #include <ripple/net/RPCCall.h>
40 #include <ripple/protocol/ErrorCodes.h>
41 #include <ripple/protocol/Feature.h>
42 #include <ripple/protocol/HashPrefix.h>
43 #include <ripple/protocol/Indexes.h>
44 #include <ripple/protocol/jss.h>
45 #include <ripple/protocol/LedgerFormats.h>
46 #include <ripple/protocol/Serializer.h>
47 #include <ripple/protocol/SystemParameters.h>
48 #include <ripple/protocol/TER.h>
49 #include <ripple/protocol/TxFlags.h>
50 #include <ripple/protocol/UintTypes.h>
51 #include <memory>
52 
53 namespace ripple {
54 namespace test {
55 namespace jtx {
56 
57 //------------------------------------------------------------------------------
58 
59 Env::AppBundle::AppBundle(beast::unit_test::suite& suite,
62  : AppBundle()
63 {
64  using namespace beast::severities;
65  // Use kFatal threshold to reduce noise from STObject.
66  setDebugLogSink (std::make_unique<SuiteJournalSink>(
67  "Debug", kFatal, suite));
68  auto timeKeeper_ =
69  std::make_unique<ManualTimeKeeper>();
70  timeKeeper = timeKeeper_.get();
71  // Hack so we don't have to call Config::setup
73  owned = make_Application(std::move(config),
74  std::move(logs), std::move(timeKeeper_));
75  app = owned.get();
77  if(! app->setup())
78  Throw<std::runtime_error> ("Env::AppBundle: setup failed");
79  timeKeeper->set(
80  app->getLedgerMaster().getClosedLedger()->info().closeTime);
81  app->doStart(false /*don't start timers*/);
83  [&](){ app->run(); });
84 
86 }
87 
89 {
90  client.reset();
91  // Make sure all jobs finish, otherwise tests
92  // might not get the coverage they expect.
93  if (app)
94  {
96  app->signalStop();
97  }
98  if (thread.joinable())
99  thread.join();
100 
101  // Remove the debugLogSink before the suite goes out of scope.
102  setDebugLogSink (nullptr);
103 }
104 
105 //------------------------------------------------------------------------------
106 
109 {
110  return app().getLedgerMaster().getClosedLedger();
111 }
112 
113 void
115  boost::optional<std::chrono::milliseconds> consensusDelay)
116 {
117  // Round up to next distinguishable value
118  using namespace std::chrono_literals;
119  closeTime += closed()->info().closeTimeResolution - 1s;
120  timeKeeper().set(closeTime);
121  // Go through the rpc interface unless we need to simulate
122  // a specific consensus delay.
123  if (consensusDelay)
124  app().getOPs().acceptLedger(consensusDelay);
125  else
126  {
127  rpc("ledger_accept");
128  // VFALCO No error check?
129  }
130  timeKeeper().set(
131  closed()->info().closeTime);
132 }
133 
134 void
135 Env::memoize (Account const& account)
136 {
137  map_.emplace(account.id(), account);
138 }
139 
140 Account const&
141 Env::lookup (AccountID const& id) const
142 {
143  auto const iter = map_.find(id);
144  if (iter == map_.end())
145  Throw<std::runtime_error> (
146  "Env::lookup:: unknown account ID");
147  return iter->second;
148 }
149 
150 Account const&
151 Env::lookup (std::string const& base58ID) const
152 {
153  auto const account =
154  parseBase58<AccountID>(base58ID);
155  if (! account)
156  Throw<std::runtime_error>(
157  "Env::lookup: invalid account ID");
158  return lookup(*account);
159 }
160 
162 Env::balance (Account const& account) const
163 {
164  auto const sle = le(account);
165  if (! sle)
166  return XRP(0);
167  return {
168  sle->getFieldAmount(sfBalance),
169  "" };
170 }
171 
173 Env::balance (Account const& account,
174  Issue const& issue) const
175 {
176  if (isXRP(issue.currency))
177  return balance(account);
178  auto const sle = le(keylet::line(
179  account.id(), issue));
180  if (! sle)
181  return { STAmount( issue, 0 ),
182  account.name() };
183  auto amount = sle->getFieldAmount(sfBalance);
184  amount.setIssuer(issue.account);
185  if (account.id() > issue.account)
186  amount.negate();
187  return { amount,
188  lookup(issue.account).name() };
189 }
190 
192 Env::seq (Account const& account) const
193 {
194  auto const sle = le(account);
195  if (! sle)
196  Throw<std::runtime_error> (
197  "missing account root");
198  return sle->getFieldU32(sfSequence);
199 }
200 
202 Env::le (Account const& account) const
203 {
204  return le(keylet::account(account.id()));
205 }
206 
208 Env::le (Keylet const& k) const
209 {
210  return current()->read(k);
211 }
212 
213 void
214 Env::fund (bool setDefaultRipple,
215  STAmount const& amount,
216  Account const& account)
217 {
218  memoize(account);
219  if (setDefaultRipple)
220  {
221  // VFALCO NOTE Is the fee formula correct?
222  apply(pay(master, account, amount +
223  drops(current()->fees().base)),
226  sig(jtx::autofill));
227  apply(fset(account, asfDefaultRipple),
230  sig(jtx::autofill));
231  require(flags(account, asfDefaultRipple));
232  }
233  else
234  {
235  apply(pay(master, account, amount),
238  sig(jtx::autofill));
239  require(nflags(account, asfDefaultRipple));
240  }
241  require(jtx::balance(account, amount));
242 }
243 
244 void
245 Env::trust (STAmount const& amount,
246  Account const& account)
247 {
248  auto const start = balance(account);
249  apply(jtx::trust(account, amount),
252  sig(jtx::autofill));
253  apply(pay(master, account,
254  drops(current()->fees().base)),
257  sig(jtx::autofill));
258  test.expect(balance(account) == start);
259 }
260 
263 {
264  TER ter;
265  if (jr.isObject() && jr.isMember(jss::result) &&
266  jr[jss::result].isMember(jss::engine_result_code))
267  ter = TER::fromInt (jr[jss::result][jss::engine_result_code].asInt());
268  else
269  ter = temINVALID;
270  return std::make_pair(ter,
272 }
273 
274 void
276 {
277  bool didApply;
278  if (jt.stx)
279  {
280  txid_ = jt.stx->getTransactionID();
281  Serializer s;
282  jt.stx->add(s);
283  auto const jr = rpc("submit", strHex(s.slice()));
284 
285  std::tie(ter_, didApply) = parseResult(jr);
286  }
287  else
288  {
289  // Parsing failed or the JTx is
290  // otherwise missing the stx field.
291  ter_ = temMALFORMED;
292  didApply = false;
293  }
294  return postconditions(jt, ter_, didApply);
295 }
296 
297 void
299 {
300  bool didApply;
301 
302  auto const account =
303  lookup(jt.jv[jss::Account].asString());
304  auto const& passphrase = account.name();
305 
306  Json::Value jr;
307  if (params.isNull())
308  {
309  // Use the command line interface
310  auto const jv = boost::lexical_cast<std::string>(jt.jv);
311  jr = rpc("submit", passphrase, jv);
312  }
313  else
314  {
315  // Use the provided parameters, and go straight
316  // to the (RPC) client.
317  assert(params.isObject());
318  if (!params.isMember(jss::secret) &&
319  !params.isMember(jss::key_type) &&
320  !params.isMember(jss::seed) &&
321  !params.isMember(jss::seed_hex) &&
322  !params.isMember(jss::passphrase))
323  {
324  params[jss::secret] = passphrase;
325  }
326  params[jss::tx_json] = jt.jv;
327  jr = client().invoke("submit", params);
328  }
329  txid_.SetHex(
330  jr[jss::result][jss::tx_json][jss::hash].asString());
331 
332  std::tie(ter_, didApply) = parseResult(jr);
333 
334  return postconditions(jt, ter_, didApply);
335 }
336 
337 void
338 Env::postconditions(JTx const& jt, TER ter, bool didApply)
339 {
340  if (jt.ter && ! test.expect(ter == *jt.ter,
341  "apply: " + transToken(ter) +
342  " (" + transHuman(ter) + ") != " +
343  transToken(*jt.ter) + " (" +
344  transHuman(*jt.ter) + ")"))
345  {
346  test.log << pretty(jt.jv) << std::endl;
347  // Don't check postconditions if
348  // we didn't get the expected result.
349  return;
350  }
351  if (trace_)
352  {
353  if (trace_ > 0)
354  --trace_;
355  test.log << pretty(jt.jv) << std::endl;
356  }
357  for (auto const& f : jt.requires)
358  f(*this);
359 }
360 
363 {
364  close();
365  auto const item = closed()->txRead(txid_);
366  return item.second;
367 }
368 
370 Env::tx() const
371 {
372  return current()->txRead(txid_).first;
373 }
374 
375 void
377 {
378  auto& jv = jt.jv;
379  if (jt.signer)
380  return jt.signer(*this, jt);
381  if (! jt.fill_sig)
382  return;
383  auto const account =
384  lookup(jv[jss::Account].asString());
385  if (!app().checkSigs())
386  {
387  jv[jss::SigningPubKey] =
388  strHex(account.pk().slice());
389  // dummy sig otherwise STTx is invalid
390  jv[jss::TxnSignature] = "00";
391  return;
392  }
393  auto const ar = le(account);
394  if (ar && ar->isFieldPresent(sfRegularKey))
395  jtx::sign(jv, lookup(
396  ar->getAccountID(sfRegularKey)));
397  else
398  jtx::sign(jv, account);
399 }
400 
401 void
403 {
404  auto& jv = jt.jv;
405  if(jt.fill_fee)
406  jtx::fill_fee(jv, *current());
407  if(jt.fill_seq)
408  jtx::fill_seq(jv, *current());
409  // Must come last
410  try
411  {
412  autofill_sig(jt);
413  }
414  catch (parse_error const&)
415  {
416  test.log << "parse failed:\n" <<
417  pretty(jv) << std::endl;
418  Rethrow();
419  }
420 }
421 
423 Env::st (JTx const& jt)
424 {
425  // The parse must succeed, since we
426  // generated the JSON ourselves.
427  boost::optional<STObject> obj;
428  try
429  {
430  obj = jtx::parse(jt.jv);
431  }
432  catch(jtx::parse_error const&)
433  {
434  test.log << "Exception: parse_error\n" <<
435  pretty(jt.jv) << std::endl;
436  Rethrow();
437  }
438 
439  try
440  {
441  return sterilize(STTx{std::move(*obj)});
442  }
443  catch(std::exception const&)
444  {
445  }
446  return nullptr;
447 }
448 
452 {
453  return rpcClient(args, app().config(), app().logs(), headers).second;
454 }
455 
456 void
458 {
459  // Env::close() must be called for feature
460  // enable to take place.
461  app().config().features.insert(feature);
462 }
463 
464 } // jtx
465 
466 } // test
467 } // ripple
ripple::test::jtx::Env::AppBundle::app
Application * app
Definition: Env.h:127
ripple::test::jtx::Account::name
std::string const & name() const
Return the name.
Definition: Account.h:73
ripple::test::jtx::Env::autofill_sig
void autofill_sig(JTx &jt)
Definition: Env.cpp:376
ripple::sfRegularKey
const SF_Account sfRegularKey(access, STI_ACCOUNT, 8, "RegularKey")
Definition: SField.h:467
ripple::test::jtx::XRP
const XRP_t XRP
Converts to XRP Issue or STAmount.
Definition: amount.cpp:109
ripple::test::jtx::parse_error
Thrown when parse fails.
Definition: utility.h:34
ripple::Keylet
A pair of SHAMap key and LedgerEntryType.
Definition: Keylet.h:38
ripple::Issue
A currency issued by an account.
Definition: Issue.h:34
Json::Value::isObject
bool isObject() const
Definition: json_value.cpp:1069
std::string
STL class.
std::shared_ptr
STL class.
std::exception
STL class.
ripple::test::jtx::Env::ter_
TER ter_
Definition: Env.h:641
ripple::test::jtx::drops
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
Definition: amount.h:261
ripple::test::jtx::Env::AppBundle::client
std::unique_ptr< AbstractClient > client
Definition: Env.h:131
ripple::test::jtx::Env::tx
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition: Env.cpp:370
ripple::test::jtx::ter
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:33
ripple::isTesSuccess
bool isTesSuccess(TER x)
Definition: TER.h:501
ripple::test::jtx::Env::require
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:461
ripple::test::jtx::Env::apply
void apply(JsonValue &&jv, FN const &... fN)
Apply funclets and submit.
Definition: Env.h:495
ripple::test::jtx::Env::closed
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition: Env.cpp:108
std::pair
ripple::test::jtx::Env::close
void close()
Close and advance the ledger.
Definition: Env.h:352
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:457
ripple::test::jtx::Env::AppBundle::timeKeeper
ManualTimeKeeper * timeKeeper
Definition: Env.h:129
ripple::sfSequence
const SF_U32 sfSequence(access, STI_UINT32, 4, "Sequence")
Definition: SField.h:340
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:640
ripple::test::jtx::Env::AppBundle::~AppBundle
~AppBundle()
Definition: Env.cpp:88
ripple::test::jtx::JTx::stx
std::shared_ptr< STTx const > stx
Definition: JTx.h:49
ripple::asfDefaultRipple
const std::uint32_t asfDefaultRipple
Definition: TxFlags.h:72
ripple::test::jtx::Env::jt
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition: Env.h:431
ripple::test::jtx::fill_seq
void fill_seq(Json::Value &jv, ReadView const &view)
Set the sequence number automatically.
Definition: utility.cpp:70
ripple::Issue::currency
Currency currency
Definition: Issue.h:37
ripple::transToken
std::string transToken(TER code)
Definition: TER.cpp:183
ripple::test::makeJSONRPCClient
std::unique_ptr< AbstractClient > makeJSONRPCClient(Config const &cfg, unsigned rpc_version)
Returns a client using JSON-RPC over HTTP/S.
Definition: JSONRPCClient.cpp:155
beast::severities
A namespace for easy access to logging severity values.
Definition: Journal.h:29
ripple::test::jtx::Env::sign_and_submit
void sign_and_submit(JTx const &jt, Json::Value params=Json::nullValue)
Use the submit RPC command with a provided JTx object.
Definition: Env.cpp:298
ripple::test::jtx::Env::AppBundle::thread
std::thread thread
Definition: Env.h:130
ripple::test::jtx::Env::balance
PrettyAmount balance(Account const &account) const
Returns the XRP balance on an account.
Definition: Env.cpp:162
Json::Value::isNull
bool isNull() const
isNull() tests to see if this field is null.
Definition: json_value.cpp:998
ripple::test::jtx::sign
void sign(Json::Value &jv, Account const &account)
Sign automatically.
Definition: utility.cpp:45
ripple::test::jtx::Env::ter
TER ter() const
Return the TER for the last JTx.
Definition: Env.h:513
ripple::isTecClaim
bool isTecClaim(TER x)
Definition: TER.h:506
ripple::test::jtx::Env::trust
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:245
ripple::debugLog
beast::Journal debugLog()
Returns a debug journal.
Definition: Log.cpp:417
ripple::Application::getOPs
virtual NetworkOPs & getOPs()=0
ripple::test::jtx::autofill
static const autofill_t autofill
Definition: tags.h:32
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:423
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:262
std::tie
T tie(T... args)
ripple::base_uint< 160, detail::AccountIDTag >
std::thread::joinable
T joinable(T... args)
ripple::test::jtx::Env::meta
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Definition: Env.cpp:362
ripple::keylet::line
static const line_t line
Definition: Indexes.h:176
std::thread
STL class.
ripple::Application::getLedgerMaster
virtual LedgerMaster & getLedgerMaster()=0
ripple::keylet::account
static const account_t account
Definition: Indexes.h:116
ripple::Rethrow
void Rethrow()
Rethrow the exception currently being handled.
Definition: contract.h:50
ripple::test::jtx::Env::postconditions
void postconditions(JTx const &jt, TER ter, bool didApply)
Check expected postconditions of JTx submission.
Definition: Env.cpp:338
ripple::Application::config
virtual Config & config()=0
ripple::TERSubset< CanCvtToTER >
ripple::test::jtx::JTx
Execution context for applying a JSON transaction.
Definition: JTx.h:41
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:410
ripple::test::jtx::JTx::jv
Json::Value jv
Definition: JTx.h:43
ripple::test::jtx::fill_fee
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition: utility.cpp:60
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
ripple::Application::getJobQueue
virtual JobQueue & getJobQueue()=0
ripple::test::jtx::Env::submit
virtual void submit(JTx const &jt)
Submit an existing JTx.
Definition: Env.cpp:275
ripple::STAmount
Definition: STAmount.h:42
ripple::base_uint::SetHex
bool SetHex(const char *psz, bool bStrict=false)
Parse a hex string into a base_uint The input can be:
Definition: base_uint.h:362
ripple::Serializer::slice
Slice slice() const noexcept
Definition: Serializer.h:67
std::chrono::time_point
ripple::Application::logs
virtual Logs & logs()=0
ripple::test::jtx::JTx::ter
boost::optional< TER > ter
Definition: JTx.h:45
ripple::Application::doStart
virtual void doStart(bool withTimers)=0
ripple::STTx
Definition: STTx.h:43
ripple::test::jtx::Env::lookup
Account const & lookup(AccountID const &id) const
Returns the Account given the AccountID.
Definition: Env.cpp:141
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:121
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:961
std::uint32_t
ripple::test::jtx::sig
Set the regular signature on a JTx.
Definition: sig.h:33
ripple::test::jtx::Env::seq
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition: Env.cpp:192
ripple::test::jtx::Env::test
beast::unit_test::suite & test
Definition: Env.h:120
ripple::test::jtx::JTx::signer
std::function< void(Env &, JTx &)> signer
Definition: JTx.h:50
ripple::JobQueue::rendezvous
void rendezvous()
Block until no tasks running.
Definition: JobQueue.cpp:277
memory
ripple::transHuman
std::string transHuman(TER code)
Definition: TER.cpp:191
ripple::test::jtx::fee
Set the fee on a JTx.
Definition: fee.h:34
ripple::Serializer
Definition: Serializer.h:43
beast::severities::kError
@ kError
Definition: Journal.h:40
ripple::test::jtx::seq
Set the sequence number on a JTx.
Definition: seq.h:32
ripple::LedgerMaster::getClosedLedger
std::shared_ptr< Ledger const > getClosedLedger()
Definition: LedgerMaster.h:89
ripple::Logs::threshold
beast::severities::Severity threshold() const
Definition: Log.cpp:146
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::sterilize
std::shared_ptr< STTx const > sterilize(STTx const &stx)
Sterilize a transaction.
Definition: STTx.cpp:516
ripple::Config::features
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:183
ripple::test::jtx::flags
Match set account flags.
Definition: flags.h:99
std::endl
T endl(T... args)
ripple::test::jtx::Env::autofill
virtual void autofill(JTx &jt)
Definition: Env.cpp:402
ripple::sfBalance
const SF_Amount sfBalance(access, STI_AMOUNT, 2, "Balance")
Definition: SField.h:424
ripple::test::jtx::Env::do_rpc
Json::Value do_rpc(std::vector< std::string > const &args, std::unordered_map< std::string, std::string > const &headers={})
Definition: Env.cpp:450
ripple::test::jtx::pay
Json::Value pay(Account const &account, Account const &to, AnyAmount amount)
Create a payment.
Definition: pay.cpp:29
ripple::test::jtx::JTx::fill_seq
bool fill_seq
Definition: JTx.h:47
ripple::test::jtx::JTx::fill_sig
bool fill_sig
Definition: JTx.h:48
ripple::test::jtx::JTx::requires
requires_t requires
Definition: JTx.h:44
ripple::TERSubset< CanCvtToTER >::fromInt
static constexpr TERSubset fromInt(int from)
Definition: TER.h:323
ripple::test::jtx::Env::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:214
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:202
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:1433
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::test::jtx::Env::map_
std::unordered_map< AccountID, Account > map_
Definition: Env.h:683
ripple::test::jtx::nflags
Match clear account flags.
Definition: flags.h:118
ripple::Application::signalStop
virtual void signalStop()=0
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:70
ripple::NetworkOPs::acceptLedger
virtual std::uint32_t acceptLedger(boost::optional< std::chrono::milliseconds > consensusDelay=boost::none)=0
Accepts the current transaction tree, return the new ledger's sequence.
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:85
beast::severities::kFatal
@ kFatal
Definition: Journal.h:41
ripple::test::ManualTimeKeeper::set
void set(time_point now)
Definition: ManualTimeKeeper.cpp:86
ripple::test::jtx::parse
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition: utility.cpp:35
ripple::test::jtx::Env::memoize
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:135
std::unique_ptr
STL class.
ripple::test::jtx::JTx::fill_fee
bool fill_fee
Definition: JTx.h:46
std::unordered_map
STL class.
ripple::Application::setup
virtual bool setup()=0
ripple::HTTPClient::initializeSSLContext
static void initializeSSLContext(Config const &config, beast::Journal j)
Definition: HTTPClient.cpp:37
ripple::test::jtx::Env::current
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition: Env.h:296
ripple::make_Application
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
Definition: Application.cpp:2250
ripple::test::jtx::Env::AppBundle
Definition: Env.h:125
ripple::Application::run
virtual void run()=0
ripple::Issue::account
AccountID account
Definition: Issue.h:38
ripple::temINVALID
@ temINVALID
Definition: TER.h:108
std::thread::join
T join(T... args)
ripple::test::jtx::Env::rpc
Json::Value rpc(std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition: Env.h:688
Json::Value
Represents a JSON value.
Definition: json_value.h:141
ripple::test::jtx::PrettyAmount
Represents an XRP or IOU quantity This customizes the string conversion and supports XRP conversions ...
Definition: amount.h:73
ripple::test::jtx::Env::trace_
int trace_
Definition: Env.h:638
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:482