rippled
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ripple::cryptoconditions::Fulfillment Struct Referenceabstract
Inheritance diagram for ripple::cryptoconditions::Fulfillment:
Inheritance graph
[legend]
Collaboration diagram for ripple::cryptoconditions::Fulfillment:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

Detailed Description

Definition at line 31 of file Fulfillment.h.

Constructor & Destructor Documentation

◆ ~Fulfillment()

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

Member Function Documentation

◆ deserialize()

std::unique_ptr< Fulfillment > ripple::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 57 of file Fulfillment.cpp.

◆ fingerprint()

virtual Buffer ripple::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 ripple::cryptoconditions::PreimageSha256.

◆ type()

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

Returns the type of this condition.

Implemented in ripple::cryptoconditions::PreimageSha256.

◆ validate()

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

Validates a fulfillment.

Implemented in ripple::cryptoconditions::PreimageSha256.

◆ cost()

virtual std::uint32_t ripple::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 ripple::cryptoconditions::PreimageSha256.

◆ condition()

virtual Condition ripple::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 ripple::cryptoconditions::PreimageSha256.

Member Data Documentation

◆ maxSerializedFulfillment

constexpr std::size_t ripple::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 41 of file Fulfillment.h.