20#include <xrpld/conditions/Condition.h>
21#include <xrpld/conditions/Fulfillment.h>
22#include <xrpld/conditions/detail/PreimageSha256.h>
23#include <xrpld/conditions/detail/utils.h>
24#include <xrpl/basics/contract.h>
29namespace cryptoconditions {
76 auto p = parsePreamble(s, ec);
81 if (!isPrimitive(p) || !isContextSpecific(p))
104 p = parsePreamble(s, ec);
109 if (!isPrimitive(p) || !isContextSpecific(p))
121 auto cost = parseInteger<std::uint32_t>(s, p.
length, ec);
146 return std::make_unique<Condition>(type, cost, std::move(b));
172 auto const p = parsePreamble(s, ec);
178 if (!isConstructed(p) || !isContextSpecific(p))
184 if (p.length > s.
size())
Like std::vector<char> but better.
An immutable linear range of bytes.
bool empty() const noexcept
Return true if the byte range is empty.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::size_t size() const noexcept
Returns the number of bytes in the storage.
std::size_t length() const noexcept
static std::unique_ptr< Condition > deserialize(Slice s, std::error_code &ec)
Load a condition from its binary form.
static constexpr std::size_t maxSerializedCondition
The largest binary condition we support.
static constexpr std::size_t maxPreimageLength
The maximum allowed length of a preimage.
constexpr std::size_t fingerprintSize
std::unique_ptr< Condition > loadSimpleSha256(Type type, Slice s, std::error_code &ec)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.