This commit is contained in:
intelliot
2023-07-12 17:57:19 +00:00
parent a2e1c04c86
commit 2cd625785d
3545 changed files with 126342 additions and 73769 deletions

View File

@@ -108,6 +108,9 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a81ae600c7c6c3c240cd4a74f756e8cd6"><td class="memItemLeft" align="right" valign="top">virtual <a class="elRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; Quality &gt;, <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1Step.html#a81ae600c7c6c3c240cd4a74f756e8cd6">qualityUpperBound</a> (<a class="el" href="classripple_1_1ReadView.html">ReadView</a> const &amp;v, <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a> prevStepDir) const =0</td></tr>
<tr class="memdesc:a81ae600c7c6c3c240cd4a74f756e8cd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find an upper bound of quality for the step. <a href="classripple_1_1Step.html#a81ae600c7c6c3c240cd4a74f756e8cd6">More...</a><br /></td></tr>
<tr class="separator:a81ae600c7c6c3c240cd4a74f756e8cd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af49290013e4d3cda54af6433746c2efc"><td class="memItemLeft" align="right" valign="top">virtual <a class="elRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; <a class="el" href="classripple_1_1QualityFunction.html">QualityFunction</a> &gt;, <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1Step.html#af49290013e4d3cda54af6433746c2efc">getQualityFunc</a> (<a class="el" href="classripple_1_1ReadView.html">ReadView</a> const &amp;v, <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a> prevStepDir) const</td></tr>
<tr class="memdesc:af49290013e4d3cda54af6433746c2efc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get <a class="el" href="classripple_1_1QualityFunction.html" title="Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets,...">QualityFunction</a>. <a href="classripple_1_1Step.html#af49290013e4d3cda54af6433746c2efc">More...</a><br /></td></tr>
<tr class="separator:af49290013e4d3cda54af6433746c2efc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c0b0fb5f0e476dfee59b2a085f34a93"><td class="memItemLeft" align="right" valign="top">virtual <a class="elRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1Step.html#a8c0b0fb5f0e476dfee59b2a085f34a93">offersUsed</a> () const</td></tr>
<tr class="memdesc:a8c0b0fb5f0e476dfee59b2a085f34a93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of offers consumed or partially consumed the last time the step ran, including expired and unfunded offers. <a href="classripple_1_1Step.html#a8c0b0fb5f0e476dfee59b2a085f34a93">More...</a><br /></td></tr>
<tr class="separator:a8c0b0fb5f0e476dfee59b2a085f34a93"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -156,7 +159,7 @@ Friends</h2></td></tr>
<p>Amounts are always transformed using liquidity with the same quality (quality is the amount out/amount in). For example, a <a class="el" href="classripple_1_1BookStep.html">BookStep</a> may use multiple offers when executing <code>fwd</code> or <code>rev</code>, but all those offers will be from the same quality directory.</p>
<p>A step may not have enough liquidity to transform the entire requested amount. Both <code>fwd</code> and <code>rev</code> return a pair of amounts (one for input amount, one for output amount) that show how much of the requested amount the step was actually able to use. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00079">79</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00081">81</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a44775ea2303695696046b0e44e436f89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44775ea2303695696046b0e44e436f89">&#9670;&nbsp;</a></span>~Step()</h2>
@@ -384,7 +387,7 @@ Friends</h2></td></tr>
<p>If this step is <a class="el" href="classripple_1_1DirectStepI.html">DirectStepI</a> (IOU-&gt;IOU direct step), return the src account. </p>
<p>This is needed for checkNoRipple. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00139">139</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00141">141</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -411,7 +414,7 @@ Friends</h2></td></tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00147">147</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00149">149</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -487,7 +490,7 @@ Friends</h2></td></tr>
<p>If this step is a <a class="el" href="classripple_1_1DirectStepI.html">DirectStepI</a>, return the quality in of the dst account. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00167">167</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00169">169</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -536,6 +539,47 @@ Friends</h2></td></tr>
<dl class="section return"><dt>Returns</dt><dd>A pair. The first element is the upper bound of quality for the step, or std::nullopt if the step is dry. The second element will be set to <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401ea7e611dd9f79193db43a5e9983752239e">DebtDirection::redeems</a> if this steps redeems, DebtDirection:issues if this step issues. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>it is an upper bound because offers on the books may be unfunded. If there is always a funded offer at the tip of the book, then we could rename this <code>theoreticalQuality</code> rather than <code>qualityUpperBound</code>. It could still differ from the actual quality, but except for "dust" amounts, it should be a good estimate for the actual quality. </dd></dl>
</div>
</div>
<a id="af49290013e4d3cda54af6433746c2efc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af49290013e4d3cda54af6433746c2efc">&#9670;&nbsp;</a></span>getQualityFunc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="elRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a>&lt; <a class="el" href="classripple_1_1QualityFunction.html">QualityFunction</a> &gt;, <a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a> &gt; ripple::Step::getQualityFunc </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classripple_1_1ReadView.html">ReadView</a> const &amp;&#160;</td>
<td class="paramname"><em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceripple.html#a8c623abdba7fa97ffd148311056d401e">DebtDirection</a>&#160;</td>
<td class="paramname"><em>prevStepDir</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get <a class="el" href="classripple_1_1QualityFunction.html" title="Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets,...">QualityFunction</a>. </p>
<p>Used in one path optimization where the quality function is non-constant (has AMM) and there is limitQuality. <a class="el" href="classripple_1_1QualityFunction.html" title="Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets,...">QualityFunction</a> allows calculation of required path output given requested limitQuality. All steps, except for <a class="el" href="classripple_1_1BookStep.html">BookStep</a> have the default implementation. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00308">308</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
<a id="a8c0b0fb5f0e476dfee59b2a085f34a93"></a>
@@ -564,7 +608,7 @@ Friends</h2></td></tr>
<p>Return the number of offers consumed or partially consumed the last time the step ran, including expired and unfunded offers. </p>
<p>N.B. This this not the total number offers consumed by this step for the entire payment, it is only the number the last time it ran. Offers may be partially consumed multiple times during a payment. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00199">199</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00211">211</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -593,7 +637,7 @@ Friends</h2></td></tr>
<p>If this step is a <a class="el" href="classripple_1_1BookStep.html">BookStep</a>, return the book. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00208">208</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00220">220</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -651,7 +695,7 @@ Friends</h2></td></tr>
<p>Return true if the step should be considered inactive. </p>
<p>A strand that has additional liquidity may be marked inactive if a step has consumed too many offers. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00225">225</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00237">237</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -880,7 +924,7 @@ Friends</h2></td></tr>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if lhs == rhs. </dd></dl>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00262">262</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00274">274</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -928,7 +972,7 @@ Friends</h2></td></tr>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if lhs != rhs. </dd></dl>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00274">274</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00286">286</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>
@@ -968,7 +1012,7 @@ Friends</h2></td></tr>
<p>Streaming operator for a <a class="el" href="classripple_1_1Step.html" title="A step in a payment path.">Step</a>. </p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00281">281</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
<p class="definition">Definition at line <a class="el" href="Steps_8h_source.html#l00293">293</a> of file <a class="el" href="Steps_8h_source.html">Steps.h</a>.</p>
</div>
</div>