This commit is contained in:
github-merge-queue[bot]
2025-10-28 11:10:45 -07:00
parent 4006528d8b
commit 1b523c899b
65 changed files with 2822 additions and 2679 deletions

View File

@@ -279,182 +279,165 @@ $(document).ready(function() { init_codefold(0); });
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> }</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="comment">// now make a limit (= 0) query for the same data</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="comment">// since we operate on the admin port, the limit</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="comment">// value of 0 is not adjusted into tuned ranges for admin requests</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="comment">// so we literally get 0 elements in that case. For non-admin</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="comment">// requests, we get limit defaults applied thus all our results</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="comment">// come back (we are below the min results limit)</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> jvParams[jss::limit] = 0u;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.rpc(</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; jro = jrr[jss::offers];</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keywordflow">if</span> (asAdmin)</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> {</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="comment">// limit == 0 is invalid</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> BEAST_EXPECT(jrr.isMember(jss::error_message));</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> {</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="comment">// Call should enforce min limit of 10</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> BEAST_EXPECT(<a class="code hl_function" href="namespaceripple_1_1test_1_1jtx.html#a0b328f21999f21f9d777cfc4c7b1c2ba">checkArraySize</a>(jro, 3u));</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> BEAST_EXPECT(!jrr.isMember(jss::marker));</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> }</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> }</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> }</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> jvParams[jss::limit] = 0u;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.rpc(</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> BEAST_EXPECT(jrr.isMember(jss::error_message));</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> }</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> }</div>
</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> </div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00222" data-start="{" data-end="}">
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"><a class="line" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba"> 222</a></span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">testBadInput</a>()</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> {</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <a class="code hl_variable" href="classbeast_1_1unit__test_1_1suite.html#aaa1237d9b85c69d35fe86645cee094b5">testcase</a>(<span class="stringliteral">&quot;Bad input&quot;</span>);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keyword">using namespace </span>jtx;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> <span class="keyword">const</span> gw(<span class="stringliteral">&quot;G1&quot;</span>);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keyword">auto</span> <span class="keyword">const</span> USD_gw = gw[<span class="stringliteral">&quot;USD&quot;</span>];</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> <span class="keyword">const</span> bob(<span class="stringliteral">&quot;bob&quot;</span>);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keyword">auto</span> <span class="keyword">const</span> USD_bob = bob[<span class="stringliteral">&quot;USD&quot;</span>];</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> </div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code hl_variable" href="namespaceripple_1_1test_1_1jtx.html#aea9cd3d4e6b5df2e62d53b34b605957e">XRP</a>(10000), gw, bob);</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#a90fecf3c0f6cdc1c40761e19917bf65a">trust</a>(USD_gw(1000), bob);</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> </div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> {</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="comment">// no account field</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(<span class="stringliteral">&quot;account_offers&quot;</span>);</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;badSyntax&quot;</span>);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Syntax error.&quot;</span>);</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> }</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> {</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="comment">// test account non-string</span></div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="keyword">auto</span> testInvalidAccountParam = [&amp;](<span class="keyword">auto</span> <span class="keyword">const</span>&amp; param) {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> params;</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> params[jss::account] = param;</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keyword">auto</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="stringliteral">&quot;json&quot;</span>, <span class="stringliteral">&quot;account_offers&quot;</span>, <a class="code hl_function" href="namespaceripple.html#ac124fe6744b7fe887dec949b56b16d50">to_string</a>(params))[jss::result];</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> jrr[jss::error_message] == <span class="stringliteral">&quot;Invalid field &#39;account&#39;.&quot;</span>);</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> };</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> </div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> testInvalidAccountParam(1);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> testInvalidAccountParam(1.1);</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> testInvalidAccountParam(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4ea7d9899633b4409bd3fc107e6737f8391">Json::nullValue</a>));</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>));</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>));</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> }</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> </div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> {</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <span class="comment">// empty string account</span></div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> jvParams[jss::account] = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;actMalformed&quot;</span>);</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Account malformed.&quot;</span>);</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> }</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> {</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="comment">// bogus account value</span></div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="stringliteral">&quot;account_offers&quot;</span>, <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">&quot;bogus&quot;</span>).human())[jss::result];</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;actNotFound&quot;</span>);</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Account not found.&quot;</span>);</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> }</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> </div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> {</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <span class="comment">// bad limit</span></div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> jvParams[jss::limit] = <span class="stringliteral">&quot;0&quot;</span>; <span class="comment">// NOT an integer</span></div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> jrr[jss::error_message] ==</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="stringliteral">&quot;Invalid field &#39;limit&#39;, not unsigned integer.&quot;</span>);</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> }</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> {</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="comment">// invalid marker</span></div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> jvParams[jss::marker] = <span class="stringliteral">&quot;NOT_A_MARKER&quot;</span>;</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> BEAST_EXPECTS(</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> jrr[jss::error_message] == <span class="stringliteral">&quot;Invalid field &#39;marker&#39;.&quot;</span>,</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> jrr.toStyledString());</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> }</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> </div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> {</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="comment">// invalid marker - not a string</span></div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> jvParams[jss::marker] = 1;</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> jrr[jss::error_message] ==</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <span class="stringliteral">&quot;Invalid field &#39;marker&#39;, not string.&quot;</span>);</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> }</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> </div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> {</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="comment">// ask for a bad ledger index</span></div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> jvParams[jss::ledger_index] = 10u;</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;lgrNotFound&quot;</span>);</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;ledgerNotFound&quot;</span>);</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> }</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> }</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00205" data-start="{" data-end="}">
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"><a class="line" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba"> 205</a></span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">testBadInput</a>()</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <a class="code hl_variable" href="classbeast_1_1unit__test_1_1suite.html#aaa1237d9b85c69d35fe86645cee094b5">testcase</a>(<span class="stringliteral">&quot;Bad input&quot;</span>);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> </div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keyword">using namespace </span>jtx;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Env.html">Env</a> env(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> <span class="keyword">const</span> gw(<span class="stringliteral">&quot;G1&quot;</span>);</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keyword">auto</span> <span class="keyword">const</span> USD_gw = gw[<span class="stringliteral">&quot;USD&quot;</span>];</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a> <span class="keyword">const</span> bob(<span class="stringliteral">&quot;bob&quot;</span>);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keyword">auto</span> <span class="keyword">const</span> USD_bob = bob[<span class="stringliteral">&quot;USD&quot;</span>];</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ae2349266cb09d1f1c3de06606ebdf9e2">fund</a>(<a class="code hl_variable" href="namespaceripple_1_1test_1_1jtx.html#aea9cd3d4e6b5df2e62d53b34b605957e">XRP</a>(10000), gw, bob);</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#a90fecf3c0f6cdc1c40761e19917bf65a">trust</a>(USD_gw(1000), bob);</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> </div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> {</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="comment">// no account field</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(<span class="stringliteral">&quot;account_offers&quot;</span>);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;badSyntax&quot;</span>);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Syntax error.&quot;</span>);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> }</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> </div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> {</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="comment">// test account non-string</span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keyword">auto</span> testInvalidAccountParam = [&amp;](<span class="keyword">auto</span> <span class="keyword">const</span>&amp; param) {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> params;</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> params[jss::account] = param;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keyword">auto</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="stringliteral">&quot;json&quot;</span>, <span class="stringliteral">&quot;account_offers&quot;</span>, <a class="code hl_function" href="namespaceripple.html#ac124fe6744b7fe887dec949b56b16d50">to_string</a>(params))[jss::result];</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> jrr[jss::error_message] == <span class="stringliteral">&quot;Invalid field &#39;account&#39;.&quot;</span>);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> };</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> testInvalidAccountParam(1);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> testInvalidAccountParam(1.1);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> testInvalidAccountParam(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4ea7d9899633b4409bd3fc107e6737f8391">Json::nullValue</a>));</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eae8386dcfc36d1ae897745f7b4f77a1f6">Json::objectValue</a>));</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> testInvalidAccountParam(<a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a>(<a class="code hl_enumvalue" href="namespaceJson.html#a7d654b75c16a57007925868e38212b4eadc8f264f36b55b063c78126b335415f4">Json::arrayValue</a>));</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> }</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> </div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> {</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="comment">// empty string account</span></div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> jvParams[jss::account] = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;actMalformed&quot;</span>);</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Account malformed.&quot;</span>);</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> }</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> {</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="comment">// bogus account value</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> <span class="stringliteral">&quot;account_offers&quot;</span>, <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1Account.html">Account</a>(<span class="stringliteral">&quot;bogus&quot;</span>).human())[jss::result];</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;actNotFound&quot;</span>);</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;Account not found.&quot;</span>);</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> }</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> {</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> <span class="comment">// bad limit</span></div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> jvParams[jss::limit] = <span class="stringliteral">&quot;0&quot;</span>; <span class="comment">// NOT an integer</span></div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> jrr[jss::error_message] ==</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> <span class="stringliteral">&quot;Invalid field &#39;limit&#39;, not unsigned integer.&quot;</span>);</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> }</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> </div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> {</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <span class="comment">// invalid marker</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> jvParams[jss::marker] = <span class="stringliteral">&quot;NOT_A_MARKER&quot;</span>;</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> BEAST_EXPECTS(</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> jrr[jss::error_message] == <span class="stringliteral">&quot;Invalid field &#39;marker&#39;.&quot;</span>,</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> jrr.toStyledString());</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> }</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> {</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <span class="comment">// invalid marker - not a string</span></div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> jvParams[jss::marker] = 1;</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;invalidParams&quot;</span>);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> BEAST_EXPECT(</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> jrr[jss::error_message] ==</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="stringliteral">&quot;Invalid field &#39;marker&#39;, not string.&quot;</span>);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> }</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> <span class="comment">// ask for a bad ledger index</span></div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <a class="code hl_class" href="classJson_1_1Value.html">Json::Value</a> jvParams;</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> jvParams[jss::account] = bob.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">human</a>();</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> jvParams[jss::ledger_index] = 10u;</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <span class="keyword">auto</span> <span class="keyword">const</span> jrr = env.<a class="code hl_function" href="classripple_1_1test_1_1jtx_1_1Env.html#ad69855b4b26fc3c83922c5783487592c">rpc</a>(</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> <span class="stringliteral">&quot;account_offers&quot;</span>,</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> jvParams.<a class="code hl_function" href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">toStyledString</a>())[jss::result];</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> BEAST_EXPECT(jrr[jss::error] == <span class="stringliteral">&quot;lgrNotFound&quot;</span>);</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> BEAST_EXPECT(jrr[jss::status] == <span class="stringliteral">&quot;error&quot;</span>);</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> BEAST_EXPECT(jrr[jss::error_message] == <span class="stringliteral">&quot;ledgerNotFound&quot;</span>);</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> }</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> }</div>
</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> </div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00350" data-start="{" data-end="}">
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"><a class="line" href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8"> 350</a></span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8">run</a>()<span class="keyword"> override</span></div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#aed512a9d5c17cf6c8078eea3d92ec1f6">testSequential</a>(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#aed512a9d5c17cf6c8078eea3d92ec1f6">testSequential</a>(<span class="keyword">false</span>);</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">testBadInput</a>();</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#a1dd22a83b252a2ceeb94afdce5128fad">testNonAdminMinLimit</a>();</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> }</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00333" data-start="{" data-end="}">
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"><a class="line" href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8"> 333</a></span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8">run</a>()<span class="keyword"> override</span></div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#aed512a9d5c17cf6c8078eea3d92ec1f6">testSequential</a>(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#aed512a9d5c17cf6c8078eea3d92ec1f6">testSequential</a>(<span class="keyword">false</span>);</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">testBadInput</a>();</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> <a class="code hl_function" href="classripple_1_1test_1_1AccountOffers__test.html#a1dd22a83b252a2ceeb94afdce5128fad">testNonAdminMinLimit</a>();</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> }</div>
</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span>};</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span>};</div>
</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> </div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"><a class="line" href="namespaceripple_1_1test.html#aa4f6524ea725f64802f10c412ad886ec"> 359</a></span>BEAST_DEFINE_TESTSUITE(AccountOffers, <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1rpc.html">rpc</a>, <a class="code hl_namespace" href="namespaceripple.html">ripple</a>);</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> </div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span>} <span class="comment">// namespace test</span></div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span>} <span class="comment">// namespace ripple</span></div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> </div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"><a class="line" href="namespaceripple_1_1test.html#aa4f6524ea725f64802f10c412ad886ec"> 342</a></span>BEAST_DEFINE_TESTSUITE(AccountOffers, <a class="code hl_class" href="classripple_1_1test_1_1jtx_1_1rpc.html">rpc</a>, <a class="code hl_namespace" href="namespaceripple.html">ripple</a>);</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span>} <span class="comment">// namespace test</span></div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span>} <span class="comment">// namespace ripple</span></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>
<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#l00148">json_value.h:149</a></div></div>
<div class="ttc" id="aclassJson_1_1Value_html_a3696d34c1a1833742b4bf8e5b247f125"><div class="ttname"><a href="classJson_1_1Value.html#a3696d34c1a1833742b4bf8e5b247f125">Json::Value::toStyledString</a></div><div class="ttdeci">std::string toStyledString() const</div><div class="ttdef"><b>Definition</b> <a href="json__value_8cpp_source.html#l01098">json_value.cpp:1098</a></div></div>
@@ -464,10 +447,10 @@ $(document).ready(function() { init_codefold(0); });
<div class="ttc" id="aclassbeast_1_1unit__test_1_1suite_html"><div class="ttname"><a href="classbeast_1_1unit__test_1_1suite.html">beast::unit_test::suite</a></div><div class="ttdoc">A testsuite class.</div><div class="ttdef"><b>Definition</b> <a href="suite_8h_source.html#l00054">suite.h:55</a></div></div>
<div class="ttc" id="aclassbeast_1_1unit__test_1_1suite_html_aaa1237d9b85c69d35fe86645cee094b5"><div class="ttname"><a href="classbeast_1_1unit__test_1_1suite.html#aaa1237d9b85c69d35fe86645cee094b5">beast::unit_test::suite::testcase</a></div><div class="ttdeci">testcase_t testcase</div><div class="ttdoc">Memberspace for declaring test cases.</div><div class="ttdef"><b>Definition</b> <a href="suite_8h_source.html#l00155">suite.h:155</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html">ripple::test::AccountOffers_test</a></div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00027">AccountOffers_test.cpp:28</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_a001ebfe19a9cf1b3d7c7bae7ae1e97f8"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8">ripple::test::AccountOffers_test::run</a></div><div class="ttdeci">void run() override</div><div class="ttdoc">Runs the suite.</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00350">AccountOffers_test.cpp:350</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_a001ebfe19a9cf1b3d7c7bae7ae1e97f8"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#a001ebfe19a9cf1b3d7c7bae7ae1e97f8">ripple::test::AccountOffers_test::run</a></div><div class="ttdeci">void run() override</div><div class="ttdoc">Runs the suite.</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00333">AccountOffers_test.cpp:333</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_a1dd22a83b252a2ceeb94afdce5128fad"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#a1dd22a83b252a2ceeb94afdce5128fad">ripple::test::AccountOffers_test::testNonAdminMinLimit</a></div><div class="ttdeci">void testNonAdminMinLimit()</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00039">AccountOffers_test.cpp:39</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_a72c1eaa56d182497bff0b9a4ad9a5eed"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#a72c1eaa56d182497bff0b9a4ad9a5eed">ripple::test::AccountOffers_test::checkMarker</a></div><div class="ttdeci">static bool checkMarker(Json::Value const &amp;val)</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00032">AccountOffers_test.cpp:32</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_ac7c9d773bc407eb60f7e323b12916bba"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">ripple::test::AccountOffers_test::testBadInput</a></div><div class="ttdeci">void testBadInput()</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00222">AccountOffers_test.cpp:222</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_ac7c9d773bc407eb60f7e323b12916bba"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#ac7c9d773bc407eb60f7e323b12916bba">ripple::test::AccountOffers_test::testBadInput</a></div><div class="ttdeci">void testBadInput()</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00205">AccountOffers_test.cpp:205</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1AccountOffers__test_html_aed512a9d5c17cf6c8078eea3d92ec1f6"><div class="ttname"><a href="classripple_1_1test_1_1AccountOffers__test.html#aed512a9d5c17cf6c8078eea3d92ec1f6">ripple::test::AccountOffers_test::testSequential</a></div><div class="ttdeci">void testSequential(bool asAdmin)</div><div class="ttdef"><b>Definition</b> <a href="AccountOffers__test_8cpp_source.html#l00085">AccountOffers_test.cpp:85</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#l00038">Account.h:39</a></div></div>
<div class="ttc" id="aclassripple_1_1test_1_1jtx_1_1Account_html_af418ef1752815f3b0d0c80e7e9891004"><div class="ttname"><a href="classripple_1_1test_1_1jtx_1_1Account.html#af418ef1752815f3b0d0c80e7e9891004">ripple::test::jtx::Account::human</a></div><div class="ttdeci">std::string const &amp; human() const</div><div class="ttdoc">Returns the human readable public key.</div><div class="ttdef"><b>Definition</b> <a href="Account_8h_source.html#l00118">Account.h:118</a></div></div>