20#include <xrpld/app/misc/PermissionedDEXHelpers.h>
22#include <xrpl/ledger/CredentialHelpers.h>
25namespace permissioned_dex {
38 if (sleDomain->getAccountID(sfOwner) == account)
41 auto const& credentials = sleDomain->getFieldArray(sfAcceptedCredentials);
44 credentials.begin(), credentials.end(), [&](
auto const&
credential) {
45 auto const sleCred = view.read(keylet::credential(
46 account, credential[sfIssuer], credential[sfCredentialType]));
47 if (!sleCred || !sleCred->isFlag(lsfAccepted))
50 return !credentials::checkExpired(
51 sleCred, view.info().parentCloseTime);
71 if (!sleOffer->isFieldPresent(sfDomainID))
73 if (sleOffer->getFieldH256(sfDomainID) != domainID)
77 !sleOffer->isFieldPresent(sfAdditionalBooks))
79 JLOG(j.
error()) <<
"Hybrid offer " << offerID
80 <<
" missing AdditionalBooks field";
84 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 permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
bool accountInDomain(ReadView const &view, AccountID const &account, Domain const &domainID)
bool offerInDomain(ReadView const &view, uint256 const &offerID, Domain const &domainID, beast::Journal j)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ credential
Credentials signature.