rippled
AccountSet_test.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2016 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 <ripple/basics/StringUtilities.h>
21 #include <ripple/protocol/AmountConversions.h>
22 #include <ripple/protocol/Feature.h>
23 #include <ripple/protocol/Quality.h>
24 #include <ripple/protocol/Rate.h>
25 #include <ripple/protocol/jss.h>
26 #include <test/jtx.h>
27 
28 namespace ripple {
29 
30 class AccountSet_test : public beast::unit_test::suite
31 {
32 public:
33  void
35  {
36  testcase("No AccountSet");
37 
38  using namespace test::jtx;
39  Env env(*this);
40  Account const alice("alice");
41  env.fund(XRP(10000), noripple(alice));
42  // ask for the ledger entry - account root, to check its flags
43  auto const jrr = env.le(alice);
44  BEAST_EXPECT((*env.le(alice))[sfFlags] == 0u);
45  }
46 
47  void
49  {
50  testcase("Most Flags");
51 
52  using namespace test::jtx;
53  Account const alice("alice");
54 
55  // Test without DepositAuth enabled initially.
56  Env env(*this, supported_amendments() - featureDepositAuth);
57  env.fund(XRP(10000), noripple(alice));
58 
59  // Give alice a regular key so she can legally set and clear
60  // her asfDisableMaster flag.
61  Account const alie{"alie", KeyType::secp256k1};
62  env(regkey(alice, alie));
63  env.close();
64 
65  auto testFlags = [this, &alice, &alie, &env](
67  std::uint32_t const orig_flags = (*env.le(alice))[sfFlags];
68  for (std::uint32_t flag{1u};
69  flag < std::numeric_limits<std::uint32_t>::digits;
70  ++flag)
71  {
72  if (flag == asfNoFreeze)
73  {
74  // The asfNoFreeze flag can't be cleared. It is tested
75  // elsewhere.
76  continue;
77  }
78 
79  if (flag == asfAuthorizedNFTokenMinter)
80  {
81  // The asfAuthorizedNFTokenMinter flag requires the
82  // presence or absence of the sfNFTokenMinter field in
83  // the transaction. It is tested elsewhere.
84  continue;
85  }
86 
87  if (flag == asfDisallowIncomingCheck ||
91  {
92  // These flags are part of the DisallowIncoming amendment
93  // and are tested elsewhere
94  continue;
95  }
96 
97  if (std::find(goodFlags.begin(), goodFlags.end(), flag) !=
98  goodFlags.end())
99  {
100  // Good flag
101  env.require(nflags(alice, flag));
102  env(fset(alice, flag), sig(alice));
103  env.close();
104  env.require(flags(alice, flag));
105  env(fclear(alice, flag), sig(alie));
106  env.close();
107  env.require(nflags(alice, flag));
108  std::uint32_t const now_flags = (*env.le(alice))[sfFlags];
109  BEAST_EXPECT(now_flags == orig_flags);
110  }
111  else
112  {
113  // Bad flag
114  BEAST_EXPECT((*env.le(alice))[sfFlags] == orig_flags);
115  env(fset(alice, flag), sig(alice));
116  env.close();
117  BEAST_EXPECT((*env.le(alice))[sfFlags] == orig_flags);
118  env(fclear(alice, flag), sig(alie));
119  env.close();
120  BEAST_EXPECT((*env.le(alice))[sfFlags] == orig_flags);
121  }
122  }
123  };
124 
125  // Test with featureDepositAuth disabled.
126  testFlags(
133 
134  // Enable featureDepositAuth and retest.
135  env.enableFeature(featureDepositAuth);
136  env.close();
137  testFlags(
144  asfDepositAuth});
145  }
146 
147  void
149  {
150  testcase("Set and reset AccountTxnID");
151 
152  using namespace test::jtx;
153  Env env(*this);
154  Account const alice("alice");
155  env.fund(XRP(10000), noripple(alice));
156 
157  std::uint32_t const orig_flags = (*env.le(alice))[sfFlags];
158 
159  // asfAccountTxnID is special and not actually set as a flag,
160  // so we check the field presence instead
161  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfAccountTxnID));
162  env(fset(alice, asfAccountTxnID), sig(alice));
163  BEAST_EXPECT(env.le(alice)->isFieldPresent(sfAccountTxnID));
164  env(fclear(alice, asfAccountTxnID));
165  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfAccountTxnID));
166  std::uint32_t const now_flags = (*env.le(alice))[sfFlags];
167  BEAST_EXPECT(now_flags == orig_flags);
168  }
169 
170  void
172  {
173  testcase("Set NoFreeze");
174 
175  using namespace test::jtx;
176  Env env(*this);
177  Account const alice("alice");
178  env.fund(XRP(10000), noripple(alice));
179  env.memoize("eric");
180  env(regkey(alice, "eric"));
181 
182  env.require(nflags(alice, asfNoFreeze));
183  env(fset(alice, asfNoFreeze), sig("eric"), ter(tecNEED_MASTER_KEY));
184  env(fset(alice, asfNoFreeze), sig(alice));
185  env.require(flags(alice, asfNoFreeze));
186  env(fclear(alice, asfNoFreeze), sig(alice));
187  // verify flag is still set (clear does not clear in this case)
188  env.require(flags(alice, asfNoFreeze));
189  }
190 
191  void
193  {
194  testcase("Domain");
195 
196  using namespace test::jtx;
197  Env env(*this);
198  Account const alice("alice");
199  env.fund(XRP(10000), alice);
200  auto jt = noop(alice);
201  // The Domain field is represented as the hex string of the lowercase
202  // ASCII of the domain. For example, the domain example.com would be
203  // represented as "6578616d706c652e636f6d".
204  //
205  // To remove the Domain field from an account, send an AccountSet with
206  // the Domain set to an empty string.
207  std::string const domain = "example.com";
208  jt[sfDomain.fieldName] = strHex(domain);
209  env(jt);
210  BEAST_EXPECT((*env.le(alice))[sfDomain] == makeSlice(domain));
211 
212  jt[sfDomain.fieldName] = "";
213  env(jt);
214  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfDomain));
215 
216  // The upper limit on the length is 256 bytes
217  // (defined as DOMAIN_BYTES_MAX in SetAccount)
218  // test the edge cases: 255, 256, 257.
219  std::size_t const maxLength = 256;
220  for (std::size_t len = maxLength - 1; len <= maxLength + 1; ++len)
221  {
222  std::string domain2 =
223  std::string(len - domain.length() - 1, 'a') + "." + domain;
224 
225  BEAST_EXPECT(domain2.length() == len);
226 
227  jt[sfDomain.fieldName] = strHex(domain2);
228 
229  if (len <= maxLength)
230  {
231  env(jt);
232  BEAST_EXPECT((*env.le(alice))[sfDomain] == makeSlice(domain2));
233  }
234  else
235  {
236  env(jt, ter(telBAD_DOMAIN));
237  }
238  }
239  }
240 
241  void
243  {
244  testcase("MessageKey");
245 
246  using namespace test::jtx;
247  Env env(*this);
248  Account const alice("alice");
249  env.fund(XRP(10000), alice);
250  auto jt = noop(alice);
251 
252  auto const rkp = randomKeyPair(KeyType::ed25519);
253  jt[sfMessageKey.fieldName] = strHex(rkp.first.slice());
254  env(jt);
255  BEAST_EXPECT(
256  strHex((*env.le(alice))[sfMessageKey]) ==
257  strHex(rkp.first.slice()));
258 
259  jt[sfMessageKey.fieldName] = "";
260  env(jt);
261  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfMessageKey));
262 
263  using namespace std::string_literals;
264  jt[sfMessageKey.fieldName] = strHex("NOT_REALLY_A_PUBKEY"s);
265  env(jt, ter(telBAD_PUBLIC_KEY));
266  }
267 
268  void
270  {
271  testcase("WalletID");
272 
273  using namespace test::jtx;
274  Env env(*this);
275  Account const alice("alice");
276  env.fund(XRP(10000), alice);
277  auto jt = noop(alice);
278 
279  std::string const locator =
280  "9633EC8AF54F16B5286DB1D7B519EF49EEFC050C0C8AC4384F1D88ACD1BFDF05";
281  jt[sfWalletLocator.fieldName] = locator;
282  env(jt);
283  BEAST_EXPECT(to_string((*env.le(alice))[sfWalletLocator]) == locator);
284 
285  jt[sfWalletLocator.fieldName] = "";
286  env(jt);
287  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfWalletLocator));
288  }
289 
290  void
292  {
293  testcase("EmailHash");
294 
295  using namespace test::jtx;
296  Env env(*this);
297  Account const alice("alice");
298  env.fund(XRP(10000), alice);
299  auto jt = noop(alice);
300 
301  std::string const mh("5F31A79367DC3137FADA860C05742EE6");
302  jt[sfEmailHash.fieldName] = mh;
303  env(jt);
304  BEAST_EXPECT(to_string((*env.le(alice))[sfEmailHash]) == mh);
305 
306  jt[sfEmailHash.fieldName] = "";
307  env(jt);
308  BEAST_EXPECT(!env.le(alice)->isFieldPresent(sfEmailHash));
309  }
310 
311  void
313  {
314  struct test_results
315  {
316  double set;
317  TER code;
318  double get;
319  };
320 
321  testcase("TransferRate");
322 
323  using namespace test::jtx;
324  auto doTests = [this](
325  FeatureBitset const& features,
327  Env env(*this, features);
328 
329  Account const alice("alice");
330  env.fund(XRP(10000), alice);
331 
332  for (auto const& r : testData)
333  {
334  env(rate(alice, r.set), ter(r.code));
335  env.close();
336 
337  // If the field is not present expect the default value
338  if (!(*env.le(alice))[~sfTransferRate])
339  BEAST_EXPECT(r.get == 1.0);
340  else
341  BEAST_EXPECT(
342  *(*env.le(alice))[~sfTransferRate] ==
343  r.get * QUALITY_ONE);
344  }
345  };
346 
347  doTests(
348  supported_amendments(),
349  {{1.0, tesSUCCESS, 1.0},
350  {1.1, tesSUCCESS, 1.1},
351  {2.0, tesSUCCESS, 2.0},
352  {2.1, temBAD_TRANSFER_RATE, 2.0},
353  {0.0, tesSUCCESS, 1.0},
354  {2.0, tesSUCCESS, 2.0},
355  {0.9, temBAD_TRANSFER_RATE, 2.0}});
356  }
357 
358  void
360  {
361  testcase("Gateway");
362 
363  using namespace test::jtx;
364 
365  Account const alice("alice");
366  Account const bob("bob");
367  Account const gw("gateway");
368  auto const USD = gw["USD"];
369 
370  // Test gateway with a variety of allowed transfer rates
371  for (double transferRate = 1.0; transferRate <= 2.0;
372  transferRate += 0.03125)
373  {
374  Env env(*this);
375  env.fund(XRP(10000), gw, alice, bob);
376  env.close();
377  env.trust(USD(10), alice, bob);
378  env.close();
379  env(rate(gw, transferRate));
380  env.close();
381 
382  auto const amount = USD(1);
383  Rate const rate(transferRate * QUALITY_ONE);
384  auto const amountWithRate =
385  toAmount<STAmount>(multiply(amount.value(), rate));
386 
387  env(pay(gw, alice, USD(10)));
388  env.close();
389  env(pay(alice, bob, USD(1)), sendmax(USD(10)));
390  env.close();
391 
392  env.require(balance(alice, USD(10) - amountWithRate));
393  env.require(balance(bob, USD(1)));
394  }
395 
396  // Since fix1201 was enabled on Nov 14 2017 a rate in excess of
397  // 2.0 has been blocked by the transactor. But there are a few
398  // accounts on the MainNet that have larger-than-currently-allowed
399  // TransferRates. We'll bypass the transactor so we can check
400  // operation of these legacy TransferRates.
401  //
402  // Two out-of-bound values are currently in the ledger (March 2020)
403  // They are 4.0 and 4.294967295. So those are the values we test.
404  for (double transferRate : {4.0, 4.294967295})
405  {
406  Env env(*this);
407  env.fund(XRP(10000), gw, alice, bob);
408  env.close();
409  env.trust(USD(10), alice, bob);
410  env.close();
411 
412  // We'd like to use transferRate here, but the transactor
413  // blocks transfer rates that large. So we use an acceptable
414  // transfer rate here and later hack the ledger to replace
415  // the acceptable value with an out-of-bounds value.
416  env(rate(gw, 2.0));
417  env.close();
418 
419  // Because we're hacking the ledger we need the account to have
420  // non-zero sfMintedNFTokens and sfBurnedNFTokens fields. This
421  // prevents an exception when the AccountRoot template is applied.
422  {
423  uint256 const nftId0{token::getNextID(env, gw, 0u)};
424  env(token::mint(gw, 0u));
425  env.close();
426 
427  env(token::burn(gw, nftId0));
428  env.close();
429  }
430 
431  // Note that we're bypassing almost all of the ledger's safety
432  // checks with this modify() call. If you call close() between
433  // here and the end of the test all the effort will be lost.
434  env.app().openLedger().modify(
435  [&gw, transferRate](OpenView& view, beast::Journal j) {
436  // Get the account root we want to hijack.
437  auto const sle = view.read(keylet::account(gw.id()));
438  if (!sle)
439  return false; // This would be really surprising!
440 
441  // We'll insert a replacement for the account root
442  // with the higher (currently invalid) transfer rate.
443  auto replacement = std::make_shared<SLE>(*sle, sle->key());
444  (*replacement)[sfTransferRate] =
445  static_cast<std::uint32_t>(transferRate * QUALITY_ONE);
446  view.rawReplace(replacement);
447  return true;
448  });
449 
450  auto const amount = USD(1);
451  auto const amountWithRate = toAmount<STAmount>(
452  multiply(amount.value(), Rate(transferRate * QUALITY_ONE)));
453 
454  env(pay(gw, alice, USD(10)));
455  env(pay(alice, bob, amount), sendmax(USD(10)));
456 
457  env.require(balance(alice, USD(10) - amountWithRate));
458  env.require(balance(bob, amount));
459  }
460  }
461 
462  void
464  {
465  testcase("Bad inputs");
466 
467  using namespace test::jtx;
468  Env env(*this);
469  Account const alice("alice");
470  env.fund(XRP(10000), alice);
471 
472  auto jt = fset(alice, asfDisallowXRP);
473  jt[jss::ClearFlag] = asfDisallowXRP;
474  env(jt, ter(temINVALID_FLAG));
475 
476  jt = fset(alice, asfRequireAuth);
477  jt[jss::ClearFlag] = asfRequireAuth;
478  env(jt, ter(temINVALID_FLAG));
479 
480  jt = fset(alice, asfRequireDest);
481  jt[jss::ClearFlag] = asfRequireDest;
482  env(jt, ter(temINVALID_FLAG));
483 
484  jt = fset(alice, asfDisallowXRP);
486  env(jt, ter(temINVALID_FLAG));
487 
488  jt = fset(alice, asfRequireAuth);
490  env(jt, ter(temINVALID_FLAG));
491 
492  jt = fset(alice, asfRequireDest);
494  env(jt, ter(temINVALID_FLAG));
495 
496  jt = fset(alice, asfRequireDest);
498  env(jt, ter(temINVALID_FLAG));
499 
500  env(fset(alice, asfDisableMaster),
501  sig(alice),
502  ter(tecNO_ALTERNATIVE_KEY));
503  }
504 
505  void
507  {
508  testcase("Require auth");
509 
510  using namespace test::jtx;
511  Env env(*this);
512  Account const alice("alice");
513  Account const bob("bob");
514 
515  env.fund(XRP(10000), alice);
516  env.close();
517 
518  // alice should have an empty directory.
519  BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
520 
521  // Give alice a signer list, then there will be stuff in the directory.
522  env(signers(alice, 1, {{bob, 1}}));
523  env.close();
524  BEAST_EXPECT(!dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
525 
526  env(fset(alice, asfRequireAuth), ter(tecOWNERS));
527 
528  // Remove the signer list. After that asfRequireAuth should succeed.
529  env(signers(alice, test::jtx::none));
530  env.close();
531  BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
532 
533  env(fset(alice, asfRequireAuth));
534  }
535 
536  void
538  {
539  using namespace test::jtx;
540  Env env(*this);
541  Account const alice("alice");
542 
543  env.fund(XRP(10000), alice);
544  env.close();
545 
546  std::uint32_t const ticketSeq{env.seq(alice) + 1};
547  env(ticket::create(alice, 1));
548  env.close();
549  env.require(owners(alice, 1), tickets(alice, 1));
550 
551  // Try using a ticket that alice doesn't have.
552  env(noop(alice), ticket::use(ticketSeq + 1), ter(terPRE_TICKET));
553  env.close();
554  env.require(owners(alice, 1), tickets(alice, 1));
555 
556  // Actually use alice's ticket. Note that if a transaction consumes
557  // a ticket then the account's sequence number does not advance.
558  std::uint32_t const aliceSeq{env.seq(alice)};
559  env(noop(alice), ticket::use(ticketSeq));
560  env.close();
561  env.require(owners(alice, 0), tickets(alice, 0));
562  BEAST_EXPECT(aliceSeq == env.seq(alice));
563 
564  // Try re-using a ticket that alice already used.
565  env(noop(alice), ticket::use(ticketSeq), ter(tefNO_TICKET));
566  env.close();
567  }
568 
569  void
570  run() override
571  {
573  testMostFlags();
575  testSetNoFreeze();
576  testDomain();
577  testGateway();
578  testMessageKey();
579  testWalletID();
580  testEmailHash();
581  testBadInputs();
584  testTicket();
585  }
586 };
587 
588 BEAST_DEFINE_TESTSUITE_PRIO(AccountSet, app, ripple, 1);
589 
590 } // namespace ripple
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:303
ripple::tefNO_TICKET
@ tefNO_TICKET
Definition: TER.h:167
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:471
ripple::terPRE_TICKET
@ terPRE_TICKET
Definition: TER.h:207
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:241
ripple::AccountSet_test::testTicket
void testTicket()
Definition: AccountSet_test.cpp:537
ripple::asfDisallowXRP
constexpr std::uint32_t asfDisallowXRP
Definition: TxFlags.h:76
ripple::asfDepositAuth
constexpr std::uint32_t asfDepositAuth
Definition: TxFlags.h:82
std::string
STL class.
ripple::test::jtx::none
static const none_t none
Definition: tags.h:34
ripple::Rate
Represents a transfer rate.
Definition: Rate.h:37
ripple::tecOWNERS
@ tecOWNERS
Definition: TER.h:265
ripple::AccountSet_test::testNullAccountSet
void testNullAccountSet()
Definition: AccountSet_test.cpp:34
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
ripple::asfNoFreeze
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
std::find
T find(T... args)
std::string::length
T length(T... args)
ripple::SField::fieldName
const std::string fieldName
Definition: SField.h:132
ripple::telBAD_DOMAIN
@ telBAD_DOMAIN
Definition: TER.h:52
ripple::featureDepositAuth
const uint256 featureDepositAuth
ripple::tfAllowXRP
constexpr std::uint32_t tfAllowXRP
Definition: TxFlags.h:68
ripple::asfDisallowIncomingPayChan
constexpr std::uint32_t asfDisallowIncomingPayChan
Definition: TxFlags.h:89
ripple::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(NFToken, tx, ripple, 2)
ripple::temBAD_TRANSFER_RATE
@ temBAD_TRANSFER_RATE
Definition: TER.h:105
ripple::AccountSet_test::testGateway
void testGateway()
Definition: AccountSet_test.cpp:359
ripple::asfDisallowIncomingTrustline
constexpr std::uint32_t asfDisallowIncomingTrustline
Definition: TxFlags.h:90
ripple::tfAccountSetMask
constexpr std::uint32_t tfAccountSetMask
Definition: TxFlags.h:69
ripple::asfDisallowIncomingCheck
constexpr std::uint32_t asfDisallowIncomingCheck
Definition: TxFlags.h:88
ripple::KeyType::ed25519
@ ed25519
ripple::base_uint< 256 >
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:109
ripple::AccountSet_test::testRequireAuthWithDir
void testRequireAuthWithDir()
Definition: AccountSet_test.cpp:506
ripple::asfDisableMaster
constexpr std::uint32_t asfDisableMaster
Definition: TxFlags.h:77
ripple::tecNO_ALTERNATIVE_KEY
@ tecNO_ALTERNATIVE_KEY
Definition: TER.h:263
ripple::AccountSet_test::testEmailHash
void testEmailHash()
Definition: AccountSet_test.cpp:291
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
ripple::AccountSet_test::run
void run() override
Definition: AccountSet_test.cpp:570
ripple::OpenView::rawReplace
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition: OpenView.cpp:245
ripple::TERSubset< CanCvtToTER >
ripple::AccountSet_test::testTransferRate
void testTransferRate()
Definition: AccountSet_test.cpp:312
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:313
ripple::sfAccountTxnID
const SF_UINT256 sfAccountTxnID
ripple::sfTransferRate
const SF_UINT32 sfTransferRate
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint32_t
ripple::AccountSet_test::testDomain
void testDomain()
Definition: AccountSet_test.cpp:192
ripple::tecNEED_MASTER_KEY
@ tecNEED_MASTER_KEY
Definition: TER.h:275
ripple::tfOptionalAuth
constexpr std::uint32_t tfOptionalAuth
Definition: TxFlags.h:66
ripple::AccountSet_test::testMostFlags
void testMostFlags()
Definition: AccountSet_test.cpp:48
ripple::KeyType::secp256k1
@ secp256k1
ripple::multiply
STAmount multiply(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:47
ripple::sfEmailHash
const SF_UINT128 sfEmailHash
ripple::randomKeyPair
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
Definition: SecretKey.cpp:368
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:590
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::AccountSet_test::testBadInputs
void testBadInputs()
Definition: AccountSet_test.cpp:463
ripple::sfWalletLocator
const SF_UINT256 sfWalletLocator
ripple::AccountSet_test::testSetNoFreeze
void testSetNoFreeze()
Definition: AccountSet_test.cpp:171
ripple::sfFlags
const SF_UINT32 sfFlags
ripple::asfRequireAuth
constexpr std::uint32_t asfRequireAuth
Definition: TxFlags.h:75
ripple::asfDefaultRipple
constexpr std::uint32_t asfDefaultRipple
Definition: TxFlags.h:81
ripple::asfRequireDest
constexpr std::uint32_t asfRequireDest
Definition: TxFlags.h:74
ripple::FeatureBitset
Definition: Feature.h:113
ripple::telBAD_PUBLIC_KEY
@ telBAD_PUBLIC_KEY
Definition: TER.h:54
ripple::sfMessageKey
const SF_VL sfMessageKey
ripple::asfGlobalFreeze
constexpr std::uint32_t asfGlobalFreeze
Definition: TxFlags.h:80
ripple::OpenView::read
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition: OpenView.cpp:171
std::size_t
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:41
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::AccountSet_test::testMessageKey
void testMessageKey()
Definition: AccountSet_test.cpp:242
ripple::tfOptionalDestTag
constexpr std::uint32_t tfOptionalDestTag
Definition: TxFlags.h:64
ripple::sfDomain
const SF_VL sfDomain
ripple::AccountSet_test::testSetAndResetAccountTxnID
void testSetAndResetAccountTxnID()
Definition: AccountSet_test.cpp:148
ripple::AccountSet_test::testWalletID
void testWalletID()
Definition: AccountSet_test.cpp:269
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:222
ripple::asfAccountTxnID
constexpr std::uint32_t asfAccountTxnID
Definition: TxFlags.h:78
ripple::asfDisallowIncomingNFTokenOffer
constexpr std::uint32_t asfDisallowIncomingNFTokenOffer
Definition: TxFlags.h:87
ripple::toAmount< STAmount >
STAmount toAmount< STAmount >(STAmount const &amt)
Definition: AmountConversions.h:70
ripple::get
T & get(EitherAmount &amt)
Definition: AmountSpec.h:118
ripple::AccountSet_test
Definition: AccountSet_test.cpp:30
std::initializer_list
ripple::asfAuthorizedNFTokenMinter
constexpr std::uint32_t asfAuthorizedNFTokenMinter
Definition: TxFlags.h:83