xrpld
Loading...
Searching...
No Matches
Directory_test.cpp
1
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/credentials.h>
7#include <test/jtx/directory.h>
8#include <test/jtx/multisign.h>
9#include <test/jtx/noop.h>
10#include <test/jtx/offer.h>
11#include <test/jtx/owners.h> // IWYU pragma: keep
12#include <test/jtx/pay.h>
13#include <test/jtx/tags.h>
14#include <test/jtx/ter.h>
15#include <test/jtx/trust.h>
16
17#include <xrpl/basics/base_uint.h>
18#include <xrpl/basics/random.h>
19#include <xrpl/beast/unit_test/suite.h>
20#include <xrpl/core/ServiceRegistry.h>
21#include <xrpl/json/json_value.h>
22#include <xrpl/json/to_string.h>
23#include <xrpl/ledger/ApplyView.h>
24#include <xrpl/ledger/Sandbox.h>
25#include <xrpl/ledger/helpers/DirectoryHelpers.h>
26#include <xrpl/protocol/Book.h>
27#include <xrpl/protocol/Feature.h>
28#include <xrpl/protocol/Indexes.h>
29#include <xrpl/protocol/Issue.h>
30#include <xrpl/protocol/LedgerFormats.h>
31#include <xrpl/protocol/Protocol.h>
32#include <xrpl/protocol/SField.h>
33#include <xrpl/protocol/TER.h>
34#include <xrpl/protocol/jss.h>
35
36#include <algorithm>
37#include <cstddef>
38#include <cstdint>
39#include <limits>
40#include <memory>
41#include <optional>
42#include <string>
43#include <tuple>
44#include <vector>
45
46namespace xrpl::test {
47
49{
50 // Map [0-15576] into a unique 3 letter currency code
53 {
54 // There are only 17576 possible combinations
55 BEAST_EXPECT(i < 17577);
56
57 std::string code;
58
59 for (int j = 0; j != 3; ++j)
60 {
61 code.push_back('A' + (i % 26));
62 i /= 26;
63 }
64
65 return code;
66 }
67
68 // Insert n empty pages, numbered [0, ... n - 1], in the
69 // specified directory:
70 static void
72 {
73 for (std::uint64_t i = 0; i < n; ++i)
74 {
75 auto const p = std::make_shared<SLE>(keylet::page(base, i));
76
77 p->setFieldV256(sfIndexes, STVector256{});
78
79 if (i + 1 == n)
80 {
81 p->setFieldU64(sfIndexNext, 0);
82 }
83 else
84 {
85 p->setFieldU64(sfIndexNext, i + 1);
86 }
87
88 if (i == 0)
89 {
90 p->setFieldU64(sfIndexPrevious, n - 1);
91 }
92 else
93 {
94 p->setFieldU64(sfIndexPrevious, i - 1);
95 }
96
97 sb.insert(p);
98 }
99 }
100
101 void
103 {
104 using namespace jtx;
105
106 auto const gw = Account("gw");
107 auto const usd = gw["USD"];
108 auto const alice = Account("alice");
109 auto const bob = Account("bob");
110
111 testcase("Directory Ordering (with 'SortedDirectories' amendment)");
112
113 Env env(*this);
114 env.fund(XRP(10000000), alice, gw);
115
116 std::uint32_t const firstOfferSeq{env.seq(alice)};
117 for (std::size_t i = 1; i <= 400; ++i)
118 env(offer(alice, usd(i), XRP(i)));
119 env.close();
120
121 // Check Alice's directory: it should contain one
122 // entry for each offer she added, and, within each
123 // page the entries should be in sorted order.
124 {
125 auto const view = env.closed();
126
127 std::uint64_t page = 0;
128
129 do
130 {
131 auto const p = view->read(keylet::page(keylet::ownerDir(alice), page));
132
133 // Ensure that the entries in the page are sorted
134 auto const& v = p->getFieldV256(sfIndexes);
135 BEAST_EXPECT(std::ranges::is_sorted(v));
136
137 // Ensure that the page contains the correct orders by
138 // calculating which sequence numbers belong here.
139 std::uint32_t const minSeq = firstOfferSeq + (page * kDirNodeMaxEntries);
140 std::uint32_t const maxSeq = minSeq + kDirNodeMaxEntries;
141
142 for (auto const& e : v)
143 {
144 auto const c = view->read(keylet::child(e));
145 BEAST_EXPECT(c);
146 BEAST_EXPECT(c->getFieldU32(sfSequence) >= minSeq);
147 BEAST_EXPECT(c->getFieldU32(sfSequence) < maxSeq);
148 }
149
150 page = p->getFieldU64(sfIndexNext);
151 } while (page != 0);
152 }
153 }
154
155 void
157 {
158 testcase("dirIsEmpty");
159
160 using namespace jtx;
161 auto const alice = Account("alice");
162 auto const bob = Account("bob");
163 auto const charlie = Account("charlie");
164 auto const gw = Account("gw");
165
166 Env env(*this);
167
168 env.fund(XRP(1000000), alice, charlie, gw);
169 env.close();
170
171 // alice should have an empty directory.
172 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
173
174 // Give alice a signer list, then there will be stuff in the directory.
175 env(signers(alice, 1, {{bob, 1}}));
176 env.close();
177 BEAST_EXPECT(!dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
178
179 env(signers(alice, jtx::kNone));
180 env.close();
181 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
182
183 std::vector<IOU> const currencies = [this, &gw] {
185
186 c.reserve((2 * kDirNodeMaxEntries) + 3);
187
188 while (c.size() != c.capacity())
189 c.push_back(gw[currcode(c.size())]);
190
191 return c;
192 }();
193
194 // First, Alice creates a lot of trustlines, and then
195 // deletes them in a different order:
196 {
197 auto cl = currencies;
198
199 for (auto const& c : cl)
200 {
201 env(trust(alice, c(50)));
202 env.close();
203 }
204
205 BEAST_EXPECT(!dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
206
207 std::shuffle(cl.begin(), cl.end(), defaultPrng());
208
209 for (auto const& c : cl)
210 {
211 env(trust(alice, c(0)));
212 env.close();
213 }
214
215 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
216 }
217
218 // Now, Alice creates offers to buy currency, creating
219 // implicit trust lines.
220 {
221 auto cl = currencies;
222
223 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
224
225 for (auto const& c : currencies)
226 {
227 env(trust(charlie, c(50)));
228 env.close();
229 env(pay(gw, charlie, c(50)));
230 env.close();
231 env(offer(alice, c(50), XRP(50)));
232 env.close();
233 }
234
235 BEAST_EXPECT(!dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
236
237 // Now fill the offers in a random order. Offer
238 // entries will drop, and be replaced by trust
239 // lines that are implicitly created.
240 std::shuffle(cl.begin(), cl.end(), defaultPrng());
241
242 for (auto const& c : cl)
243 {
244 env(offer(charlie, XRP(50), c(50)));
245 env.close();
246 }
247 BEAST_EXPECT(!dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
248 // Finally, Alice now sends the funds back to
249 // Charlie. The implicitly created trust lines
250 // should drop away:
251 std::shuffle(cl.begin(), cl.end(), defaultPrng());
252
253 for (auto const& c : cl)
254 {
255 env(pay(alice, charlie, c(50)));
256 env.close();
257 }
258
259 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
260 }
261 }
262
263 void
265 {
266 testcase("RIPD-1353 Empty Offer Directories");
267
268 using namespace jtx;
269 Env env(*this);
270
271 auto const gw = Account{"gateway"};
272 auto const alice = Account{"alice"};
273 auto const usd = gw["USD"];
274
275 env.fund(XRP(10000), alice, gw);
276 env.close();
277 env.trust(usd(1000), alice);
278 env(pay(gw, alice, usd(1000)));
279
280 auto const firstOfferSeq = env.seq(alice);
281
282 // Fill up three pages of offers
283 for (int i = 0; i < 3; ++i)
284 {
285 for (int j = 0; j < kDirNodeMaxEntries; ++j)
286 env(offer(alice, XRP(1), usd(1)));
287 }
288 env.close();
289
290 // remove all the offers. Remove the middle page last
291 for (auto const page : {0, 2, 1})
292 {
293 for (int i = 0; i < kDirNodeMaxEntries; ++i)
294 {
295 env(offerCancel(alice, firstOfferSeq + (page * kDirNodeMaxEntries) + i));
296 env.close();
297 }
298 }
299
300 // All the offers have been cancelled, so the book
301 // should have no entries and be empty:
302 {
303 Sandbox const sb(env.closed().get(), TapNone);
304 UInt256 const bookBase = getBookBase({xrpIssue(), usd, std::nullopt});
305
306 BEAST_EXPECT(dirIsEmpty(sb, keylet::page(bookBase)));
307 BEAST_EXPECT(!sb.succ(bookBase, getQualityNext(bookBase)));
308 }
309
310 // Alice returns the USD she has to the gateway
311 // and removes her trust line. Her owner directory
312 // should now be empty:
313 {
314 env.trust(usd(0), alice);
315 env(pay(alice, gw, alice["USD"](1000)));
316 env.close();
317 BEAST_EXPECT(dirIsEmpty(*env.closed(), keylet::ownerDir(alice)));
318 }
319 }
320
321 void
323 {
324 testcase("Empty Chain on Delete");
325
326 using namespace jtx;
327 Env env(*this);
328
329 auto const gw = Account{"gateway"};
330 auto const alice = Account{"alice"};
331 auto const usd = gw["USD"];
332
333 env.fund(XRP(10000), alice);
334 env.close();
335
336 constexpr UInt256 kBase("fb71c9aa3310141da4b01d6c744a98286af2d72ab5448d5adc0910ca0c910880");
337
338 constexpr UInt256 kItem("bad0f021aa3b2f6754a8fe82a5779730aa0bbbab82f17201ef24900efc2c7312");
339
340 {
341 // Create a chain of three pages:
342 Sandbox sb(env.closed().get(), TapNone);
343 makePages(sb, kBase, 3);
344
345 // Insert an item in the middle page:
346 {
347 auto const p = sb.peek(keylet::page(kBase, 1));
348 BEAST_EXPECT(p);
349
350 STVector256 v;
351 v.pushBack(kItem);
352 p->setFieldV256(sfIndexes, v);
353 sb.update(p);
354 }
355
356 // Now, try to delete the item from the middle
357 // page. This should cause all pages to be deleted:
358 BEAST_EXPECT(sb.dirRemove(keylet::page(kBase, 0), 1, keylet::unchecked(kItem), false));
359 BEAST_EXPECT(!sb.peek(keylet::page(kBase, 2)));
360 BEAST_EXPECT(!sb.peek(keylet::page(kBase, 1)));
361 BEAST_EXPECT(!sb.peek(keylet::page(kBase, 0)));
362 }
363
364 {
365 // Create a chain of four pages:
366 Sandbox sb(env.closed().get(), TapNone);
367 makePages(sb, kBase, 4);
368
369 // Now add items on pages 1 and 2:
370 {
371 auto const p1 = sb.peek(keylet::page(kBase, 1));
372 BEAST_EXPECT(p1);
373
374 STVector256 v1;
375 v1.pushBack(~kItem);
376 p1->setFieldV256(sfIndexes, v1);
377 sb.update(p1);
378
379 auto const p2 = sb.peek(keylet::page(kBase, 2));
380 BEAST_EXPECT(p2);
381
382 STVector256 v2;
383 v2.pushBack(kItem);
384 p2->setFieldV256(sfIndexes, v2);
385 sb.update(p2);
386 }
387
388 // Now, try to delete the item from page 2.
389 // This should cause pages 2 and 3 to be
390 // deleted:
391 BEAST_EXPECT(sb.dirRemove(keylet::page(kBase, 0), 2, keylet::unchecked(kItem), false));
392 BEAST_EXPECT(!sb.peek(keylet::page(kBase, 3)));
393 BEAST_EXPECT(!sb.peek(keylet::page(kBase, 2)));
394
395 auto const p1 = sb.peek(keylet::page(kBase, 1));
396 BEAST_EXPECT(p1);
397 BEAST_EXPECT(p1->getFieldU64(sfIndexNext) == 0);
398 BEAST_EXPECT(p1->getFieldU64(sfIndexPrevious) == 0);
399
400 auto const p0 = sb.peek(keylet::page(kBase, 0));
401 BEAST_EXPECT(p0);
402 BEAST_EXPECT(p0->getFieldU64(sfIndexNext) == 1);
403 BEAST_EXPECT(p0->getFieldU64(sfIndexPrevious) == 1);
404 }
405 }
406
407 void
409 {
410 testcase("fixPreviousTxnID");
411 using namespace jtx;
412
413 auto const gw = Account{"gateway"};
414 auto const alice = Account{"alice"};
415 auto const usd = gw["USD"];
416
417 auto const ledgerData = [this](Env& env) {
418 json::Value params;
419 params[jss::type] = jss::directory;
420 params[jss::ledger_index] = "validated";
421 auto const result = env.rpc("json", "ledger_data", to_string(params))[jss::result];
422 BEAST_EXPECT(!result.isMember(jss::marker));
423 return result;
424 };
425
426 // fixPreviousTxnID is disabled.
427 Env env(*this, testableAmendments() - fixPreviousTxnID);
428 env.fund(XRP(10000), alice, gw);
429 env.close();
430 env.trust(usd(1000), alice);
431 env(pay(gw, alice, usd(1000)));
432 env.close();
433
434 {
435 auto const jrr = ledgerData(env);
436 auto const& jstate = jrr[jss::state];
437 BEAST_EXPECTS(checkArraySize(jstate, 2), jrr.toStyledString());
438 for (auto const& directory : jstate)
439 {
440 BEAST_EXPECT(directory["LedgerEntryType"] == jss::DirectoryNode); // sanity check
441 // The PreviousTxnID and PreviousTxnLgrSeq fields should not be
442 // on the DirectoryNode object when the amendment is disabled
443 BEAST_EXPECT(!directory.isMember("PreviousTxnID"));
444 BEAST_EXPECT(!directory.isMember("PreviousTxnLgrSeq"));
445 }
446 }
447
448 // Now enable the amendment so the directory node is updated.
449 env.enableFeature(fixPreviousTxnID);
450 env.close();
451
452 // Make sure the `PreviousTxnID` and `PreviousTxnLgrSeq` fields now
453 // exist
454 env(offer(alice, XRP(1), usd(1)));
455 auto const txID = to_string(env.tx()->getTransactionID());
456 auto const ledgerSeq = env.current()->header().seq;
457 env.close();
458 // Make sure the fields only exist if the object is touched
459 env(noop(gw));
460 env.close();
461
462 {
463 auto const jrr = ledgerData(env);
464 auto const& jstate = jrr[jss::state];
465 BEAST_EXPECTS(checkArraySize(jstate, 3), jrr.toStyledString());
466 for (auto const& directory : jstate)
467 {
468 BEAST_EXPECT(directory["LedgerEntryType"] == jss::DirectoryNode); // sanity check
469 if (directory[jss::Owner] == gw.human())
470 {
471 // gw's directory did not get touched, so it
472 // should not have those fields populated
473 BEAST_EXPECT(!directory.isMember("PreviousTxnID"));
474 BEAST_EXPECT(!directory.isMember("PreviousTxnLgrSeq"));
475 }
476 else
477 {
478 // All of the other directories, including the order
479 // book, did get touched, so they should have those
480 // fields
481 BEAST_EXPECT(
482 directory.isMember("PreviousTxnID") &&
483 directory["PreviousTxnID"].asString() == txID);
484 BEAST_EXPECT(
485 directory.isMember("PreviousTxnLgrSeq") &&
486 directory["PreviousTxnLgrSeq"].asUInt() == ledgerSeq);
487 }
488 }
489 }
490 }
491
492 void
494 {
495 using namespace test::jtx;
496 Account const alice("alice");
497
498 auto const testCase = [&, this](FeatureBitset features, auto setup) {
499 using namespace test::jtx;
500
501 Env env(*this, features);
502 env.fund(XRP(20000), alice);
503 env.close();
504
505 auto const [lastPage, full] = setup(env);
506
507 // Populate root page and last page
508 for (int i = 0; i < 63; ++i)
509 env(credentials::create(alice, alice, std::to_string(i)));
510 env.close();
511
512 // NOTE, everything below can only be tested on open ledger because
513 // there is no transaction type to express what bumpLastPage does.
514
515 // Bump position of last page from 1 to highest possible
516 auto const res = directory::bumpLastPage(
517 env,
518 lastPage,
519 keylet::ownerDir(alice.id()),
520 [lastPage, this](ApplyView& view, UInt256 key, std::uint64_t page) {
521 auto const sle = view.peek({ltCREDENTIAL, key});
522 if (!BEAST_EXPECT(sle))
523 return false;
524
525 BEAST_EXPECT(page == lastPage);
526 sle->setFieldU64(sfIssuerNode, page);
527 // sfSubjectNode is not set in self-issued credentials
528 view.update(sle);
529 return true;
530 });
531 BEAST_EXPECT(res);
532
533 // Create one more credential
534 env(credentials::create(alice, alice, std::to_string(63)));
535
536 // Not enough space for another object if full
537 auto const expected = full ? Ter{tecDIR_FULL} : Ter{tesSUCCESS};
538 env(credentials::create(alice, alice, "foo"), expected);
539
540 // Destroy all objects in directory
541 for (int i = 0; i < 64; ++i)
542 env(credentials::deleteCred(alice, alice, alice, std::to_string(i)));
543
544 if (!full)
545 env(credentials::deleteCred(alice, alice, alice, "foo"));
546
547 // Verify directory is empty.
548 auto const sle = env.le(keylet::ownerDir(alice.id()));
549 BEAST_EXPECT(sle == nullptr);
550
551 // Test completed
552 env.close();
553 };
554
555 testCase(
556 testableAmendments() - fixDirectoryLimit,
558 testcase("directory full without fixDirectoryLimit");
559 return {kDirNodeMaxPages - 1, true};
560 });
561 testCase(
563 [this](Env&) -> std::tuple<std::uint64_t, bool> {
564 testcase("directory not full with fixDirectoryLimit");
565 return {kDirNodeMaxPages - 1, false};
566 });
567 testCase(
569 [this](Env&) -> std::tuple<std::uint64_t, bool> {
570 testcase("directory full with fixDirectoryLimit");
572 });
573 }
574
575 void
576 run() override
577 {
580 testRipd1353();
584 }
585};
586
588
589} // namespace xrpl::test
T capacity(T... args)
A testsuite class.
Definition suite.h:52
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
Represents a JSON value.
Definition json_value.h:121
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:141
bool dirRemove(Keylet const &directory, std::uint64_t page, UInt256 const &key, bool keepRoot)
Remove an entry from a directory.
virtual void update(SLE::Ref sle)=0
Indicate changes to a peeked SLE.
void pushBack(UInt256 const &v)
Discardable, editable view to a ledger.
Definition Sandbox.h:18
void insert(SLE::Ref sle) override
Insert a new state SLE.
std::optional< key_type > succ(key_type const &key, std::optional< key_type > const &last=std::nullopt) const override
Return the key of the next state item.
SLE::pointer peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
void update(SLE::Ref sle) override
Indicate changes to a peeked SLE.
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
AccountID id() const
Returns the Account ID.
A transaction testing environment.
Definition Env.h:161
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition Env.cpp:133
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
Definition Env.cpp:127
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition Env.cpp:323
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Definition Env.cpp:302
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition Env.cpp:354
void enableFeature(UInt256 const feature)
Definition Env.cpp:709
std::shared_ptr< STTx const > tx() const
Return the tx data for the last JTx.
Definition Env.cpp:560
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition Env.h:377
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition ter.h:18
T is_sorted(T... args)
T make_shared(T... args)
T max(T... args)
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:415
Keylet unchecked(UInt256 const &key) noexcept
Any ledger entry.
Definition Indexes.cpp:409
Keylet page(UInt256 const &root, std::uint64_t const index=0) noexcept
A page in a directory.
Definition Indexes.cpp:421
Keylet child(UInt256 const &key) noexcept
Any item that can be in an owner dir.
Definition Indexes.cpp:239
json::Value deleteCred(jtx::Account const &acc, jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:40
json::Value create(jtx::Account const &subject, jtx::Account const &issuer, std::string_view credType)
Definition creds.cpp:16
Directory operations.
Definition directory.h:19
auto bumpLastPage(Env &env, std::uint64_t newLastPage, Keylet directory, std::function< bool(ApplyView &, UInt256, std::uint64_t)> adjust) -> std::expected< void, Error >
Move the position of the last page in the user's directory on open ledger to newLastPage.
Definition directory.cpp:27
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
json::Value offerCancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition offer.cpp:31
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
FeatureBitset testableAmendments()
Definition Env.h:92
json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:14
json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Definition trust.cpp:18
json::Value signers(Account const &account, std::uint32_t quorum, std::vector< Signer > const &v)
Definition multisign.cpp:31
bool checkArraySize(json::Value const &val, unsigned int size)
BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, xrpl, 2)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition Issue.h:108
UInt256 getBookBase(Book const &book)
Definition Indexes.cpp:136
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
constexpr std::size_t kDirNodeMaxEntries
The maximum number of entries per directory page.
Definition Protocol.h:58
beast::XorShiftEngine & defaultPrng()
Return the default random engine.
BaseUInt< 256, detail::DirectoryTag > Directory
Directory is an index into the directory of offer books.
Definition UintTypes.h:37
UInt256 getQualityNext(UInt256 const &uBase)
Definition Indexes.cpp:199
constexpr std::uint64_t kDirNodeMaxPages
The maximum number of pages allowed in a directory.
Definition Protocol.h:65
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:658
BaseUInt< 256 > UInt256
Definition base_uint.h:581
@ TapNone
Definition ApplyView.h:28
@ tecDIR_FULL
Definition TER.h:298
@ tesSUCCESS
Definition TER.h:253
T push_back(T... args)
T shuffle(T... args)
T reserve(T... args)
T size(T... args)
static void makePages(Sandbox &sb, UInt256 const &base, std::uint64_t n)
void run() override
Runs the suite.
std::string currcode(std::size_t i)
T to_string(T... args)