xrpld
Loading...
Searching...
No Matches
LoanMisc_test.cpp
1#include <test/app/lending/LoanTestBase.h>
2#include <test/jtx/Account.h>
3#include <test/jtx/Env.h>
4#include <test/jtx/TestHelpers.h>
5#include <test/jtx/amount.h>
6#include <test/jtx/fee.h>
7#include <test/jtx/mpt.h>
8#include <test/jtx/noop.h>
9#include <test/jtx/offer.h>
10#include <test/jtx/pay.h>
11#include <test/jtx/seq.h>
12#include <test/jtx/sig.h>
13#include <test/jtx/tags.h>
14#include <test/jtx/ter.h>
15
16#include <xrpl/basics/Number.h>
17#include <xrpl/beast/unit_test/suite.h>
18#include <xrpl/beast/xor_shift_engine.h>
19#include <xrpl/json/json_value.h>
20#include <xrpl/json/to_string.h>
21#include <xrpl/protocol/ErrorCodes.h>
22#include <xrpl/protocol/Feature.h>
23#include <xrpl/protocol/Indexes.h>
24#include <xrpl/protocol/KeyType.h>
25#include <xrpl/protocol/SField.h>
26#include <xrpl/protocol/SeqProxy.h>
27#include <xrpl/protocol/TER.h>
28#include <xrpl/protocol/TxFlags.h>
29#include <xrpl/protocol/Units.h>
30#include <xrpl/protocol/jss.h>
31
32#include <algorithm>
33#include <cstddef>
34#include <cstdint>
35#include <random>
36#include <string>
37
38namespace xrpl::test {
39
41{
42private:
43 void
45 {
46 // This will expand as more test cases are added. Some functionality
47 // is tested in other test functions.
48 testcase("RPC");
49
50 using namespace jtx;
51
52 Env env(*this, features);
53
54 auto const lowerFee = [&] {
55 // Run the local fee back down.
56 while (env.app().getFeeTrack().lowerLocalFee())
57 ;
58 };
59
60 auto const baseFee = env.current()->fees().base;
61
62 Account const alice{"alice"};
63 std::string const borrowerPass = "borrower";
64 Account const borrower{borrowerPass, KeyType::Ed25519};
65 auto const lenderPass = "lender";
66 Account const lender{lenderPass, KeyType::Ed25519};
67
68 env.fund(XRP(1'000'000), alice, lender, borrower);
69 env.close();
70 env(noop(lender));
71 env(noop(lender));
72 env(noop(lender));
73 env(noop(lender));
74 env(noop(lender));
75 env.close();
76
77 {
78 testcase("RPC AccountSet");
80 txJson[sfTransactionType] = "AccountSet";
81 txJson[sfAccount] = borrower.human();
82
83 auto const signParams = [&] {
85 signParams[jss::passphrase] = borrowerPass;
86 signParams[jss::key_type] = "ed25519";
87 signParams[jss::tx_json] = txJson;
88 return signParams;
89 }();
90 auto const jSign = env.rpc("json", "sign", to_string(signParams));
91 BEAST_EXPECT(jSign.isMember(jss::result) && jSign[jss::result].isMember(jss::tx_json));
92 auto txSignResult = jSign[jss::result][jss::tx_json];
93 auto const txSignBlob = jSign[jss::result][jss::tx_blob].asString();
94 txSignResult.removeMember(jss::hash);
95
96 auto const jtx = env.jt(txJson, Sig(borrower));
97 BEAST_EXPECT(txSignResult == jtx.jv);
98
99 lowerFee();
100 auto const jSubmit = env.rpc("submit", txSignBlob);
101 BEAST_EXPECT(
102 jSubmit.isMember(jss::result) &&
103 jSubmit[jss::result].isMember(jss::engine_result) &&
104 jSubmit[jss::result][jss::engine_result].asString() == "tesSUCCESS");
105
106 lowerFee();
107 env(jtx.jv, Sig(kNone), Seq(kNone), Fee(kNone), Ter(tefPAST_SEQ));
108 }
109
110 {
111 testcase("RPC LoanSet - illegal signature_target");
112
114 txJson[sfTransactionType] = "AccountSet";
115 txJson[sfAccount] = borrower.human();
116
117 // "Destination" is not an inner object at all. "Book" is one, but
118 // it holds no transaction signature, so it is not a target either.
119 for (char const* target : {"Destination", "Book", "Signer"})
120 {
121 auto const borrowerSignParams = [&] {
123 params[jss::passphrase] = borrowerPass;
124 params[jss::key_type] = "ed25519";
125 params[jss::signature_target] = target;
126 params[jss::tx_json] = txJson;
127 return params;
128 }();
129 auto const jSignBorrower = env.rpc("json", "sign", to_string(borrowerSignParams));
130 BEAST_EXPECT(jSignBorrower[jss::result][jss::error] == "invalidParams");
131 BEAST_EXPECT(jSignBorrower[jss::result][jss::error_code] == RpcInvalidParams);
132 BEAST_EXPECT(jSignBorrower[jss::result][jss::error_message] == target);
133 }
134 }
135 {
136 testcase("RPC LoanSet - sign and submit borrower initiated");
137 // 1. Borrower creates the transaction
139 txJson[sfTransactionType] = "LoanSet";
140 txJson[sfAccount] = borrower.human();
141 txJson[sfCounterparty] = lender.human();
142 txJson[sfLoanBrokerID] =
143 "FF924CD18A236C2B49CF8E80A351CEAC6A10171DC9F110025646894FEC"
144 "F83F"
145 "5C";
146 txJson[sfPrincipalRequested] = "100000000";
147 txJson[sfPaymentTotal] = 10000;
148 txJson[sfPaymentInterval] = 3600;
149 txJson[sfGracePeriod] = 300;
150 txJson[sfFlags] = 65536; // tfLoanOverpayment
151 txJson[sfFee] = to_string(24 * baseFee / 10);
152
153 // 2. Borrower signs the transaction
154 auto const borrowerSignParams = [&] {
156 params[jss::passphrase] = borrowerPass;
157 params[jss::key_type] = "ed25519";
158 params[jss::tx_json] = txJson;
159 return params;
160 }();
161 auto const jSignBorrower = env.rpc("json", "sign", to_string(borrowerSignParams));
162 BEAST_EXPECTS(
163 jSignBorrower.isMember(jss::result) &&
164 jSignBorrower[jss::result].isMember(jss::tx_json),
165 to_string(jSignBorrower));
166 auto const txBorrowerSignResult = jSignBorrower[jss::result][jss::tx_json];
167 auto const txBorrowerSignBlob = jSignBorrower[jss::result][jss::tx_blob].asString();
168
169 // 2a. Borrower attempts to submit the transaction. It doesn't
170 // work
171 {
172 lowerFee();
173 auto const jSubmitBlob = env.rpc("submit", txBorrowerSignBlob);
174 BEAST_EXPECT(jSubmitBlob.isMember(jss::result));
175 auto const jSubmitBlobResult = jSubmitBlob[jss::result];
176 BEAST_EXPECT(jSubmitBlobResult.isMember(jss::tx_json));
177 // Transaction fails because the CounterpartySignature is
178 // missing
179 BEAST_EXPECT(
180 jSubmitBlobResult.isMember(jss::engine_result) &&
181 jSubmitBlobResult[jss::engine_result].asString() == "temBAD_SIGNER");
182 }
183
184 // 3. Borrower sends the signed transaction to the lender
185 // 4. Lender signs the transaction
186 auto const lenderSignParams = [&] {
188 params[jss::passphrase] = lenderPass;
189 params[jss::key_type] = "ed25519";
190 params[jss::signature_target] = "CounterpartySignature";
191 params[jss::tx_json] = txBorrowerSignResult;
192 return params;
193 }();
194 auto const jSignLender = env.rpc("json", "sign", to_string(lenderSignParams));
195 BEAST_EXPECT(
196 jSignLender.isMember(jss::result) &&
197 jSignLender[jss::result].isMember(jss::tx_json));
198 auto const txLenderSignResult = jSignLender[jss::result][jss::tx_json];
199 auto const txLenderSignBlob = jSignLender[jss::result][jss::tx_blob].asString();
200
201 // 5. Lender submits the signed transaction blob
202 lowerFee();
203 auto const jSubmitBlob = env.rpc("submit", txLenderSignBlob);
204 BEAST_EXPECT(jSubmitBlob.isMember(jss::result));
205 auto const jSubmitBlobResult = jSubmitBlob[jss::result];
206 BEAST_EXPECT(jSubmitBlobResult.isMember(jss::tx_json));
207 auto const jSubmitBlobTx = jSubmitBlobResult[jss::tx_json];
208 // To get far enough to return tecNO_ENTRY means that the
209 // signatures all validated. Of course the transaction won't
210 // succeed because no Vault or Broker were created.
211 BEAST_EXPECTS(
212 jSubmitBlobResult.isMember(jss::engine_result) &&
213 jSubmitBlobResult[jss::engine_result].asString() == "tecNO_ENTRY",
214 to_string(jSubmitBlobResult));
215
216 BEAST_EXPECT(
217 !jSubmitBlob.isMember(jss::error) && !jSubmitBlobResult.isMember(jss::error));
218
219 // 4-alt. Lender submits the transaction json originally
220 // received from the Borrower. It gets signed, but is now a
221 // duplicate, so fails. Borrower could done this instead of
222 // steps 4 and 5.
223 lowerFee();
224 auto const jSubmitJson = env.rpc("json", "submit", to_string(lenderSignParams));
225 BEAST_EXPECT(jSubmitJson.isMember(jss::result));
226 auto const jSubmitJsonResult = jSubmitJson[jss::result];
227 BEAST_EXPECT(jSubmitJsonResult.isMember(jss::tx_json));
228 auto const jSubmitJsonTx = jSubmitJsonResult[jss::tx_json];
229 // Since the previous tx claimed a fee, this duplicate is not
230 // going anywhere
231 BEAST_EXPECTS(
232 jSubmitJsonResult.isMember(jss::engine_result) &&
233 jSubmitJsonResult[jss::engine_result].asString() == "tefPAST_SEQ",
234 to_string(jSubmitJsonResult));
235
236 BEAST_EXPECT(
237 !jSubmitJson.isMember(jss::error) && !jSubmitJsonResult.isMember(jss::error));
238
239 BEAST_EXPECT(jSubmitBlobTx == jSubmitJsonTx);
240 }
241
242 {
243 testcase("RPC LoanSet - sign and submit lender initiated");
244 // 1. Lender creates the transaction
246 txJson[sfTransactionType] = "LoanSet";
247 txJson[sfAccount] = lender.human();
248 txJson[sfCounterparty] = borrower.human();
249 txJson[sfLoanBrokerID] =
250 "FF924CD18A236C2B49CF8E80A351CEAC6A10171DC9F110025646894FEC"
251 "F83F"
252 "5C";
253 txJson[sfPrincipalRequested] = "100000000";
254 txJson[sfPaymentTotal] = 10000;
255 txJson[sfPaymentInterval] = 3600;
256 txJson[sfGracePeriod] = 300;
257 txJson[sfFlags] = 65536; // tfLoanOverpayment
258 txJson[sfFee] = to_string(24 * baseFee / 10);
259
260 // 2. Lender signs the transaction
261 auto const lenderSignParams = [&] {
263 params[jss::passphrase] = lenderPass;
264 params[jss::key_type] = "ed25519";
265 params[jss::tx_json] = txJson;
266 return params;
267 }();
268 auto const jSignLender = env.rpc("json", "sign", to_string(lenderSignParams));
269 BEAST_EXPECT(
270 jSignLender.isMember(jss::result) &&
271 jSignLender[jss::result].isMember(jss::tx_json));
272 auto const txLenderSignResult = jSignLender[jss::result][jss::tx_json];
273 auto const txLenderSignBlob = jSignLender[jss::result][jss::tx_blob].asString();
274
275 // 2a. Lender attempts to submit the transaction. It doesn't
276 // work
277 {
278 lowerFee();
279 auto const jSubmitBlob = env.rpc("submit", txLenderSignBlob);
280 BEAST_EXPECT(jSubmitBlob.isMember(jss::result));
281 auto const jSubmitBlobResult = jSubmitBlob[jss::result];
282 BEAST_EXPECT(jSubmitBlobResult.isMember(jss::tx_json));
283 // Transaction fails because the CounterpartySignature is
284 // missing
285 BEAST_EXPECT(
286 jSubmitBlobResult.isMember(jss::engine_result) &&
287 jSubmitBlobResult[jss::engine_result].asString() == "temBAD_SIGNER");
288 }
289
290 // 3. Lender sends the signed transaction to the Borrower
291 // 4. Borrower signs the transaction
292 auto const borrowerSignParams = [&] {
294 params[jss::passphrase] = borrowerPass;
295 params[jss::key_type] = "ed25519";
296 params[jss::signature_target] = "CounterpartySignature";
297 params[jss::tx_json] = txLenderSignResult;
298 return params;
299 }();
300 auto const jSignBorrower = env.rpc("json", "sign", to_string(borrowerSignParams));
301 BEAST_EXPECT(
302 jSignBorrower.isMember(jss::result) &&
303 jSignBorrower[jss::result].isMember(jss::tx_json));
304 auto const txBorrowerSignResult = jSignBorrower[jss::result][jss::tx_json];
305 auto const txBorrowerSignBlob = jSignBorrower[jss::result][jss::tx_blob].asString();
306
307 // 5. Borrower submits the signed transaction blob
308 lowerFee();
309 auto const jSubmitBlob = env.rpc("submit", txBorrowerSignBlob);
310 BEAST_EXPECT(jSubmitBlob.isMember(jss::result));
311 auto const jSubmitBlobResult = jSubmitBlob[jss::result];
312 BEAST_EXPECT(jSubmitBlobResult.isMember(jss::tx_json));
313 auto const jSubmitBlobTx = jSubmitBlobResult[jss::tx_json];
314 // To get far enough to return tecNO_ENTRY means that the
315 // signatures all validated. Of course the transaction won't
316 // succeed because no Vault or Broker were created.
317 BEAST_EXPECTS(
318 jSubmitBlobResult.isMember(jss::engine_result) &&
319 jSubmitBlobResult[jss::engine_result].asString() == "tecNO_ENTRY",
320 to_string(jSubmitBlobResult));
321
322 BEAST_EXPECT(
323 !jSubmitBlob.isMember(jss::error) && !jSubmitBlobResult.isMember(jss::error));
324
325 // 4-alt. Borrower submits the transaction json originally
326 // received from the Lender. It gets signed, but is now a
327 // duplicate, so fails. Lender could done this instead of steps
328 // 4 and 5.
329 lowerFee();
330 auto const jSubmitJson = env.rpc("json", "submit", to_string(borrowerSignParams));
331 BEAST_EXPECT(jSubmitJson.isMember(jss::result));
332 auto const jSubmitJsonResult = jSubmitJson[jss::result];
333 BEAST_EXPECT(jSubmitJsonResult.isMember(jss::tx_json));
334 auto const jSubmitJsonTx = jSubmitJsonResult[jss::tx_json];
335 // Since the previous tx claimed a fee, this duplicate is not
336 // going anywhere
337 BEAST_EXPECTS(
338 jSubmitJsonResult.isMember(jss::engine_result) &&
339 jSubmitJsonResult[jss::engine_result].asString() == "tefPAST_SEQ",
340 to_string(jSubmitJsonResult));
341
342 BEAST_EXPECT(
343 !jSubmitJson.isMember(jss::error) && !jSubmitJsonResult.isMember(jss::error));
344
345 BEAST_EXPECT(jSubmitBlobTx == jSubmitJsonTx);
346 }
347 }
348
349 void
351 {
352 testcase("Lending: CanTrade disabled has no impact");
353 using namespace jtx;
354 using namespace loan;
355 using namespace loan_broker;
356
357 Env env(*this, all_);
358
359 Account const issuer{"issuer"};
360 Account const lender{"lender"};
361 Account const borrower{"borrower"};
362
363 env.fund(XRP(1'000'000), issuer, lender, borrower);
364 env.close();
365
366 MPTTester mpt({
367 .env = env,
368 .issuer = issuer,
369 .holders = {lender, borrower},
370 .flags = tfMPTCanTransfer | tfMPTCanLock,
371 });
372 PrettyAsset const asset = mpt.issuanceID();
373 env(pay(issuer, lender, asset(10'000'000)));
374 env(pay(issuer, borrower, asset(100'000)));
375 env.close();
376
377 auto const broker = createVaultAndBroker(env, asset, lender);
378
379 // CanTrade is not set
380 env(offer(lender, XRP(1), asset(10)), Ter{tecNO_PERMISSION});
381 env.close();
382
383 auto const loanSetFee = Fee(env.current()->fees().base * 2);
384
385 // New cover deposits still work.
386 env(coverDeposit(lender, broker.brokerID, asset(100)));
387 env.close();
388
389 // New loan issuance still works.
390 env(loan::set(borrower, broker.brokerID, 1'000),
391 Sig(sfCounterpartySignature, lender),
392 loanSetFee);
393 env.close();
394 auto const loanKeylet = keylet::loan(broker.brokerID, SeqProxy::rawSequence(1));
395 BEAST_EXPECT(env.le(loanKeylet));
396
397 // Repayment still works.
398 env(pay(borrower, loanKeylet.key, asset(1'000)));
399 env.close();
400
401 // Cover withdrawal still works.
402 env(coverWithdraw(lender, broker.brokerID, asset(100)));
403 env.close();
404
405 // Enable CanTrade and verify the DEX path is restored.
406 mpt.set({.flags = tfMPTSetCanTrade});
407 env.close();
408
409 env(offer(lender, XRP(1), asset(10)));
410 env.close();
411 }
412
413 void
418
419 // Tests run under each entry in amendmentCombinations().
420 void
422 {
423 testRPC(features);
424 }
425
426public:
427 void
428 run() override
429 {
431 for (auto const& features : jtx::amendmentCombinations(
432 {fixCleanup3_1_3, fixCleanup3_2_0, featureMPTokensV2}, all_))
433 runAmendmentSensitive(features);
434 }
435};
436
438{
439protected:
441
449 /*
450 # Generate parameters that are more likely to be valid
451 principal = Decimal(str(rand.randint(100000,
452 100'000'000))).quantize(ROUND_TARGET)
453
454 interest_rate = Decimal(rand.randint(1, 10000)) /
455 Decimal(100000)
456
457 payment_total = rand.randint(12, 10000)
458
459 payment_interval = Decimal(str(rand.randint(60, 2629746)))
460
461 interest_fee = Decimal(rand.randint(0, 100000)) /
462 Decimal(100000)
463*/
464
465 void
467 {
468 using namespace jtx;
469
470 Account const issuer("issuer");
471 Account const lender("lender");
472 Account const borrower("borrower");
473
474 // Determine all the random parameters at once
475 auto const assetType = static_cast<AssetType>(assetDist_(engine_));
476 auto const principalRequest = principalDist_(engine_);
477 TenthBips16 const managementFeeRate{managementFeeRateDist_(engine_)};
478 auto const serviceFee = serviceFeeDist_(engine_);
480 auto payTotal = paymentTotalDist_(engine_);
481 auto const payInterval = paymentIntervalDist_(engine_);
482 // The end of the last payment's grace period must fit in a 32-bit
483 // ripple-epoch timestamp, or LoanSet fails with tecKILLED. Cap the
484 // schedule well below that horizon (2e9 seconds is roughly 63 years,
485 // leaving ample headroom over the ledger start date).
486 constexpr std::uint32_t kMaxScheduleSeconds = 2'000'000'000;
487 payTotal = std::min(payTotal, static_cast<int>(kMaxScheduleSeconds / payInterval));
488
489 BrokerParameters const brokerParams{
490 .vaultDeposit = principalRequest * 10,
491 .debtMax = 0,
492 .coverRateMin = TenthBips32{0},
493 .managementFeeRate = managementFeeRate,
494 .coverRateLiquidation = TenthBips32{0},
495 };
496 LoanParameters const loanParams{
497 .account = lender,
498 .counter = borrower,
499 .principalRequest = principalRequest,
500 .serviceFee = serviceFee,
501 .interest = interest,
502 .payTotal = payTotal,
503 .payInterval = payInterval,
504 };
505
506 runLoan(assetType, brokerParams, loanParams, all_);
507 }
508
509public:
510 void
511 run() override
512 {
513 auto const numIterations = [s = arg()] -> int {
514 int const defaultNum = 5;
515 if (s.empty())
516 return defaultNum;
517 try
518 {
519 std::size_t pos = 0;
520 auto const r = stoi(s, &pos);
521 if (pos != s.size())
522 return defaultNum;
523 return r;
524 }
525 catch (...)
526 {
527 return defaultNum;
528 }
529 }();
530
531 using namespace jtx;
532
533 auto const updateInterval = std::max(std::min(numIterations / 5, 100), 1);
534
535 for (int i = 0; i < numIterations; ++i)
536 {
537 if (i % updateInterval == 0)
538 testcase << "Random Loan Test iteration " << (i + 1) << "/" << numIterations;
540 }
541 }
542};
545{
546 void
547 run() override
548 {
549 using namespace jtx;
550
551 BrokerParameters const brokerParams{
552 .vaultDeposit = 10000,
553 .debtMax = 0,
554 .coverRateMin = TenthBips32{0},
555 .managementFeeRate = TenthBips16{0},
556 .coverRateLiquidation = TenthBips32{0},
557 };
558 LoanParameters const loanParams{
559 .account = Account("lender"),
560 .counter = Account("borrower"),
561 .principalRequest = Number{200000, -6},
562 .interest = TenthBips32{50000},
563 .payTotal = 2,
564 .payInterval = 200,
565 };
566
567 runLoan(AssetType::XRP, brokerParams, loanParams, all_);
568 }
569};
573BEAST_DEFINE_TESTSUITE_MANUAL(LoanArbitrary, tx, xrpl);
574
575} // namespace xrpl::test
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
std::string const & arg() const
Return the argument associated with the runner.
Definition suite.h:292
Represents a JSON value.
Definition json_value.h:121
Number is a floating point type that can represent a wide range of values.
Definition Number.h:351
static constexpr SeqProxy rawSequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
Definition SeqProxy.h:62
virtual LoadFeeTrack & getFeeTrack()=0
void run() override
Runs the suite.
std::uniform_int_distribution paymentIntervalDist_
std::uniform_int_distribution paymentTotalDist_
std::uniform_int_distribution< std::int64_t > principalDist_
void run() override
Runs the suite.
std::uniform_int_distribution< std::uint16_t > managementFeeRateDist_
beast::XorShiftEngine engine_
std::uniform_int_distribution serviceFeeDist_
std::uniform_int_distribution< std::uint32_t > interestRateDist_
std::uniform_int_distribution assetDist_
void runAmendmentSensitive(FeatureBitset features)
void run() override
Runs the suite.
void testRPC(FeatureBitset features)
Shared base for the Loan*_test family under src/test/app/lending/.
FeatureBitset const all_
void runLoan(AssetType assetType, BrokerParameters const &brokerParams, LoanParameters const &loanParams, FeatureBitset features)
BrokerInfo createVaultAndBroker(jtx::Env &env, jtx::PrettyAsset const &asset, jtx::Account const &lender, BrokerParameters const &params=BrokerParameters::defaults())
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
Definition Env.h:161
Application & app()
Definition Env.h:300
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition Env.cpp:133
SLE::const_pointer le(Account const &account) const
Return an account root.
Definition Env.cpp:311
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition Env.cpp:323
json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Definition Env.h:1058
JTx jt(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
Definition Env.h:723
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition Env.h:377
Set the fee on a JTx.
Definition fee.h:20
Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state.
Definition mpt.h:512
Set the regular signature on a JTx.
Definition sig.h:19
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition ter.h:18
T max(T... args)
T min(T... args)
detail::XorShiftEngine<> XorShiftEngine
XOR-shift Generator.
@ Object
object value (collection of name/value pairs).
Definition json_value.h:33
Keylet loan(UInt256 const &loanBrokerID, SeqProxy const &loanSeq) noexcept
Definition Indexes.cpp:577
json::Value set(AccountID const &account, UInt256 const &loanBrokerID, Number principalRequested, std::uint32_t flags)
static NoneT const kNone
Definition tags.h:9
json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:14
std::vector< FeatureBitset > amendmentCombinations(std::initializer_list< UInt256 > features, FeatureBitset seed)
Returns all 2^N permutations of a seed FeatureBitset with each subset of the given features excluded.
Definition Env.h:123
XrpT const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
json::Value noop(Account const &account)
The null transaction.
Definition noop.h:14
json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:14
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
BEAST_DEFINE_TESTSUITE_MANUAL(AMMCalc, app, xrpl)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ RpcInvalidParams
Definition ErrorCodes.h:67
@ tefPAST_SEQ
Definition TER.h:169
TenthBips< std::uint32_t > TenthBips32
Definition Units.h:454
TenthBips< std::uint16_t > TenthBips16
Definition Units.h:453
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:658
@ tecNO_PERMISSION
Definition TER.h:316
Set the sequence number on a JTx.
Definition seq.h:16