rippled
Loading...
Searching...
No Matches
Enumerations | Functions
ripple::test::jtx::directory Namespace Reference

Directory operations. More...

Enumerations

enum  Error {
  DirectoryRootNotFound , DirectoryTooSmall , DirectoryPageDuplicate , DirectoryPageNotFound ,
  InvalidLastPage , AdjustmentError
}
 

Functions

auto bumpLastPage (Env &env, std::uint64_t newLastPage, Keylet directory, std::function< bool(ApplyView &, uint256, std::uint64_t)> adjust) -> Expected< void, Error >
 Move the position of the last page in the user's directory on open ledger to newLastPage.
 
bool adjustOwnerNode (ApplyView &view, uint256 key, std::uint64_t page)
 Implementation of adjust for the most common ledger entry, i.e.
 
auto maximumPageIndex (Env const &env) -> std::uint64_t
 

Detailed Description

Directory operations.

Enumeration Type Documentation

◆ Error

Enumerator
DirectoryRootNotFound 
DirectoryTooSmall 
DirectoryPageDuplicate 
DirectoryPageNotFound 
InvalidLastPage 
AdjustmentError 

Definition at line 18 of file directory.h.

Function Documentation

◆ bumpLastPage()

auto ripple::test::jtx::directory::bumpLastPage ( Env env,
std::uint64_t  newLastPage,
Keylet  directory,
std::function< bool(ApplyView &, uint256, std::uint64_t)>  adjust 
) -> Expected<void, Error>

Move the position of the last page in the user's directory on open ledger to newLastPage.

Requirements:

  • directory must have at least two pages (root and one more)
  • adjust should be used to update owner nodes of the objects affected
  • newLastPage must be greater than index of the last page in the directory

Use this to test tecDIR_FULL errors in open ledger. NOTE: effects will be DISCARDED on env.close()

Definition at line 11 of file directory.cpp.

◆ adjustOwnerNode()

bool ripple::test::jtx::directory::adjustOwnerNode ( ApplyView view,
uint256  key,
std::uint64_t  page 
)

Implementation of adjust for the most common ledger entry, i.e.

one where page index is stored in sfOwnerNode (and only there). Pass this function to bumpLastPage if the last page of directory has only objects of this kind (e.g. ticket, DID, offer, deposit preauth, MPToken etc.)

Definition at line 111 of file directory.cpp.

◆ maximumPageIndex()

auto ripple::test::jtx::directory::maximumPageIndex ( Env const &  env) -> std::uint64_t

Definition at line 51 of file directory.h.