1#include <xrpld/app/misc/PermissionedDEXHelpers.h>
3#include <xrpl/ledger/CredentialHelpers.h>
6namespace permissioned_dex {
16 if (sleDomain->getAccountID(sfOwner) == account)
19 auto const& credentials = sleDomain->getFieldArray(sfAcceptedCredentials);
21 bool const inDomain =
std::any_of(credentials.begin(), credentials.end(), [&](
auto const& credential) {
22 auto const sleCred = view.read(keylet::credential(account, credential[sfIssuer], credential[sfCredentialType]));
23 if (!sleCred || !sleCred->isFlag(lsfAccepted))
26 return !credentials::checkExpired(sleCred, view.header().parentCloseTime);
42 if (!sleOffer->isFieldPresent(sfDomainID))
44 if (sleOffer->getFieldH256(sfDomainID) != domainID)
47 if (sleOffer->isFlag(
lsfHybrid) && !sleOffer->isFieldPresent(sfAdditionalBooks))
49 JLOG(j.
error()) <<
"Hybrid offer " << offerID <<
" missing AdditionalBooks field";
53 return accountInDomain(view, sleOffer->getAccountID(sfAccount), domainID);
A generic endpoint for log messages.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Keylet permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
bool offerInDomain(ReadView const &view, uint256 const &offerID, Domain const &domainID, beast::Journal j)
bool accountInDomain(ReadView const &view, AccountID const &account, Domain const &domainID)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.