xrpld
Loading...
Searching...
No Matches
xrpl::cryptoconditions::Condition Class Reference

#include <Condition.h>

Collaboration diagram for xrpl::cryptoconditions::Condition:

Public Member Functions

 Condition (Type t, std::uint32_t c, Slice fp)
 Condition (Type t, std::uint32_t c, Buffer &&fp)
 ~Condition ()=default
 Condition (Condition const &)=default
 Condition (Condition &&)=default
 Condition ()=delete

Static Public Member Functions

static std::unique_ptr< Conditiondeserialize (Slice s, std::error_code &ec)
 Load a condition from its binary form.

Public Attributes

Type type
Buffer fingerprint
 An identifier for this condition.
std::uint32_t cost
 The cost associated with this condition.
std::set< Typesubtypes
 For compound conditions, set of conditions includes.

Static Public Attributes

static constexpr std::size_t kMaxSerializedCondition = 128
 The largest binary condition we support.

Detailed Description

Definition at line 20 of file Condition.h.

Constructor & Destructor Documentation

◆ Condition() [1/5]

xrpl::cryptoconditions::Condition::Condition ( Type t,
std::uint32_t c,
Slice fp )

Definition at line 61 of file Condition.h.

◆ Condition() [2/5]

xrpl::cryptoconditions::Condition::Condition ( Type t,
std::uint32_t c,
Buffer && fp )

Definition at line 65 of file Condition.h.

◆ ~Condition()

xrpl::cryptoconditions::Condition::~Condition ( )
default

◆ Condition() [3/5]

xrpl::cryptoconditions::Condition::Condition ( Condition const & )
default

◆ Condition() [4/5]

xrpl::cryptoconditions::Condition::Condition ( Condition && )
default

◆ Condition() [5/5]

xrpl::cryptoconditions::Condition::Condition ( )
delete

Member Function Documentation

◆ deserialize()

std::unique_ptr< Condition > xrpl::cryptoconditions::Condition::deserialize ( Slice s,
std::error_code & ec )
static

Load a condition from its binary form.

Parameters
sThe buffer containing the fulfillment to load.
ecSet to the error, if any occurred.

The binary format for a condition is specified in the cryptoconditions RFC. See:

https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-7.2

Definition at line 138 of file Condition.cpp.

Member Data Documentation

◆ kMaxSerializedCondition

std::size_t xrpl::cryptoconditions::Condition::kMaxSerializedCondition = 128
staticconstexpr

The largest binary condition we support.

Note
This value will be increased in the future, but it must never decrease, as that could cause conditions that were previously considered valid to no longer be allowed.

Definition at line 30 of file Condition.h.

◆ type

Type xrpl::cryptoconditions::Condition::type

Definition at line 46 of file Condition.h.

◆ fingerprint

Buffer xrpl::cryptoconditions::Condition::fingerprint

An identifier for this condition.

This fingerprint is meant to be unique only with respect to other conditions of the same type.

Definition at line 53 of file Condition.h.

◆ cost

std::uint32_t xrpl::cryptoconditions::Condition::cost

The cost associated with this condition.

Definition at line 56 of file Condition.h.

◆ subtypes

std::set<Type> xrpl::cryptoconditions::Condition::subtypes

For compound conditions, set of conditions includes.

Definition at line 59 of file Condition.h.