xrpld
Loading...
Searching...
No Matches
xrpl::StrandContext Struct Reference

Context needed to build Strand Steps and for error checking. More...

#include <Steps.h>

Collaboration diagram for xrpl::StrandContext:

Public Member Functions

 StrandContext (ReadView const &view, std::vector< std::unique_ptr< Step > > const &strand, AccountID const &strandSrc, AccountID const &strandDst, Asset const &strandDeliver, std::optional< Quality > const &limitQuality, bool isLast, bool ownerPaysTransferFee, OfferCrossing offerCrossing, bool isDefaultPath, std::array< boost::container::flat_set< Asset >, 2 > &seenDirectAssets, boost::container::flat_set< Asset > &seenBookOuts, AMMContext &ammContext, std::optional< uint256 > const &domainID, beast::Journal j)
 StrandContext constructor.

Public Attributes

ReadView const & view
 Current ReadView.
AccountID const strandSrc
 Strand source account.
AccountID const strandDst
 Strand destination account.
Asset const strandDeliver
 Asset strand delivers.
std::optional< Quality > const limitQuality
 Worst accepted quality.
bool const isFirst
 true if Step is first in Strand
bool const isLast = false
 true if Step is last in Strand
bool const ownerPaysTransferFee
 true if owner, not sender, pays fee
OfferCrossing const offerCrossing
 Yes/Sell if offer crossing, not payment.
bool const isDefaultPath
 true if Strand is default path
size_t const strandSize
 Length of Strand.
Step const *const prevStep = nullptr
 The previous step in the strand.
std::array< boost::container::flat_set< Asset >, 2 > & seenDirectAssets
 A strand may not include the same account node more than once in the same currency.
boost::container::flat_set< Asset > & seenBookOuts
 A strand may not include an offer that output the same issue more than once.
AMMContextammContext
std::optional< uint256domainID
beast::Journal const j

Detailed Description

Context needed to build Strand Steps and for error checking.

Definition at line 517 of file Steps.h.

Constructor & Destructor Documentation

◆ StrandContext()

xrpl::StrandContext::StrandContext ( ReadView const & view,
std::vector< std::unique_ptr< Step > > const & strand,
AccountID const & strandSrc,
AccountID const & strandDst,
Asset const & strandDeliver,
std::optional< Quality > const & limitQuality,
bool isLast,
bool ownerPaysTransferFee,
OfferCrossing offerCrossing,
bool isDefaultPath,
std::array< boost::container::flat_set< Asset >, 2 > & seenDirectAssets,
boost::container::flat_set< Asset > & seenBookOuts,
AMMContext & ammContext,
std::optional< uint256 > const & domainID,
beast::Journal j )

StrandContext constructor.

Journal for logging

Parameters
seenDirectAssetsFor detecting currency loops
seenBookOutsFor detecting book loops

Definition at line 686 of file PaySteps.cpp.

Member Data Documentation

◆ view

ReadView const& xrpl::StrandContext::view

Current ReadView.

Definition at line 519 of file Steps.h.

◆ strandSrc

AccountID const xrpl::StrandContext::strandSrc

Strand source account.

Definition at line 520 of file Steps.h.

◆ strandDst

AccountID const xrpl::StrandContext::strandDst

Strand destination account.

Definition at line 521 of file Steps.h.

◆ strandDeliver

Asset const xrpl::StrandContext::strandDeliver

Asset strand delivers.

Definition at line 522 of file Steps.h.

◆ limitQuality

std::optional<Quality> const xrpl::StrandContext::limitQuality

Worst accepted quality.

Definition at line 523 of file Steps.h.

◆ isFirst

bool const xrpl::StrandContext::isFirst

true if Step is first in Strand

Definition at line 524 of file Steps.h.

◆ isLast

bool const xrpl::StrandContext::isLast = false

true if Step is last in Strand

Definition at line 525 of file Steps.h.

◆ ownerPaysTransferFee

bool const xrpl::StrandContext::ownerPaysTransferFee

true if owner, not sender, pays fee

Definition at line 526 of file Steps.h.

◆ offerCrossing

OfferCrossing const xrpl::StrandContext::offerCrossing

Yes/Sell if offer crossing, not payment.

Definition at line 527 of file Steps.h.

◆ isDefaultPath

bool const xrpl::StrandContext::isDefaultPath

true if Strand is default path

Definition at line 528 of file Steps.h.

◆ strandSize

size_t const xrpl::StrandContext::strandSize

Length of Strand.

Definition at line 529 of file Steps.h.

◆ prevStep

Step const* const xrpl::StrandContext::prevStep = nullptr

The previous step in the strand.

Needed to check the no ripple constraint

Definition at line 533 of file Steps.h.

◆ seenDirectAssets

std::array<boost::container::flat_set<Asset>, 2>& xrpl::StrandContext::seenDirectAssets

A strand may not include the same account node more than once in the same currency.

In a direct step, an account will show up at most twice: once as a src and once as a dst (hence the two element array). The strandSrc and strandDst will only show up once each.

Definition at line 539 of file Steps.h.

◆ seenBookOuts

boost::container::flat_set<Asset>& xrpl::StrandContext::seenBookOuts

A strand may not include an offer that output the same issue more than once.

Definition at line 543 of file Steps.h.

◆ ammContext

AMMContext& xrpl::StrandContext::ammContext

Definition at line 544 of file Steps.h.

◆ domainID

std::optional<uint256> xrpl::StrandContext::domainID

Definition at line 545 of file Steps.h.

◆ j

beast::Journal const xrpl::StrandContext::j

Definition at line 546 of file Steps.h.