Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
miniscript::Type Class Reference

This type encapsulates the miniscript type system properties. More...

#include <miniscript.h>

Public Member Functions

constexpr Type operator| (Type x) const
 Compute the type with the union of properties. More...
 
constexpr Type operator& (Type x) const
 Compute the type with the intersection of properties. More...
 
constexpr bool operator<< (Type x) const
 Check whether the left hand's properties are superset of the right's (= left is a subtype of right). More...
 
constexpr bool operator< (Type x) const
 Comparison operator to enable use in sets/maps (total ordering incompatible with <<). More...
 
constexpr bool operator== (Type x) const
 Equality operator. More...
 
constexpr Type If (bool x) const
 The empty type if x is false, itself otherwise. More...
 

Private Member Functions

constexpr Type (uint32_t flags)
 Internal constructor used by the ""_mst operator. More...
 

Private Attributes

uint32_t m_flags
 Internal bitmap of properties (see ""_mst operator for details). More...
 

Friends

constexpr friend Type operator""_mst (const char *c, size_t l)
 The only way to publicly construct a Type is using this literal operator. More...
 

Detailed Description

This type encapsulates the miniscript type system properties.

Every miniscript expression is one of 4 basic types, and additionally has a number of boolean type properties.

The basic types are:

There a type properties that help reasoning about correctness:

Additional type properties help reasoning about nonmalleability:

One type property is an implementation detail:

Five more type properties for representing timelock information. Spend paths in miniscripts containing conflicting timelocks and heightlocks cannot be spent together. This helps users detect if miniscript does not match the semantic behaviour the user expects.

Definition at line 122 of file miniscript.h.

Constructor & Destructor Documentation

◆ Type()

constexpr miniscript::Type::Type ( uint32_t  flags)
inlineexplicitconstexprprivate

Internal constructor used by the ""_mst operator.

Definition at line 127 of file miniscript.h.

Here is the caller graph for this function:

Member Function Documentation

◆ If()

constexpr Type miniscript::Type::If ( bool  x) const
inlineconstexpr

The empty type if x is false, itself otherwise.

Definition at line 149 of file miniscript.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator&()

constexpr Type miniscript::Type::operator& ( Type  x) const
inlineconstexpr

Compute the type with the intersection of properties.

Definition at line 137 of file miniscript.h.

Here is the call graph for this function:

◆ operator<()

constexpr bool miniscript::Type::operator< ( Type  x) const
inlineconstexpr

Comparison operator to enable use in sets/maps (total ordering incompatible with <<).

Definition at line 143 of file miniscript.h.

◆ operator<<()

constexpr bool miniscript::Type::operator<< ( Type  x) const
inlineconstexpr

Check whether the left hand's properties are superset of the right's (= left is a subtype of right).

Definition at line 140 of file miniscript.h.

◆ operator==()

constexpr bool miniscript::Type::operator== ( Type  x) const
inlineconstexpr

Equality operator.

Definition at line 146 of file miniscript.h.

◆ operator|()

constexpr Type miniscript::Type::operator| ( Type  x) const
inlineconstexpr

Compute the type with the union of properties.

Definition at line 134 of file miniscript.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator""_mst

constexpr friend Type operator""_mst ( const char *  c,
size_t  l 
)
friend

The only way to publicly construct a Type is using this literal operator.

Definition at line 153 of file miniscript.h.

Member Data Documentation

◆ m_flags

uint32_t miniscript::Type::m_flags
private

Internal bitmap of properties (see ""_mst operator for details).

Definition at line 124 of file miniscript.h.


The documentation for this class was generated from the following file: