20 #ifndef RIPPLE_CONDITIONS_FULFILLMENT_H
21 #define RIPPLE_CONDITIONS_FULFILLMENT_H
23 #include <ripple/basics/Buffer.h>
24 #include <ripple/basics/Slice.h>
25 #include <ripple/conditions/Condition.h>
26 #include <ripple/conditions/impl/utils.h>
29 namespace cryptoconditions {
107 return !(lhs == rhs);
112 match(Fulfillment
const& f, Condition
const& c);
141 validate(Fulfillment
const& f, Condition
const& c);
static std::unique_ptr< Fulfillment > deserialize(Slice s, std::error_code &ec)
Load a fulfillment from its binary form.
static constexpr std::size_t maxSerializedFulfillment
The largest binary fulfillment we support.
An immutable linear range of bytes.
virtual Type type() const =0
Returns the type of this condition.
virtual bool validate(Slice data) const =0
Validates a fulfillment.
Like std::vector<char> but better.
virtual std::uint32_t cost() const =0
Calculates the cost associated with this fulfillment.
bool validate(Fulfillment const &f, Condition const &c, Slice m)
Verify if the given message satisfies the fulfillment.
virtual Condition condition() const =0
Returns the condition associated with the given fulfillment.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual Buffer fingerprint() const =0
Returns the fulfillment's fingerprint:
bool operator==(Condition const &lhs, Condition const &rhs)
bool match(Fulfillment const &f, Condition const &c)
Determine whether the given fulfillment and condition match.
virtual ~Fulfillment()=default
bool operator!=(Condition const &lhs, Condition const &rhs)