20 #include <ripple/basics/contract.h>
21 #include <ripple/conditions/Condition.h>
22 #include <ripple/conditions/Fulfillment.h>
23 #include <ripple/conditions/impl/PreimageSha256.h>
24 #include <ripple/conditions/impl/utils.h>
25 #include <boost/optional.hpp>
26 #include <boost/regex.hpp>
31 namespace cryptoconditions {
78 auto p = parsePreamble(s, ec);
83 if (!isPrimitive(p) || !isContextSpecific(p))
106 p = parsePreamble(s, ec);
111 if (!isPrimitive(p) || !isContextSpecific(p))
123 auto cost = parseInteger<std::uint32_t>(s, p.
length, ec);
148 return std::make_unique<Condition>(type, cost, std::move(b));
174 auto const p = parsePreamble(s, ec);
180 if (!isConstructed(p) || !isContextSpecific(p))
186 if (p.length > s.
size())
192 if (s.
size() > maxSerializedCondition)