rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
xrpl::cryptoconditions::Fulfillment Struct Referenceabstract

#include <Fulfillment.h>

Inheritance diagram for xrpl::cryptoconditions::Fulfillment:
Inheritance graph
[legend]
Collaboration diagram for xrpl::cryptoconditions::Fulfillment:
Collaboration graph
[legend]

Public Member Functions

virtual ~Fulfillment ()=default
 
virtual Buffer fingerprint () const =0
 Returns the fulfillment's fingerprint:
 
virtual Type type () const =0
 Returns the type of this condition.
 
virtual bool validate (Slice data) const =0
 Validates a fulfillment.
 
virtual std::uint32_t cost () const =0
 Calculates the cost associated with this fulfillment.
 
virtual Condition condition () const =0
 Returns the condition associated with the given fulfillment.
 

Static Public Member Functions

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

Static Public Attributes

static constexpr std::size_t maxSerializedFulfillment = 256
 The largest binary fulfillment we support.
 

Detailed Description

Definition at line 12 of file Fulfillment.h.

Constructor & Destructor Documentation

◆ ~Fulfillment()

virtual xrpl::cryptoconditions::Fulfillment::~Fulfillment ( )
virtualdefault

Member Function Documentation

◆ deserialize()

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

Load a fulfillment from its binary form.

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

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

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

Definition at line 37 of file Fulfillment.cpp.

◆ fingerprint()

virtual Buffer xrpl::cryptoconditions::Fulfillment::fingerprint ( ) const
pure virtual

Returns the fulfillment's fingerprint:

The fingerprint is an octet string uniquely representing this fulfillment's condition with respect to other conditions of the same type.

Implemented in xrpl::cryptoconditions::PreimageSha256.

◆ type()

virtual Type xrpl::cryptoconditions::Fulfillment::type ( ) const
pure virtual

Returns the type of this condition.

Implemented in xrpl::cryptoconditions::PreimageSha256.

◆ validate()

virtual bool xrpl::cryptoconditions::Fulfillment::validate ( Slice  data) const
pure virtual

Validates a fulfillment.

Implemented in xrpl::cryptoconditions::PreimageSha256.

◆ cost()

virtual std::uint32_t xrpl::cryptoconditions::Fulfillment::cost ( ) const
pure virtual

Calculates the cost associated with this fulfillment.

  • The cost function is deterministic and depends on the type and properties of the condition and the fulfillment that the condition is generated from.

Implemented in xrpl::cryptoconditions::PreimageSha256.

◆ condition()

virtual Condition xrpl::cryptoconditions::Fulfillment::condition ( ) const
pure virtual

Returns the condition associated with the given fulfillment.

This process is completely deterministic. All implementations will, if compliant, produce the identical condition for the same fulfillment.

Implemented in xrpl::cryptoconditions::PreimageSha256.

Member Data Documentation

◆ maxSerializedFulfillment

constexpr std::size_t xrpl::cryptoconditions::Fulfillment::maxSerializedFulfillment = 256
staticconstexpr

The largest binary fulfillment we support.

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

Definition at line 22 of file Fulfillment.h.