xrpld
Loading...
Searching...
No Matches
xrpl::test::jtx::Vault Struct Reference

#include <vault.h>

Collaboration diagram for xrpl::test::jtx::Vault:

Classes

struct  CreateArgs
struct  CreateClosedEndedArgs
struct  SetArgs
struct  DeleteArgs
struct  DepositArgs
struct  WithdrawArgs
struct  ClawbackArgs

Public Member Functions

std::tuple< json::Value, Keylet > create (CreateArgs const &args) const
 Return a VaultCreate transaction and the Vault's expected keylet.
std::tuple< json::Value, Keylet, NetClock::time_point > createClosedEnded (CreateClosedEndedArgs const &args) const
 Return a VaultCreate transaction for a closed-ended vault, its expected keylet, and the vault's SubscriptionDate.
void closePastSubscription (NetClock::time_point subscriptionDate) const
 Advance env's clock to just past subscriptionDate, moving a closed-ended vault from the Subscription phase into the Investment phase.

Static Public Member Functions

static json::Value set (SetArgs const &args)
static json::Value del (DeleteArgs const &args)
static json::Value deposit (DepositArgs const &args)
static json::Value withdraw (WithdrawArgs const &args)
static json::Value clawback (ClawbackArgs const &args)

Public Attributes

Env & env

Detailed Description

Definition at line 21 of file vault.h.

Member Function Documentation

◆ create()

std::tuple< json::Value, Keylet > xrpl::test::jtx::Vault::create ( CreateArgs const & args) const
nodiscard

Return a VaultCreate transaction and the Vault's expected keylet.

Definition at line 26 of file vault.cpp.

◆ createClosedEnded()

std::tuple< json::Value, Keylet, NetClock::time_point > xrpl::test::jtx::Vault::createClosedEnded ( CreateClosedEndedArgs const & args) const
nodiscard

Return a VaultCreate transaction for a closed-ended vault, its expected keylet, and the vault's SubscriptionDate.

Under featureLendingProtocolV1_1, LoanBrokerSet::preclaim only accepts closed-ended vaults, so tests that attach a loan broker need one. SubscriptionDate is set to now() + subscriptionOffset, giving callers a window to deposit while still in the Subscription phase; pass the returned date to closePastSubscription() afterwards to advance into the Investment phase.

Definition at line 48 of file vault.cpp.

◆ closePastSubscription()

void xrpl::test::jtx::Vault::closePastSubscription ( NetClock::time_point subscriptionDate) const

Advance env's clock to just past subscriptionDate, moving a closed-ended vault from the Subscription phase into the Investment phase.

Definition at line 63 of file vault.cpp.

◆ set()

json::Value xrpl::test::jtx::Vault::set ( SetArgs const & args)
static

Definition at line 69 of file vault.cpp.

◆ del()

json::Value xrpl::test::jtx::Vault::del ( DeleteArgs const & args)
static

Definition at line 79 of file vault.cpp.

◆ deposit()

json::Value xrpl::test::jtx::Vault::deposit ( DepositArgs const & args)
static

Definition at line 89 of file vault.cpp.

◆ withdraw()

json::Value xrpl::test::jtx::Vault::withdraw ( WithdrawArgs const & args)
static

Definition at line 100 of file vault.cpp.

◆ clawback()

json::Value xrpl::test::jtx::Vault::clawback ( ClawbackArgs const & args)
static

Definition at line 111 of file vault.cpp.

Member Data Documentation

◆ env

Env& xrpl::test::jtx::Vault::env

Definition at line 23 of file vault.h.