3#include <xrpl/basics/Buffer.h>
4#include <xrpl/basics/Slice.h>
5#include <xrpl/conditions/Condition.h>
6#include <xrpl/conditions/Fulfillment.h>
7#include <xrpl/conditions/detail/error.h>
8#include <xrpl/protocol/digest.h>
46 auto p = parsePreamble(s, ec);
50 if (!isPrimitive(p) || !isContextSpecific(p))
62 if (s.
size() != p.length)
74 auto b = parseOctetString(s, p.
length, ec);
105 return {d.data(), d.size()};
Like std::vector<char> but better.
An immutable linear range of bytes.
std::size_t length() const noexcept
std::size_t size() const noexcept
Returns the number of bytes in the storage.
bool validate(Slice) const override
Validates a fulfillment.
Condition condition() const override
Returns the condition associated with the given fulfillment.
static std::unique_ptr< Fulfillment > deserialize(Slice s, std::error_code &ec)
Parse the payload for a PreimageSha256 condition.
std::uint32_t cost() const override
Calculates the cost associated with this fulfillment.
static constexpr std::size_t kMaxPreimageLength
The maximum allowed length of a preimage.
Buffer fingerprint() const override
Returns the fulfillment's fingerprint:
Type type() const override
Returns the type of this condition.
PreimageSha256(Slice s) noexcept
PreimageSha256(Buffer &&b) noexcept
OpensslSha256Hasher sha256_hasher
std::array< std::uint8_t, 32 > result_type