xrpld
Loading...
Searching...
No Matches
xrpl::ConfidentialTransferTestBase Class Referenceabstract

#include <ConfidentialTransfer.h>

Inheritance diagram for xrpl::ConfidentialTransferTestBase:
Collaboration diagram for xrpl::ConfidentialTransferTestBase:

Classes

struct  ConfidentialSendSetup
struct  ConfidentialEnv

Public Member Functions

template<class = void>
void operator() (Runner &r)
 Invokes the test using the specified runner.
template<class = void>
void pass ()
 Record a successful test condition.
template<class F, class String>
bool except (F &&f, String const &reason)
template<class F>
bool except (F &&f)
template<class E, class F, class String>
bool except (F &&f, String const &reason)
template<class E, class F>
bool except (F &&f)
template<class F, class String>
bool unexcept (F &&f, String const &reason)
template<class F>
bool unexcept (F &&f)
std::string const & arg () const
 Return the argument associated with the runner.
template<class Condition, class String>
bool unexpected (Condition shouldBeFalse, String const &reason)
 DEPRECATED.
template<class Condition>
bool unexpected (Condition shouldBeFalse)
template<class String>
void fail (String const &reason, char const *file, int line)
 Record a failure.
template<class = void>
void fail (std::string const &reason="")
template<class Condition>
bool expect (Condition const &shouldBeTrue)
 Evaluate a test condition.
template<class Condition, class String>
bool expect (Condition const &shouldBeTrue, String const &reason)
template<class Condition>
bool expect (Condition const &shouldBeTrue, char const *file, int line)
template<class Condition, class String>
bool expect (Condition const &shouldBeTrue, String const &reason, char const *file, int line)

Static Public Member Functions

static SuitethisSuite ()
 Returns the "current" running suite.

Public Attributes

LogOs< char > log
 Logging output stream.
TestcaseT testcase
 Memberspace for declaring test cases.

Protected Member Functions

Runner & runner () const
 Lets a suite compose other suites (e.g.

Static Protected Member Functions

template<class T>
static T requireOptional (std::optional< T > value, char const *message)
template<class T>
static T const & requireOptionalRef (std::optional< T > const &value, char const *message)
static Buffer getForgedBulletproof (std::array< uint64_t, 2 > const &values, std::array< Buffer, 2 > const &blindingFactors, uint256 const &contextHash)
static Buffer getForgedSingleBulletproof (uint64_t value, Buffer const &blindingFactor, uint256 const &contextHash)
static Buffer const & getBadCiphertext ()
static Buffer const & getTrivialCiphertext ()
static Buffer const & getTrivialCommitment ()
static std::string getTrivialSendProofHex ()
static void setupBatchEnv (test::jtx::MPTTester &mpt, test::jtx::Account const &alice, test::jtx::Account const &bob, test::jtx::Account const &carol, test::jtx::Account const &dave, std::uint64_t bobAmt, std::uint64_t carolAmt)

Static Protected Attributes

static constexpr size_t kBulletproofOffset = kEcSendProofLength - kEcDoubleBulletproofLength

Private Member Functions

virtual void run ()=0
 Runs the suite.
template<class = void>
void run (Runner &r)
void propagateAbort () const

Static Private Member Functions

static Suite ** pThisSuite ()

Private Attributes

bool abort_ = false
bool aborted_ = false
Runner * runner_ = nullptr

Detailed Description

Definition at line 36 of file src/test/jtx/ConfidentialTransfer.h.

Member Function Documentation

◆ requireOptional()

template<class T>
T xrpl::ConfidentialTransferTestBase::requireOptional ( std::optional< T > value,
char const * message )
staticprotected

Definition at line 41 of file src/test/jtx/ConfidentialTransfer.h.

◆ requireOptionalRef()

template<class T>
T const & xrpl::ConfidentialTransferTestBase::requireOptionalRef ( std::optional< T > const & value,
char const * message )
staticprotected

Definition at line 50 of file src/test/jtx/ConfidentialTransfer.h.

◆ getForgedBulletproof()

Buffer xrpl::ConfidentialTransferTestBase::getForgedBulletproof ( std::array< uint64_t, 2 > const & values,
std::array< Buffer, 2 > const & blindingFactors,
uint256 const & contextHash )
staticprotected

Definition at line 66 of file src/test/jtx/ConfidentialTransfer.h.

◆ getForgedSingleBulletproof()

Buffer xrpl::ConfidentialTransferTestBase::getForgedSingleBulletproof ( uint64_t value,
Buffer const & blindingFactor,
uint256 const & contextHash )
staticprotected

Definition at line 100 of file src/test/jtx/ConfidentialTransfer.h.

◆ getBadCiphertext()

Buffer const & xrpl::ConfidentialTransferTestBase::getBadCiphertext ( )
staticprotected

Definition at line 130 of file src/test/jtx/ConfidentialTransfer.h.

◆ getTrivialCiphertext()

Buffer const & xrpl::ConfidentialTransferTestBase::getTrivialCiphertext ( )
staticprotected

Definition at line 148 of file src/test/jtx/ConfidentialTransfer.h.

◆ getTrivialCommitment()

Buffer const & xrpl::ConfidentialTransferTestBase::getTrivialCommitment ( )
staticprotected

Definition at line 169 of file src/test/jtx/ConfidentialTransfer.h.

◆ getTrivialSendProofHex()

std::string xrpl::ConfidentialTransferTestBase::getTrivialSendProofHex ( )
staticprotected

Definition at line 186 of file src/test/jtx/ConfidentialTransfer.h.

◆ setupBatchEnv()

void xrpl::ConfidentialTransferTestBase::setupBatchEnv ( test::jtx::MPTTester & mpt,
test::jtx::Account const & alice,
test::jtx::Account const & bob,
test::jtx::Account const & carol,
test::jtx::Account const & dave,
std::uint64_t bobAmt,
std::uint64_t carolAmt )
staticprotected

Definition at line 426 of file src/test/jtx/ConfidentialTransfer.h.

◆ thisSuite()

Suite * beast::unit_test::Suite::thisSuite ( )
staticinherited

Returns the "current" running suite.

If no suite is running, nullptr is returned.

Definition at line 162 of file suite.h.

◆ operator()()

template<class>
void beast::unit_test::Suite::operator() ( Runner & r)
inherited

Invokes the test using the specified runner.

Data members are set up here instead of the constructor as a convenience to writing the derived class to avoid repetition of forwarded constructor arguments to the base. Normally this is called by the framework for you.

Definition at line 420 of file suite.h.

◆ pass()

template<class>
void beast::unit_test::Suite::pass ( )
inherited

Record a successful test condition.

Definition at line 532 of file suite.h.

◆ fail() [1/2]

template<class String>
void beast::unit_test::Suite::fail ( String const & reason,
char const * file,
int line )
inherited

Record a failure.

Parameters
reasonOptional text added to the output on a failure.
fileThe source code file where the test failed.
lineThe source code line number where the test failed.

Definition at line 554 of file suite.h.

◆ fail() [2/2]

template<class>
void beast::unit_test::Suite::fail ( std::string const & reason = "")
inherited

Definition at line 541 of file suite.h.

◆ expect() [1/4]

template<class Condition>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue)
inherited

Evaluate a test condition.

This function provides improved logging by incorporating the file name and line number into the reported output on failure, as well as additional text specified by the caller.

Parameters
shouldBeTrueThe condition to test. The condition is evaluated in a boolean context.
reasonOptional added text to output on a failure.
fileThe source code file where the test failed.
lineThe source code line number where the test failed.
Returns
true if the test condition indicates success.

Definition at line 235 of file suite.h.

◆ expect() [2/4]

template<class Condition, class String>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
String const & reason )
inherited

Definition at line 437 of file suite.h.

◆ expect() [3/4]

template<class Condition>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
char const * file,
int line )
inherited

Definition at line 246 of file suite.h.

◆ expect() [4/4]

template<class Condition, class String>
bool beast::unit_test::Suite::expect ( Condition const & shouldBeTrue,
String const & reason,
char const * file,
int line )
inherited

Definition at line 450 of file suite.h.

◆ except() [1/4]

template<class F, class String>
bool beast::unit_test::Suite::except ( F && f,
String const & reason )
inherited

Definition at line 465 of file suite.h.

◆ except() [2/4]

template<class F>
bool beast::unit_test::Suite::except ( F && f)
inherited

Definition at line 265 of file suite.h.

◆ except() [3/4]

template<class E, class F, class String>
bool beast::unit_test::Suite::except ( F && f,
String const & reason )
inherited

Definition at line 482 of file suite.h.

◆ except() [4/4]

template<class E, class F>
bool beast::unit_test::Suite::except ( F && f)
inherited

Definition at line 274 of file suite.h.

◆ unexcept() [1/2]

template<class F, class String>
bool beast::unit_test::Suite::unexcept ( F && f,
String const & reason )
inherited

Definition at line 499 of file suite.h.

◆ unexcept() [2/2]

template<class F>
bool beast::unit_test::Suite::unexcept ( F && f)
inherited

Definition at line 283 of file suite.h.

◆ arg()

std::string const & beast::unit_test::Suite::arg ( ) const
inherited

Return the argument associated with the runner.

Definition at line 292 of file suite.h.

◆ runner()

Runner & beast::unit_test::Suite::runner ( ) const
protectedinherited

Lets a suite compose other suites (e.g.

an aggregator that reruns a group of related suites under its own name) via SuiteInfo::run.

Returns
The runner this suite is executing under.

Definition at line 305 of file suite.h.

◆ unexpected() [1/2]

template<class Condition, class String>
bool beast::unit_test::Suite::unexpected ( Condition shouldBeFalse,
String const & reason )
inherited

DEPRECATED.

Returns
true if the test condition indicates success(a false value)

Definition at line 516 of file suite.h.

◆ unexpected() [2/2]

template<class Condition>
bool beast::unit_test::Suite::unexpected ( Condition shouldBeFalse)
inherited

Definition at line 321 of file suite.h.

◆ pThisSuite()

Suite ** beast::unit_test::Suite::pThisSuite ( )
staticprivateinherited

Definition at line 330 of file suite.h.

◆ run() [1/2]

virtual void beast::unit_test::Suite::run ( )
privatepure virtualinherited

Runs the suite.

Implemented in beast::abstract_clock_test, beast::aged_map_test, beast::aged_multimap_test, beast::aged_multiset_test, beast::aged_set_test, beast::aged_unordered_map_test, beast::aged_unordered_multimap_test, beast::aged_unordered_multiset_test, beast::aged_unordered_set_test, beast::BasicSecondsClock_test, beast::ip::IPEndpoint_test, beast::Journal_test, beast::PropertyStream_test, beast::unit_test::print_test, beast::XXHasher_test, io_latency_probe_test, xrpl::AccountCurrencies_test, xrpl::AccountSet_test, xrpl::AccountTxPaging_test, xrpl::AmendmentBlocked_test, xrpl::AmendmentTable_test, xrpl::Apply_test, xrpl::BuildInfo_test, xrpl::Check_test, xrpl::CheckMPT_test, xrpl::Clawback_test, xrpl::ClawbackMPT_test, xrpl::ConfidentialTransfer_test, xrpl::ConfidentialTransferExtended_test, xrpl::Config_test, xrpl::Connect_test, xrpl::cryptoconditions::PreimageSha256_test, xrpl::Discrepancy_test, xrpl::Feature_test, xrpl::FixNFTokenPageLinks_test, xrpl::Freeze_test, xrpl::GetCounts_test, xrpl::InnerObjectFormatsParsedJSON_test, xrpl::InnerObjectFormatsSerializer_test, xrpl::Issue_test, xrpl::LedgerClosed_test, xrpl::LedgerData_test, xrpl::LedgerHeader_test, xrpl::LedgerLoad_test, xrpl::LoadFeeTrack_test, xrpl::Memo_test, xrpl::NFTokenAllFeatures_test, xrpl::NFTokenAuth_test, xrpl::NFTokenBaseUtil_test, xrpl::NFTokenBurn_test, xrpl::NFTokenDir_test, xrpl::NFTokenDisallowIncoming_test, xrpl::NfTokenWoExpiredOfferRemovalTest, xrpl::NFTokenWOMintOffer_test, xrpl::NFTokenWOModify_test, xrpl::node_store::DatabaseConfig_test, xrpl::NoRippleCheck_test, xrpl::NoRippleCheckLimits_test, xrpl::OfferStream_test, xrpl::OwnerInfo_test, xrpl::Peers_test, xrpl::PerfLog_test, xrpl::ProtocolVersion_test, xrpl::PublicKey_test, xrpl::Quality_test, xrpl::rpc::AccountLines_test, xrpl::rpc::codeString_test, xrpl::rpc::fillJson_test, xrpl::rpc::JSONRPC_test, xrpl::rpc::LedgerRequest_test, xrpl::rpc::WalletPropose_test, xrpl::SecretKey_test, xrpl::Seed_test, xrpl::SeqProxy_test, xrpl::SetRegularKey_test, xrpl::short_read_test, xrpl::SociDB_test, xrpl::STAccount_test, xrpl::STAmount_test, xrpl::STInteger_test, xrpl::STNumber_test, xrpl::STObject_test, xrpl::STParsedJSON_test, xrpl::STTx_test, xrpl::STValidation_test, xrpl::TER_test, xrpl::test::AccountDelete_test, xrpl::test::AccountInfo_test, xrpl::test::AccountObjects_test, xrpl::test::AccountOffers_test, xrpl::test::AccountTx_test, xrpl::test::AMM_test, xrpl::test::AMMCalc_test, xrpl::test::AMMClawback_test, xrpl::test::AMMClawbackMPT_test, xrpl::test::AMMExtended_test, xrpl::test::AMMExtendedMPT_test, xrpl::test::AMMInfo_test, xrpl::test::AMMMPT_test, xrpl::test::Batch_test, xrpl::test::Book_test, xrpl::test::BookChanges_test, xrpl::test::BookDirs_test, xrpl::test::ClosureCounter_test, xrpl::test::compression_test, xrpl::test::Coroutine_test, xrpl::test::Credentials_test, xrpl::test::CrossingLimits_test, xrpl::test::CrossingLimitsMPT_test, xrpl::test::CurrentThreadName_test, xrpl::test::Delegate_test, xrpl::test::DeliveredAmount_test, xrpl::test::DeliverMin_test, xrpl::test::DepositAuth_test, xrpl::test::DepositAuthorized_test, xrpl::test::DepositPreauth_test, xrpl::test::DetectCrash_test, xrpl::test::DID_test, xrpl::test::Directory_test, xrpl::test::DNS_test, xrpl::test::Env_test, xrpl::test::Escrow_test, xrpl::test::EscrowToken_test, xrpl::test::FeeVote_test, xrpl::test::FindOversizeCross_test, xrpl::test::Flow_manual_test, xrpl::test::Flow_test, xrpl::test::FlowMPT_test, xrpl::test::GatewayBalances_test, xrpl::test::GetAmendments_test, xrpl::test::GRPCServerTLS_test, xrpl::test::Handler_test, xrpl::test::handshake_test, xrpl::test::HashRouter_test, xrpl::test::Invariants_test, xrpl::test::JobQueue_test, xrpl::test::jtx::oracle::GetAggregatePrice_test, xrpl::test::jtx::oracle::Oracle_test, xrpl::test::LedgerEntry_test, xrpl::test::LedgerEntry_XChain_test, xrpl::test::LedgerHistory_test, xrpl::test::LedgerMaster_test, xrpl::test::LedgerReplay_test, xrpl::test::LedgerReplayer_test, xrpl::test::LedgerReplayerLong_test, xrpl::test::LedgerReplayerTimeout_test, xrpl::test::LedgerRPC_test, xrpl::test::LendingHelpers_test, xrpl::test::Loan_test, xrpl::test::LoanArbitrary_test, xrpl::test::LoanBatch_test, xrpl::test::LoanBroker_test, xrpl::test::LoanCashBasis_test, xrpl::test::LoanCoverFreezeAuth_test, xrpl::test::LoanInvariants_test, xrpl::test::LoanLifecycle_test, xrpl::test::LoanMisc_test, xrpl::test::LoanPay_test, xrpl::test::LoanRounding_test, xrpl::test::LoanSecurity_test, xrpl::test::LoanSet_test, xrpl::test::LoanValidation_test, xrpl::test::LPTokenTransfer_test, xrpl::test::Manifest_test, xrpl::test::ManifestRPC_test, xrpl::test::MPToken_test, xrpl::test::MultiApiJson_test, xrpl::test::MultiSign_test, xrpl::test::NegativeUNL_test, xrpl::test::NegativeUNLVoteFilterValidations_test, xrpl::test::NegativeUNLVoteGoodScore_test, xrpl::test::NegativeUNLVoteInternal_test, xrpl::test::NegativeUNLVoteMaxListed_test, xrpl::test::NegativeUNLVoteNewValidator_test, xrpl::test::NegativeUNLVoteOffline_test, xrpl::test::NegativeUNLVoteRetiredValidator_test, xrpl::test::NegativeUNLVoteScoreTable_test, xrpl::test::NetworkID_test, xrpl::test::NetworkOPs_test, xrpl::test::NoRipple_test, xrpl::test::Offer_manual_test, xrpl::test::OfferAllFeatures_test, xrpl::test::OfferBaseUtil_test, xrpl::test::OfferMPT_test, xrpl::test::OfferWOSmallQOffers_test, xrpl::test::OversizeMeta_test, xrpl::test::Path_test, xrpl::test::PathMPT_test, xrpl::test::PayChan_test, xrpl::test::PaymentSandbox_test, xrpl::test::PayStrand_test, xrpl::test::PayStrandMPT_test, xrpl::test::PendingSaves_test, xrpl::test::PermissionedDEX_test, xrpl::test::PermissionedDomains_test, xrpl::test::PlumpBook_test, xrpl::test::PseudoTx_test, xrpl::test::RCLValidations_test, xrpl::test::reduce_relay_simulate_test, xrpl::test::reduce_relay_test, xrpl::test::ReducedOffer_test, xrpl::test::Regression_test, xrpl::test::RobustTransaction_test, xrpl::test::Roles_test, xrpl::test::RPCCall_test, xrpl::test::RPCHelpers_test, xrpl::test::RPCOverload_test, xrpl::test::Server_test, xrpl::test::ServerDefinitions_test, xrpl::test::ServerInfo_test, xrpl::test::ServerStatus_test, xrpl::test::SetAuth_test, xrpl::test::SHAMapStore_test, xrpl::test::Simulate_test, xrpl::test::SkipList_test, xrpl::test::Sponsor_test, xrpl::test::SponsorTxCosigning_test, xrpl::test::SponsorTxPrefunded_test, xrpl::test::STIssue_test, xrpl::test::Submit_test, xrpl::test::Subscribe_test, xrpl::test::TheoreticalQuality_test, xrpl::test::ThinBook_test, xrpl::test::TMGetObjectByHash_test, xrpl::test::traffic_count_test, xrpl::test::Transaction_ordering_test, xrpl::test::TrustSet_test, xrpl::test::tx_reduce_relay_test, xrpl::test::TxQMetaInfo_test, xrpl::test::TxQPosNegFlows_test, xrpl::test::ValidatorInfo_test, xrpl::test::ValidatorKeys_test, xrpl::test::ValidatorList_test, xrpl::test::ValidatorRPC_test, xrpl::test::ValidatorSite_test, xrpl::test::View_test, xrpl::test::WSClient_test, xrpl::test::XChain_test, xrpl::test::XChainSim_test, xrpl::tests::cluster_test, xrpl::tests::LedgerNodeHelpers_test, xrpl::Ticket_test, xrpl::Transaction_test, xrpl::TransactionEntry_test, xrpl::TransactionHistory_test, xrpl::TrustAndBalance_test, xrpl::Vault_test, xrpl::Version_test, and xrpl::Workers_test.

◆ run() [2/2]

template<class>
void beast::unit_test::Suite::run ( Runner & r)
privateinherited

Definition at line 568 of file suite.h.

◆ propagateAbort()

void beast::unit_test::Suite::propagateAbort ( ) const
privateinherited

Definition at line 560 of file suite.h.

Member Data Documentation

◆ kBulletproofOffset

size_t xrpl::ConfidentialTransferTestBase::kBulletproofOffset = kEcSendProofLength - kEcDoubleBulletproofLength
staticconstexprprotected

Definition at line 59 of file src/test/jtx/ConfidentialTransfer.h.

◆ abort_

bool beast::unit_test::Suite::abort_ = false
privateinherited

Definition at line 54 of file suite.h.

◆ aborted_

bool beast::unit_test::Suite::aborted_ = false
privateinherited

Definition at line 55 of file suite.h.

◆ runner_

Runner* beast::unit_test::Suite::runner_ = nullptr
privateinherited

Definition at line 56 of file suite.h.

◆ log

LogOs<char> beast::unit_test::Suite::log
inherited

Logging output stream.

Text sent to the log output stream will be forwarded to the output stream associated with the runner.

Definition at line 150 of file suite.h.

◆ testcase

TestcaseT beast::unit_test::Suite::testcase
inherited

Memberspace for declaring test cases.

Definition at line 155 of file suite.h.