mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
deploy: 020b285808
This commit is contained in:
562
Directory__test_8cpp_source.html
Normal file
562
Directory__test_8cpp_source.html
Normal file
@@ -0,0 +1,562 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.17"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>rippled: Directory_test.cpp Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">rippled
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.17 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div id="nav-path" class="navpath">
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="dir_120ed4da3e3217b1e7fc0b4f48568e79.html">test</a></li><li class="navelem"><a class="el" href="dir_a9ccb529ba7bcf89cf1784a454c5bb08.html">ledger</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Directory_test.cpp</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//------------------------------------------------------------------------------</span></div>
|
||||
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/*</span></div>
|
||||
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
|
||||
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Copyright (c) 2012, 2013 Ripple Labs Inc.</span></div>
|
||||
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
|
||||
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
|
||||
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
|
||||
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
|
||||
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
|
||||
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
|
||||
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
|
||||
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
|
||||
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
|
||||
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
|
||||
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div>
|
||||
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">//==============================================================================</span></div>
|
||||
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  </div>
|
||||
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <ripple/basics/random.h></span></div>
|
||||
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <ripple/ledger/BookDirs.h></span></div>
|
||||
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <ripple/ledger/Directory.h></span></div>
|
||||
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <ripple/ledger/Sandbox.h></span></div>
|
||||
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <ripple/protocol/Feature.h></span></div>
|
||||
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <ripple/protocol/jss.h></span></div>
|
||||
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <ripple/protocol/Protocol.h></span></div>
|
||||
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <test/jtx.h></span></div>
|
||||
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/algorithm.html">algorithm</a>></span></div>
|
||||
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  </div>
|
||||
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
|
||||
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">namespace </span>test {</div>
|
||||
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div>
|
||||
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html"> 31</a></span> <span class="keyword">struct </span><a class="code" href="structripple_1_1test_1_1Directory__test.html">Directory_test</a> : <span class="keyword">public</span> beast::unit_test::suite</div>
|
||||
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div>
|
||||
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="comment">// Map [0-15576] into a a unique 3 letter currency code</span></div>
|
||||
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a27d1b00cdcf92bc6becf7aaf6bd0669b"> 35</a></span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a27d1b00cdcf92bc6becf7aaf6bd0669b">currcode</a> (<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> i)</div>
|
||||
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  {</div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="comment">// There are only 17576 possible combinations</span></div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  BEAST_EXPECT (i < 17577);</div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  </div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> code;</div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  </div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j != 3; ++j)</div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  {</div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  code.<a class="codeRef" href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">push_back</a> (<span class="charliteral">'A'</span> + (i % 26));</div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  i /= 26;</div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">return</span> code;</div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  }</div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
|
||||
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="comment">// Insert n empty pages, numbered [0, ... n - 1], in the</span></div>
|
||||
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// specified directory:</span></div>
|
||||
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a69d3117311873320c092a35c45669920"> 54</a></span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a69d3117311873320c092a35c45669920">makePages</a>(</div>
|
||||
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="code" href="classripple_1_1Sandbox.html">Sandbox</a>& sb,</div>
|
||||
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& base,</div>
|
||||
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> n)</div>
|
||||
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  {</div>
|
||||
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">for</span> (<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> i = 0; i < n; ++i)</div>
|
||||
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  {</div>
|
||||
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keyword">auto</span> p = std::make_shared<SLE>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, i));</div>
|
||||
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  </div>
|
||||
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  p->setFieldV256 (<a class="code" href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">sfIndexes</a>, <a class="code" href="classripple_1_1STVector256.html">STVector256</a>{});</div>
|
||||
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
|
||||
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">if</span> (i + 1 == n)</div>
|
||||
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  p->setFieldU64 (<a class="code" href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">sfIndexNext</a>, 0);</div>
|
||||
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  p->setFieldU64 (<a class="code" href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">sfIndexNext</a>, i + 1);</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  </div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">if</span> (i == 0)</div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  p->setFieldU64 (<a class="code" href="namespaceripple.html#a10924290886398d9747dac78ba256553">sfIndexPrevious</a>, n - 1);</div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">else</span></div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  p->setFieldU64 (<a class="code" href="namespaceripple.html#a10924290886398d9747dac78ba256553">sfIndexPrevious</a>, i - 1);</div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  </div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#a669490ced7bb2cab3a6cc704bc7286df">insert</a> (p);</div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  }</div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  }</div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  </div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a76bac467505ccd17227e945411830aa1"> 79</a></span>  <span class="keywordtype">void</span> <a class="code" href="structripple_1_1test_1_1Directory__test.html#a76bac467505ccd17227e945411830aa1">testDirectoryOrdering</a>()</div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keyword">using namespace </span>jtx;</div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keyword">auto</span> gw = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">"gw"</span>);</div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keyword">auto</span> USD = gw[<span class="stringliteral">"USD"</span>];</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keyword">auto</span> alice = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">"alice"</span>);</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">auto</span> bob = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">"bob"</span>);</div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  testcase (<span class="stringliteral">"Directory Ordering"</span>);</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  </div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(10000000), alice, gw);</div>
|
||||
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div>
|
||||
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> <span class="keyword">const</span> firstOfferSeq {env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#a2ef09f6f41b7d8a2dc89175e3b108f87">seq</a> (alice)};</div>
|
||||
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">for</span> (<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> i = 1; i <= 400; ++i)</div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>(alice, USD(i), <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(i)));</div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  </div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">// Check Alice's directory: it should contain one</span></div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// entry for each offer she added, and, within each</span></div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">// page the entries should be in sorted order.</span></div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  {</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">auto</span> <span class="keyword">const</span> view = env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>();</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  </div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> page = 0;</div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  </div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">do</span></div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  {</div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">auto</span> p = view->read(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(<a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice), page));</div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  </div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">// Ensure that the entries in the page are sorted</span></div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">auto</span> <span class="keyword">const</span>& v = p->getFieldV256(<a class="code" href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">sfIndexes</a>);</div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  BEAST_EXPECT (<a class="codeRef" href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a>(v.begin(), v.end()));</div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">// Ensure that the page contains the correct orders by</span></div>
|
||||
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">// calculating which sequence numbers belong here.</span></div>
|
||||
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> <span class="keyword">const</span> minSeq =</div>
|
||||
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  firstOfferSeq + (page * <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a>);</div>
|
||||
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> <span class="keyword">const</span> maxSeq = minSeq + <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a>;</div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  </div>
|
||||
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& e : v)</div>
|
||||
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  {</div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">auto</span> c = view->read(<a class="code" href="namespaceripple_1_1keylet.html#aa19b0acea57b0cc647d10530fb779d20">keylet::child</a>(e));</div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  BEAST_EXPECT(c);</div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  BEAST_EXPECT(c->getFieldU32(<a class="code" href="namespaceripple.html#a75d94908bf27ab4f7ec61a457e52ee8e">sfSequence</a>) >= minSeq);</div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  BEAST_EXPECT(c->getFieldU32(<a class="code" href="namespaceripple.html#a75d94908bf27ab4f7ec61a457e52ee8e">sfSequence</a>) < maxSeq);</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  }</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  page = p->getFieldU64(<a class="code" href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">sfIndexNext</a>);</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  } <span class="keywordflow">while</span> (page != 0);</div>
|
||||
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  }</div>
|
||||
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div>
|
||||
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="comment">// Now check the orderbook: it should be in the order we placed</span></div>
|
||||
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="comment">// the offers.</span></div>
|
||||
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keyword">auto</span> book = <a class="code" href="classripple_1_1BookDirs.html">BookDirs</a>(*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ace0420a6e752f5dc5400df6f2097647e">current</a>(),</div>
|
||||
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="classripple_1_1Book.html">Book</a>({<a class="code" href="namespaceripple.html#af13e153259f9f64839b634f3b9642dcb">xrpIssue</a>(), USD.issue()}));</div>
|
||||
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordtype">int</span> count = 1;</div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
|
||||
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a> : book)</div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  {</div>
|
||||
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  count++;</div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  BEAST_EXPECT(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>->getFieldAmount(<a class="code" href="namespaceripple.html#ae6dad7a90c89e294deb0795f58402f50">sfTakerPays</a>) == USD(count));</div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  BEAST_EXPECT(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>->getFieldAmount(<a class="code" href="namespaceripple.html#a7b344311df2e05264161f7b7e38c9730">sfTakerGets</a>) == <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(count));</div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  }</div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  }</div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  </div>
|
||||
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a876c1db3eeb41421c4e627e9fb6a157f"> 147</a></span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a876c1db3eeb41421c4e627e9fb6a157f">testDirIsEmpty</a>()</div>
|
||||
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  {</div>
|
||||
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  testcase (<span class="stringliteral">"dirIsEmpty"</span>);</div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  </div>
|
||||
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keyword">using namespace </span>jtx;</div>
|
||||
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keyword">auto</span> <span class="keyword">const</span> alice = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">"alice"</span>);</div>
|
||||
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keyword">auto</span> <span class="keyword">const</span> bob = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">"bob"</span>);</div>
|
||||
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keyword">auto</span> <span class="keyword">const</span> charlie = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> (<span class="stringliteral">"charlie"</span>);</div>
|
||||
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keyword">auto</span> <span class="keyword">const</span> gw = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> (<span class="stringliteral">"gw"</span>);</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  </div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  </div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(1000000), alice, charlie, gw);</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  </div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="comment">// alice should have an empty directory.</span></div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  </div>
|
||||
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="comment">// Give alice a signer list, then there will be stuff in the directory.</span></div>
|
||||
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a2f130edacc0e266d31bd9d4fe4def16c">signers</a>(alice, 1, { { bob, 1} }));</div>
|
||||
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  BEAST_EXPECT(! <a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  </div>
|
||||
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a2f130edacc0e266d31bd9d4fe4def16c">signers</a>(alice, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a0acca6e3bae07a1895e30e660bede070">jtx::none</a>));</div>
|
||||
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  </div>
|
||||
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<IOU></a> <span class="keyword">const</span> currencies = [<span class="keyword">this</span>, &gw]()</div>
|
||||
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  {</div>
|
||||
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<IOU></a> c;</div>
|
||||
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  </div>
|
||||
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  c.<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">reserve</a>((2 * <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a>) + 3);</div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  </div>
|
||||
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">while</span> (c.<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() != c.<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector/capacity.html">capacity</a>())</div>
|
||||
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  c.<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(gw[<a class="code" href="structripple_1_1test_1_1Directory__test.html#a27d1b00cdcf92bc6becf7aaf6bd0669b">currcode</a>(c.<a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>())]);</div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  </div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">return</span> c;</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }();</div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  </div>
|
||||
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="comment">// First, Alices creates a lot of trustlines, and then</span></div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="comment">// deletes them in a different order:</span></div>
|
||||
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  {</div>
|
||||
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keyword">auto</span> cl = currencies;</div>
|
||||
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  </div>
|
||||
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& c : cl)</div>
|
||||
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  {</div>
|
||||
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a47cac3a8bfbc8c14ae8da735ec52ebbf">trust</a>(alice, c(50)));</div>
|
||||
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  }</div>
|
||||
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  </div>
|
||||
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  BEAST_EXPECT(! <a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  </div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/algorithm/random_shuffle.html">std::shuffle</a> (cl.begin(), cl.end(), <a class="code" href="namespaceripple.html#a8439f02fc1834046d791febb643887cb">default_prng</a>());</div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  </div>
|
||||
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& c : cl)</div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  {</div>
|
||||
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a47cac3a8bfbc8c14ae8da735ec52ebbf">trust</a>(alice, c(0)));</div>
|
||||
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div>
|
||||
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  </div>
|
||||
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  }</div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  </div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="comment">// Now, Alice creates offers to buy currency, creating</span></div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="comment">// implicit trust lines.</span></div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  {</div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keyword">auto</span> cl = currencies;</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  </div>
|
||||
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  </div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> c : currencies)</div>
|
||||
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  {</div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a47cac3a8bfbc8c14ae8da735ec52ebbf">trust</a>(charlie, c(50)));</div>
|
||||
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a7816b23daf9b325ea1f88cc121a53d05">pay</a>(gw, charlie, c(50)));</div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>(alice, c(50), <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(50)));</div>
|
||||
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  }</div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  </div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  BEAST_EXPECT(! <a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  </div>
|
||||
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">// Now fill the offers in a random order. Offer</span></div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="comment">// entries will drop, and be replaced by trust</span></div>
|
||||
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="comment">// lines that are implicitly created.</span></div>
|
||||
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/algorithm/random_shuffle.html">std::shuffle</a> (cl.begin(), cl.end(), <a class="code" href="namespaceripple.html#a8439f02fc1834046d791febb643887cb">default_prng</a>());</div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  </div>
|
||||
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& c : cl)</div>
|
||||
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  {</div>
|
||||
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>(charlie, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(50), c(50)));</div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  }</div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  BEAST_EXPECT(! <a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="comment">// Finally, Alice now sends the funds back to</span></div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">// Charlie. The implicitly created trust lines</span></div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="comment">// should drop away:</span></div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/algorithm/random_shuffle.html">std::shuffle</a> (cl.begin(), cl.end(), <a class="code" href="namespaceripple.html#a8439f02fc1834046d791febb643887cb">default_prng</a>());</div>
|
||||
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  </div>
|
||||
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& c : cl)</div>
|
||||
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  {</div>
|
||||
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a7816b23daf9b325ea1f88cc121a53d05">pay</a>(alice, charlie, c(50)));</div>
|
||||
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  }</div>
|
||||
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div>
|
||||
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  }</div>
|
||||
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  }</div>
|
||||
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  </div>
|
||||
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a3266ef73a81117ccc5147d181043618c"> 256</a></span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a3266ef73a81117ccc5147d181043618c">testRipd1353</a>()</div>
|
||||
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  {</div>
|
||||
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  testcase(<span class="stringliteral">"RIPD-1353 Empty Offer Directories"</span>);</div>
|
||||
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  </div>
|
||||
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keyword">using namespace </span>jtx;</div>
|
||||
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
|
||||
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
|
||||
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keyword">auto</span> <span class="keyword">const</span> gw = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>{<span class="stringliteral">"gateway"</span>};</div>
|
||||
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="keyword">auto</span> <span class="keyword">const</span> alice = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>{<span class="stringliteral">"alice"</span>};</div>
|
||||
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="keyword">auto</span> <span class="keyword">const</span> USD = gw[<span class="stringliteral">"USD"</span>];</div>
|
||||
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  </div>
|
||||
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(10000), alice, gw);</div>
|
||||
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#a90fecf3c0f6cdc1c40761e19917bf65a">trust</a>(USD(1000), alice);</div>
|
||||
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a7816b23daf9b325ea1f88cc121a53d05">pay</a>(gw, alice, USD(1000)));</div>
|
||||
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  </div>
|
||||
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keyword">auto</span> <span class="keyword">const</span> firstOfferSeq = env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#a2ef09f6f41b7d8a2dc89175e3b108f87">seq</a>(alice);</div>
|
||||
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  </div>
|
||||
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="comment">// Fill up three pages of offers</span></div>
|
||||
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 3; ++i)</div>
|
||||
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a>; ++j)</div>
|
||||
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">offer</a>(alice, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(1), USD(1)));</div>
|
||||
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  </div>
|
||||
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="comment">// remove all the offers. Remove the middle page last</span></div>
|
||||
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> page : {0, 2, 1})</div>
|
||||
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  {</div>
|
||||
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a>; ++i)</div>
|
||||
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  {</div>
|
||||
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <a class="code" href="classJson_1_1Value.html">Json::Value</a> cancelOffer;</div>
|
||||
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  cancelOffer[jss::Account] = alice.human();</div>
|
||||
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  cancelOffer[jss::OfferSequence] =</div>
|
||||
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <a class="code" href="namespaceJson.html#ab1488c31a37eea2d37f36a0961372572">Json::UInt</a>(firstOfferSeq + page * <a class="code" href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">dirNodeMaxEntries</a> + i);</div>
|
||||
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  cancelOffer[jss::TransactionType] = jss::OfferCancel;</div>
|
||||
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  env(cancelOffer);</div>
|
||||
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  }</div>
|
||||
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  }</div>
|
||||
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  </div>
|
||||
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="comment">// All the offers have been cancelled, so the book</span></div>
|
||||
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="comment">// should have no entries and be empty:</span></div>
|
||||
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  {</div>
|
||||
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <a class="code" href="classripple_1_1Sandbox.html">Sandbox</a> sb(env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>().get(), <a class="code" href="namespaceripple.html#ad2487abbcc1a5d6064b72144b461df6eaf77cbea9706ce2ee7fdf5a85efbf70c5">tapNONE</a>);</div>
|
||||
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span> bookBase = <a class="code" href="namespaceripple.html#aeb5ef72b34cf7a324641e7a7f696d4cc">getBookBase</a>({<a class="code" href="namespaceripple.html#af13e153259f9f64839b634f3b9642dcb">xrpIssue</a>(), USD.issue()});</div>
|
||||
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  </div>
|
||||
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (sb, <a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(bookBase)));</div>
|
||||
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#aacb6aa0fa3390a04cee9cf619b95beb9">succ</a>(bookBase, <a class="code" href="namespaceripple.html#aae2b8e3c2ed21dcbae53a626c885af3d">getQualityNext</a>(bookBase)));</div>
|
||||
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  }</div>
|
||||
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  </div>
|
||||
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="comment">// Alice returns the USD she has to the gateway</span></div>
|
||||
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="comment">// and removes her trust line. Her owner directory</span></div>
|
||||
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="comment">// should now be empty:</span></div>
|
||||
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  {</div>
|
||||
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#a90fecf3c0f6cdc1c40761e19917bf65a">trust</a>(USD(0), alice);</div>
|
||||
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  env(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a7816b23daf9b325ea1f88cc121a53d05">pay</a>(alice, gw, alice[<span class="stringliteral">"USD"</span>](1000)));</div>
|
||||
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  BEAST_EXPECT(<a class="code" href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">dirIsEmpty</a> (*env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>(), <a class="code" href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">keylet::ownerDir</a>(alice)));</div>
|
||||
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  }</div>
|
||||
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  }</div>
|
||||
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  </div>
|
||||
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordtype">void</span></div>
|
||||
<div class="line"><a name="l00317"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#abb52ca3b87b20803a4c40d8b0c70cbda"> 317</a></span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#abb52ca3b87b20803a4c40d8b0c70cbda">testEmptyChain</a>()</div>
|
||||
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  {</div>
|
||||
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  testcase(<span class="stringliteral">"Empty Chain on Delete"</span>);</div>
|
||||
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  </div>
|
||||
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keyword">using namespace </span>jtx;</div>
|
||||
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
|
||||
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  </div>
|
||||
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="keyword">auto</span> <span class="keyword">const</span> gw = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>{<span class="stringliteral">"gateway"</span>};</div>
|
||||
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keyword">auto</span> <span class="keyword">const</span> alice = <a class="code" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>{<span class="stringliteral">"alice"</span>};</div>
|
||||
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keyword">auto</span> <span class="keyword">const</span> USD = gw[<span class="stringliteral">"USD"</span>];</div>
|
||||
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  </div>
|
||||
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code" href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">XRP</a>(10000), alice);</div>
|
||||
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">close</a>();</div>
|
||||
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  </div>
|
||||
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> base;</div>
|
||||
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  base.<a class="code" href="classripple_1_1base__uint.html#aa4e88c771af37069b5cd6490ae010d52">SetHex</a>(<span class="stringliteral">"fb71c9aa3310141da4b01d6c744a98286af2d72ab5448d5adc0910ca0c910880"</span>);</div>
|
||||
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
|
||||
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> item;</div>
|
||||
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  item.<a class="code" href="classripple_1_1base__uint.html#aa4e88c771af37069b5cd6490ae010d52">SetHex</a>(<span class="stringliteral">"bad0f021aa3b2f6754a8fe82a5779730aa0bbbab82f17201ef24900efc2c7312"</span>);</div>
|
||||
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  </div>
|
||||
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  {</div>
|
||||
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="comment">// Create a chain of three pages:</span></div>
|
||||
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <a class="code" href="classripple_1_1Sandbox.html">Sandbox</a> sb(env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>().get(), <a class="code" href="namespaceripple.html#ad2487abbcc1a5d6064b72144b461df6eaf77cbea9706ce2ee7fdf5a85efbf70c5">tapNONE</a>);</div>
|
||||
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a69d3117311873320c092a35c45669920">makePages</a> (sb, base, 3);</div>
|
||||
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  </div>
|
||||
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <span class="comment">// Insert an item in the middle page:</span></div>
|
||||
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  {</div>
|
||||
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keyword">auto</span> p = sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a> (<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 1));</div>
|
||||
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  BEAST_EXPECT(p);</div>
|
||||
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  </div>
|
||||
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <a class="code" href="classripple_1_1STVector256.html">STVector256</a> v;</div>
|
||||
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  v.<a class="code" href="classripple_1_1STVector256.html#a6bd443eec0924c8b8f95e6c6d812117c">push_back</a> (item);</div>
|
||||
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  p->setFieldV256 (<a class="code" href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">sfIndexes</a>, v);</div>
|
||||
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#a4f12513f46ee2c194d6fb0e4d28e5543">update</a>(p);</div>
|
||||
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  }</div>
|
||||
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  </div>
|
||||
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="comment">// Now, try to delete the item from the middle</span></div>
|
||||
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <span class="comment">// page. This should cause all pages to be deleted:</span></div>
|
||||
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  BEAST_EXPECT (sb.<a class="code" href="classripple_1_1ApplyView.html#a5a06441ef4fdb9b7f6e51437ce4a959f">dirRemove</a> (<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 0), 1, <a class="code" href="namespaceripple_1_1keylet.html#a937df05a2cd9ce79d167fc4b3b6d9413">keylet::unchecked</a>(item), <span class="keyword">false</span>));</div>
|
||||
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 2)));</div>
|
||||
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 1)));</div>
|
||||
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 0)));</div>
|
||||
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  }</div>
|
||||
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  </div>
|
||||
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  {</div>
|
||||
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="comment">// Create a chain of four pages:</span></div>
|
||||
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <a class="code" href="classripple_1_1Sandbox.html">Sandbox</a> sb(env.<a class="code" href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">closed</a>().get(), <a class="code" href="namespaceripple.html#ad2487abbcc1a5d6064b72144b461df6eaf77cbea9706ce2ee7fdf5a85efbf70c5">tapNONE</a>);</div>
|
||||
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a69d3117311873320c092a35c45669920">makePages</a> (sb, base, 4);</div>
|
||||
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  </div>
|
||||
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="comment">// Now add items on pages 1 and 2:</span></div>
|
||||
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  {</div>
|
||||
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keyword">auto</span> p1 = sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a> (<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 1));</div>
|
||||
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  BEAST_EXPECT(p1);</div>
|
||||
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  </div>
|
||||
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <a class="code" href="classripple_1_1STVector256.html">STVector256</a> v1;</div>
|
||||
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  v1.<a class="code" href="classripple_1_1STVector256.html#a6bd443eec0924c8b8f95e6c6d812117c">push_back</a> (~item);</div>
|
||||
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  p1->setFieldV256 (<a class="code" href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">sfIndexes</a>, v1);</div>
|
||||
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#a4f12513f46ee2c194d6fb0e4d28e5543">update</a>(p1);</div>
|
||||
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  </div>
|
||||
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keyword">auto</span> p2 = sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a> (<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 2));</div>
|
||||
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  BEAST_EXPECT(p2);</div>
|
||||
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  </div>
|
||||
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <a class="code" href="classripple_1_1STVector256.html">STVector256</a> v2;</div>
|
||||
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  v2.<a class="code" href="classripple_1_1STVector256.html#a6bd443eec0924c8b8f95e6c6d812117c">push_back</a> (item);</div>
|
||||
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  p2->setFieldV256 (<a class="code" href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">sfIndexes</a>, v2);</div>
|
||||
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#a4f12513f46ee2c194d6fb0e4d28e5543">update</a>(p2);</div>
|
||||
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  }</div>
|
||||
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  </div>
|
||||
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// Now, try to delete the item from page 2.</span></div>
|
||||
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="comment">// This should cause pages 2 and 3 to be</span></div>
|
||||
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="comment">// deleted:</span></div>
|
||||
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  BEAST_EXPECT (sb.<a class="code" href="classripple_1_1ApplyView.html#a5a06441ef4fdb9b7f6e51437ce4a959f">dirRemove</a> (<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 0), 2, <a class="code" href="namespaceripple_1_1keylet.html#a937df05a2cd9ce79d167fc4b3b6d9413">keylet::unchecked</a>(item), <span class="keyword">false</span>));</div>
|
||||
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 3)));</div>
|
||||
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  BEAST_EXPECT (!sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 2)));</div>
|
||||
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  </div>
|
||||
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keyword">auto</span> p1 = sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 1));</div>
|
||||
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  BEAST_EXPECT (p1);</div>
|
||||
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  BEAST_EXPECT (p1->getFieldU64 (<a class="code" href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">sfIndexNext</a>) == 0);</div>
|
||||
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  BEAST_EXPECT (p1->getFieldU64 (<a class="code" href="namespaceripple.html#a10924290886398d9747dac78ba256553">sfIndexPrevious</a>) == 0);</div>
|
||||
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  </div>
|
||||
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="keyword">auto</span> p0 = sb.<a class="code" href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">peek</a>(<a class="code" href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">keylet::page</a>(base, 0));</div>
|
||||
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  BEAST_EXPECT (p0);</div>
|
||||
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  BEAST_EXPECT (p0->getFieldU64 (<a class="code" href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">sfIndexNext</a>) == 1);</div>
|
||||
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  BEAST_EXPECT (p0->getFieldU64 (<a class="code" href="namespaceripple.html#a10924290886398d9747dac78ba256553">sfIndexPrevious</a>) == 1);</div>
|
||||
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  }</div>
|
||||
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  }</div>
|
||||
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  </div>
|
||||
<div class="line"><a name="l00404"></a><span class="lineno"><a class="line" href="structripple_1_1test_1_1Directory__test.html#a80fb86eb03582f36387c3cc3402aa199"> 404</a></span>  <span class="keywordtype">void</span> <a class="code" href="structripple_1_1test_1_1Directory__test.html#a80fb86eb03582f36387c3cc3402aa199">run</a>()<span class="keyword"> override</span></div>
|
||||
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span> <span class="keyword"> </span>{</div>
|
||||
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a76bac467505ccd17227e945411830aa1">testDirectoryOrdering</a>();</div>
|
||||
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a876c1db3eeb41421c4e627e9fb6a157f">testDirIsEmpty</a>();</div>
|
||||
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#a3266ef73a81117ccc5147d181043618c">testRipd1353</a>();</div>
|
||||
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <a class="code" href="structripple_1_1test_1_1Directory__test.html#abb52ca3b87b20803a4c40d8b0c70cbda">testEmptyChain</a>();</div>
|
||||
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  }</div>
|
||||
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span> };</div>
|
||||
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  </div>
|
||||
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span> <a class="code" href="namespaceripple_1_1test.html#ac6cac37f3447e39ca9090bb878f8cc12">BEAST_DEFINE_TESTSUITE_PRIO</a>(<a class="code" href="classripple_1_1base__uint.html">Directory</a>,ledger,<a class="code" href="namespaceripple.html">ripple</a>,1);</div>
|
||||
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  </div>
|
||||
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span> }</div>
|
||||
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span> }</div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<div class="ttc" id="anamespaceripple_1_1test_html_ac6cac37f3447e39ca9090bb878f8cc12"><div class="ttname"><a href="namespaceripple_1_1test.html#ac6cac37f3447e39ca9090bb878f8cc12">ripple::test::BEAST_DEFINE_TESTSUITE_PRIO</a></div><div class="ttdeci">BEAST_DEFINE_TESTSUITE_PRIO(Flow, app, ripple, 2)</div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a69d3117311873320c092a35c45669920"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a69d3117311873320c092a35c45669920">ripple::test::Directory_test::makePages</a></div><div class="ttdeci">void makePages(Sandbox &sb, uint256 const &base, std::uint64_t n)</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00054">Directory_test.cpp:54</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a37cf35ddf6bc8f4c6cbfa3fba57d6815"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a37cf35ddf6bc8f4c6cbfa3fba57d6815">ripple::test::jtx::XRP</a></div><div class="ttdeci">const XRP_t XRP</div><div class="ttdoc">Converts to XRP Issue or STAmount.</div><div class="ttdef"><b>Definition:</b> <a href="amount_8cpp_source.html#l00109">amount.cpp:109</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a64d5f22fb89001653b7bcadad3c439f8"><div class="ttname"><a href="namespaceripple.html#a64d5f22fb89001653b7bcadad3c439f8">ripple::sfIndexNext</a></div><div class="ttdeci">const SF_U64 sfIndexNext(access, STI_UINT64, 1, "IndexNext")</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00379">SField.h:379</a></div></div>
|
||||
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div><div class="ttdoc">STL class.</div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a0acca6e3bae07a1895e30e660bede070"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a0acca6e3bae07a1895e30e660bede070">ripple::test::jtx::none</a></div><div class="ttdeci">static const none_t none</div><div class="ttdef"><b>Definition:</b> <a href="tags_8h_source.html#l00029">tags.h:29</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_ae449949223905ec9bd5b8dbc1c9e9ded"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#ae449949223905ec9bd5b8dbc1c9e9ded">ripple::test::jtx::Env::closed</a></div><div class="ttdeci">std::shared_ptr< ReadView const > closed()</div><div class="ttdoc">Returns the last closed ledger.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8cpp_source.html#l00108">Env.cpp:108</a></div></div>
|
||||
<div class="ttc" id="areserve_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/reserve.html">std::vector::reserve</a></div><div class="ttdeci">T reserve(T... args)</div></div>
|
||||
<div class="ttc" id="anamespaceJson_html_ab1488c31a37eea2d37f36a0961372572"><div class="ttname"><a href="namespaceJson.html#ab1488c31a37eea2d37f36a0961372572">Json::UInt</a></div><div class="ttdeci">unsigned int UInt</div><div class="ttdef"><b>Definition:</b> <a href="json__forwards_8h_source.html#l00028">json_forwards.h:28</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_aeb5ef72b34cf7a324641e7a7f696d4cc"><div class="ttname"><a href="namespaceripple.html#aeb5ef72b34cf7a324641e7a7f696d4cc">ripple::getBookBase</a></div><div class="ttdeci">uint256 getBookBase(Book const &book)</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00067">Indexes.cpp:67</a></div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div><div class="ttdoc">STL class.</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a75d94908bf27ab4f7ec61a457e52ee8e"><div class="ttname"><a href="namespaceripple.html#a75d94908bf27ab4f7ec61a457e52ee8e">ripple::sfSequence</a></div><div class="ttdeci">const SF_U32 sfSequence(access, STI_UINT32, 4, "Sequence")</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00340">SField.h:340</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a47cac3a8bfbc8c14ae8da735ec52ebbf"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a47cac3a8bfbc8c14ae8da735ec52ebbf">ripple::test::jtx::trust</a></div><div class="ttdeci">Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)</div><div class="ttdoc">Modify a trust line.</div><div class="ttdef"><b>Definition:</b> <a href="trust_8cpp_source.html#l00030">trust.cpp:30</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1STVector256_html_a6bd443eec0924c8b8f95e6c6d812117c"><div class="ttname"><a href="classripple_1_1STVector256.html#a6bd443eec0924c8b8f95e6c6d812117c">ripple::STVector256::push_back</a></div><div class="ttdeci">void push_back(uint256 const &v)</div><div class="ttdef"><b>Definition:</b> <a href="STVector256_8h_source.html#l00160">STVector256.h:160</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a76bac467505ccd17227e945411830aa1"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a76bac467505ccd17227e945411830aa1">ripple::test::Directory_test::testDirectoryOrdering</a></div><div class="ttdeci">void testDirectoryOrdering()</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00079">Directory_test.cpp:79</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1detail_1_1ApplyViewBase_html_a4f12513f46ee2c194d6fb0e4d28e5543"><div class="ttname"><a href="classripple_1_1detail_1_1ApplyViewBase.html#a4f12513f46ee2c194d6fb0e4d28e5543">ripple::detail::ApplyViewBase::update</a></div><div class="ttdeci">void update(std::shared_ptr< SLE > const &sle) override</div><div class="ttdoc">Indicate changes to a peeked SLE.</div><div class="ttdef"><b>Definition:</b> <a href="ApplyViewBase_8cpp_source.html#l00158">ApplyViewBase.cpp:158</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_ae6dad7a90c89e294deb0795f58402f50"><div class="ttname"><a href="namespaceripple.html#ae6dad7a90c89e294deb0795f58402f50">ripple::sfTakerPays</a></div><div class="ttdeci">const SF_Amount sfTakerPays(access, STI_AMOUNT, 4, "TakerPays")</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00426">SField.h:426</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1keylet_html_aa19b0acea57b0cc647d10530fb779d20"><div class="ttname"><a href="namespaceripple_1_1keylet.html#aa19b0acea57b0cc647d10530fb779d20">ripple::keylet::child</a></div><div class="ttdeci">Keylet child(uint256 const &key)</div><div class="ttdoc">Any item that can be in an owner dir.</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00213">Indexes.cpp:213</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_aae2b8e3c2ed21dcbae53a626c885af3d"><div class="ttname"><a href="namespaceripple.html#aae2b8e3c2ed21dcbae53a626c885af3d">ripple::getQualityNext</a></div><div class="ttdeci">uint256 getQualityNext(uint256 const &uBase)</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00127">Indexes.cpp:127</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a763e39623c51c0e2809f7c72e84e429b"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a763e39623c51c0e2809f7c72e84e429b">ripple::test::jtx::offer</a></div><div class="ttdeci">Json::Value offer(Account const &account, STAmount const &in, STAmount const &out, std::uint32_t flags)</div><div class="ttdoc">Create an offer.</div><div class="ttdef"><b>Definition:</b> <a href="offer_8cpp_source.html#l00028">offer.cpp:28</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_ad2487abbcc1a5d6064b72144b461df6eaf77cbea9706ce2ee7fdf5a85efbf70c5"><div class="ttname"><a href="namespaceripple.html#ad2487abbcc1a5d6064b72144b461df6eaf77cbea9706ce2ee7fdf5a85efbf70c5">ripple::tapNONE</a></div><div class="ttdeci">@ tapNONE</div><div class="ttdef"><b>Definition:</b> <a href="ApplyView_8h_source.html#l00033">ApplyView.h:33</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_a90fecf3c0f6cdc1c40761e19917bf65a"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#a90fecf3c0f6cdc1c40761e19917bf65a">ripple::test::jtx::Env::trust</a></div><div class="ttdeci">void trust(STAmount const &amount, Account const &account)</div><div class="ttdoc">Establish trust lines.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8cpp_source.html#l00245">Env.cpp:245</a></div></div>
|
||||
<div class="ttc" id="aalgorithm_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/algorithm.html">algorithm</a></div></div>
|
||||
<div class="ttc" id="ais_sorted_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted.html">std::is_sorted</a></div><div class="ttdeci">T is_sorted(T... args)</div></div>
|
||||
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/push_back.html">std::string::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
||||
<div class="ttc" id="aclassripple_1_1ApplyView_html_a5a06441ef4fdb9b7f6e51437ce4a959f"><div class="ttname"><a href="classripple_1_1ApplyView.html#a5a06441ef4fdb9b7f6e51437ce4a959f">ripple::ApplyView::dirRemove</a></div><div class="ttdeci">bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)</div><div class="ttdoc">Remove an entry from a directory.</div><div class="ttdef"><b>Definition:</b> <a href="ApplyView_8cpp_source.html#l00189">ApplyView.cpp:189</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a10924290886398d9747dac78ba256553"><div class="ttname"><a href="namespaceripple.html#a10924290886398d9747dac78ba256553">ripple::sfIndexPrevious</a></div><div class="ttdeci">const SF_U64 sfIndexPrevious(access, STI_UINT64, 2, "IndexPrevious")</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00380">SField.h:380</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint< 256 ></a></div></div>
|
||||
<div class="ttc" id="acapacity_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/capacity.html">std::vector::capacity</a></div><div class="ttdeci">T capacity(T... args)</div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a2f130edacc0e266d31bd9d4fe4def16c"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a2f130edacc0e266d31bd9d4fe4def16c">ripple::test::jtx::signers</a></div><div class="ttdeci">Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)</div><div class="ttdef"><b>Definition:</b> <a href="multisign_8cpp_source.html#l00033">multisign.cpp:33</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1BookDirs_html"><div class="ttname"><a href="classripple_1_1BookDirs.html">ripple::BookDirs</a></div><div class="ttdef"><b>Definition:</b> <a href="BookDirs_8h_source.html#l00027">BookDirs.h:27</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1detail_1_1ApplyViewBase_html_aacb6aa0fa3390a04cee9cf619b95beb9"><div class="ttname"><a href="classripple_1_1detail_1_1ApplyViewBase.html#aacb6aa0fa3390a04cee9cf619b95beb9">ripple::detail::ApplyViewBase::succ</a></div><div class="ttdeci">boost::optional< key_type > succ(key_type const &key, boost::optional< key_type > const &last=boost::none) const override</div><div class="ttdoc">Return the key of the next state item.</div><div class="ttdef"><b>Definition:</b> <a href="ApplyViewBase_8cpp_source.html#l00067">ApplyViewBase.cpp:67</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1Sandbox_html"><div class="ttname"><a href="classripple_1_1Sandbox.html">ripple::Sandbox</a></div><div class="ttdoc">Discardable, editable view to a ledger.</div><div class="ttdef"><b>Definition:</b> <a href="Sandbox_8h_source.html#l00034">Sandbox.h:34</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1keylet_html_a5e31781c9fd43e42da7b3b85307653e5"><div class="ttname"><a href="namespaceripple_1_1keylet.html#a5e31781c9fd43e42da7b3b85307653e5">ripple::keylet::ownerDir</a></div><div class="ttdeci">Keylet ownerDir(AccountID const &id)</div><div class="ttdoc">The root page of an account's directory.</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00318">Indexes.cpp:318</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1base__uint_html_aa4e88c771af37069b5cd6490ae010d52"><div class="ttname"><a href="classripple_1_1base__uint.html#aa4e88c771af37069b5cd6490ae010d52">ripple::base_uint::SetHex</a></div><div class="ttdeci">bool SetHex(const char *psz, bool bStrict=false)</div><div class="ttdoc">Parse a hex string into a base_uint The input can be:</div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00362">base_uint.h:362</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a8439f02fc1834046d791febb643887cb"><div class="ttname"><a href="namespaceripple.html#a8439f02fc1834046d791febb643887cb">ripple::default_prng</a></div><div class="ttdeci">beast::xor_shift_engine & default_prng()</div><div class="ttdoc">Return the default random engine.</div><div class="ttdef"><b>Definition:</b> <a href="ripple_2basics_2random_8h_source.html#l00068">ripple/basics/random.h:68</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a3266ef73a81117ccc5147d181043618c"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a3266ef73a81117ccc5147d181043618c">ripple::test::Directory_test::testRipd1353</a></div><div class="ttdeci">void testRipd1353()</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00256">Directory_test.cpp:256</a></div></div>
|
||||
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_a2ef09f6f41b7d8a2dc89175e3b108f87"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#a2ef09f6f41b7d8a2dc89175e3b108f87">ripple::test::jtx::Env::seq</a></div><div class="ttdeci">std::uint32_t seq(Account const &account) const</div><div class="ttdoc">Returns the next sequence number on account.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8cpp_source.html#l00192">Env.cpp:192</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a7a057a09039ceedfe09aa311644c91b9"><div class="ttname"><a href="namespaceripple.html#a7a057a09039ceedfe09aa311644c91b9">ripple::sfIndexes</a></div><div class="ttdeci">const SF_Vec256 sfIndexes(access, STI_VECTOR256, 1, "Indexes", SField::sMD_Never)</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00473">SField.h:473</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a27d1b00cdcf92bc6becf7aaf6bd0669b"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a27d1b00cdcf92bc6becf7aaf6bd0669b">ripple::test::Directory_test::currcode</a></div><div class="ttdeci">std::string currcode(std::size_t i)</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00035">Directory_test.cpp:35</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1keylet_html_a937df05a2cd9ce79d167fc4b3b6d9413"><div class="ttname"><a href="namespaceripple_1_1keylet.html#a937df05a2cd9ce79d167fc4b3b6d9413">ripple::keylet::unchecked</a></div><div class="ttdeci">Keylet unchecked(uint256 const &key)</div><div class="ttdoc">Any ledger entry.</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00313">Indexes.cpp:313</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_abb52ca3b87b20803a4c40d8b0c70cbda"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#abb52ca3b87b20803a4c40d8b0c70cbda">ripple::test::Directory_test::testEmptyChain</a></div><div class="ttdeci">void testEmptyChain()</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00317">Directory_test.cpp:317</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html">ripple::test::Directory_test</a></div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00031">Directory_test.cpp:31</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1detail_1_1ApplyViewBase_html_a669490ced7bb2cab3a6cc704bc7286df"><div class="ttname"><a href="classripple_1_1detail_1_1ApplyViewBase.html#a669490ced7bb2cab3a6cc704bc7286df">ripple::detail::ApplyViewBase::insert</a></div><div class="ttdeci">void insert(std::shared_ptr< SLE > const &sle) override</div><div class="ttdoc">Insert a new state SLE.</div><div class="ttdef"><b>Definition:</b> <a href="ApplyViewBase_8cpp_source.html#l00151">ApplyViewBase.cpp:151</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_af10fd1df5a0f8f32f4bfd9f07b0c3596"><div class="ttname"><a href="namespaceripple.html#af10fd1df5a0f8f32f4bfd9f07b0c3596">ripple::dirIsEmpty</a></div><div class="ttdeci">bool dirIsEmpty(ReadView const &view, Keylet const &k)</div><div class="ttdoc">Returns true if the directory is empty.</div><div class="ttdef"><b>Definition:</b> <a href="View_8cpp_source.html#l00443">View.cpp:443</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1test_1_1jtx_html_a7816b23daf9b325ea1f88cc121a53d05"><div class="ttname"><a href="namespaceripple_1_1test_1_1jtx.html#a7816b23daf9b325ea1f88cc121a53d05">ripple::test::jtx::pay</a></div><div class="ttdeci">Json::Value pay(Account const &account, Account const &to, AnyAmount amount)</div><div class="ttdoc">Create a payment.</div><div class="ttdef"><b>Definition:</b> <a href="pay_8cpp_source.html#l00029">pay.cpp:29</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_abc1dc9c86060f4d385dc66b2a31c0bd6"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#abc1dc9c86060f4d385dc66b2a31c0bd6">ripple::test::jtx::Env::close</a></div><div class="ttdeci">void close(NetClock::time_point closeTime, boost::optional< std::chrono::milliseconds > consensusDelay=boost::none)</div><div class="ttdoc">Close and advance the ledger.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8cpp_source.html#l00114">Env.cpp:114</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_ae2349266cb09d1f1c3de06606ebdf9e2"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">ripple::test::jtx::Env::fund</a></div><div class="ttdeci">void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)</div><div class="ttdef"><b>Definition:</b> <a href="Env_8cpp_source.html#l00214">Env.cpp:214</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1STVector256_html"><div class="ttname"><a href="classripple_1_1STVector256.html">ripple::STVector256</a></div><div class="ttdef"><b>Definition:</b> <a href="STVector256_8h_source.html#l00029">STVector256.h:29</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_a7b344311df2e05264161f7b7e38c9730"><div class="ttname"><a href="namespaceripple.html#a7b344311df2e05264161f7b7e38c9730">ripple::sfTakerGets</a></div><div class="ttdeci">const SF_Amount sfTakerGets(access, STI_AMOUNT, 5, "TakerGets")</div><div class="ttdef"><b>Definition:</b> <a href="SField_8h_source.html#l00427">SField.h:427</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_af13e153259f9f64839b634f3b9642dcb"><div class="ttname"><a href="namespaceripple.html#af13e153259f9f64839b634f3b9642dcb">ripple::xrpIssue</a></div><div class="ttdeci">Issue const & xrpIssue()</div><div class="ttdoc">Returns an asset specifier that represents XRP.</div><div class="ttdef"><b>Definition:</b> <a href="Issue_8h_source.html#l00097">Issue.h:97</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a876c1db3eeb41421c4e627e9fb6a157f"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a876c1db3eeb41421c4e627e9fb6a157f">ripple::test::Directory_test::testDirIsEmpty</a></div><div class="ttdeci">void testDirIsEmpty()</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00147">Directory_test.cpp:147</a></div></div>
|
||||
<div class="ttc" id="astructripple_1_1test_1_1Directory__test_html_a80fb86eb03582f36387c3cc3402aa199"><div class="ttname"><a href="structripple_1_1test_1_1Directory__test.html#a80fb86eb03582f36387c3cc3402aa199">ripple::test::Directory_test::run</a></div><div class="ttdeci">void run() override</div><div class="ttdef"><b>Definition:</b> <a href="Directory__test_8cpp_source.html#l00404">Directory_test.cpp:404</a></div></div>
|
||||
<div class="ttc" id="asize_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Account_html"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Account.html">ripple::test::jtx::Account</a></div><div class="ttdoc">Immutable cryptographic account descriptor.</div><div class="ttdef"><b>Definition:</b> <a href="Account_8h_source.html#l00037">Account.h:37</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1Book_html"><div class="ttname"><a href="classripple_1_1Book.html">ripple::Book</a></div><div class="ttdoc">Specifies an order book.</div><div class="ttdef"><b>Definition:</b> <a href="Book_8h_source.html#l00032">Book.h:32</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1detail_1_1ApplyViewBase_html_afe88196d7aec85f2af00d7cd0b1a28c3"><div class="ttname"><a href="classripple_1_1detail_1_1ApplyViewBase.html#afe88196d7aec85f2af00d7cd0b1a28c3">ripple::detail::ApplyViewBase::peek</a></div><div class="ttdeci">std::shared_ptr< SLE > peek(Keylet const &k) override</div><div class="ttdoc">Prepare to modify the SLE associated with key.</div><div class="ttdef"><b>Definition:</b> <a href="ApplyViewBase_8cpp_source.html#l00138">ApplyViewBase.cpp:138</a></div></div>
|
||||
<div class="ttc" id="arandom_shuffle_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/random_shuffle.html">std::shuffle</a></div><div class="ttdeci">T shuffle(T... args)</div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html_ace0420a6e752f5dc5400df6f2097647e"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html#ace0420a6e752f5dc5400df6f2097647e">ripple::test::jtx::Env::current</a></div><div class="ttdeci">std::shared_ptr< OpenView const > current() const</div><div class="ttdoc">Returns the current ledger.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8h_source.html#l00296">Env.h:296</a></div></div>
|
||||
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Env_html"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Env.html">ripple::test::jtx::Env</a></div><div class="ttdoc">A transaction testing environment.</div><div class="ttdef"><b>Definition:</b> <a href="Env_8h_source.html#l00117">Env.h:117</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_html_aa92d4d5c77691ea9bf8a848d84187e39"><div class="ttname"><a href="namespaceripple.html#aa92d4d5c77691ea9bf8a848d84187e39">ripple::dirNodeMaxEntries</a></div><div class="ttdeci">constexpr std::size_t dirNodeMaxEntries</div><div class="ttdoc">The maximum number of entries per directory page.</div><div class="ttdef"><b>Definition:</b> <a href="Protocol_8h_source.html#l00051">Protocol.h:51</a></div></div>
|
||||
<div class="ttc" id="aclassJson_1_1Value_html"><div class="ttname"><a href="classJson_1_1Value.html">Json::Value</a></div><div class="ttdoc">Represents a JSON value.</div><div class="ttdef"><b>Definition:</b> <a href="json__value_8h_source.html#l00141">json_value.h:141</a></div></div>
|
||||
<div class="ttc" id="anamespaceripple_1_1keylet_html_a7fed9808de2218dfe38198c055f87663"><div class="ttname"><a href="namespaceripple_1_1keylet.html#a7fed9808de2218dfe38198c055f87663">ripple::keylet::page</a></div><div class="ttdeci">Keylet page(uint256 const &key, std::uint64_t index)</div><div class="ttdoc">A page in a directory.</div><div class="ttdef"><b>Definition:</b> <a href="Indexes_8cpp_source.html#l00324">Indexes.cpp:324</a></div></div>
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.17
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user