Struct miniscript::miniscript::types::correctness::Correctness [−][src]
pub struct Correctness { pub base: Base, pub input: Input, pub dissatisfiable: bool, pub unit: bool, }
Expand description
Structure representing the type properties of a fragment which are relevant to completeness (are all expected branches actually accessible, given some valid witness) and soundness (is it possible to satisfy the Script without satisfying one of the Miniscript branches).
Fields
base: Base
The base type
input: Input
Properties of the inputs
dissatisfiable: bool
Whether it is definitely possible to dissatisfy the expression.
If this is false, it does not necessarily mean that dissatisfaction
is impossible (see Dissat::None
for this property); it only means
that we cannot depend on having a dissatisfaction when reasoning
about completeness.
unit: bool
Whether the fragment’s “nonzero” output on satisfaction is always the constant 1.
Implementations
Check whether the self
is a subtype of other
argument .
This checks whether the argument other
has attributes which are present
in the given Type
. This returns true
on same arguments
a.is_subtype(a)
is true
.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Any extra sanity checks/assertions that should be applied after typechecking Read more
Type property of the False
fragment
Type property of a Multi
fragment
Cast using the Check
wrapper
Cast using the DupIf
wrapper
Cast using the Verify
wrapper
Cast using the NonZero
wrapper
Cast using the ZeroNotEqual
wrapper
Cast by changing [X]
to or_i([X], 0)
or or_i(0, [X])
Computes the type of an AndB
fragment
Computes the type of an AndV
fragment
Computes the type of an OrB
fragment
Computes the type of an OrD
fragment
Computes the type of an OrC
fragment
Computes the type of an OrI
fragment
Computes the type of an AndOr
fragment
Computes the type of an Thresh
fragment
Type property of a Sha256
hash. Default implementation simply
passes through to from_hash
Read more
Type property of a Hash256
hash. Default implementation simply
passes through to from_hash
Read more
Type property of a Ripemd160
hash. Default implementation simply
passes through to from_hash
Read more
Type property of a Hash160
hash. Default implementation simply
passes through to from_hash
Read more
Type property of a relative timelock. Default implementation simply
passes through to from_time
Read more
Type property of an absolute timelock. Default implementation simply
passes through to from_time
Read more
Cast by changing [X]
to or_i([X], 0)
. Default implementation
simply passes through to cast_or_i_false
Read more
Cast by changing [X]
to or_i(0, [X])
. Default implementation
simply passes through to cast_or_i_false
Read more
Computes the type of an AndN
fragment
fn type_check<Pk, Ctx, C>(
fragment: &Terminal<Pk, Ctx>,
child: C
) -> Result<Self, Error<Pk, Ctx>> where
C: FnMut(usize) -> Option<Self>,
Pk: MiniscriptKey,
Ctx: ScriptContext,
fn type_check<Pk, Ctx, C>(
fragment: &Terminal<Pk, Ctx>,
child: C
) -> Result<Self, Error<Pk, Ctx>> where
C: FnMut(usize) -> Option<Self>,
Pk: MiniscriptKey,
Ctx: ScriptContext,
Compute the type of a fragment, given a function to look up the types of its children, if available and relevant for the given fragment Read more
Auto Trait Implementations
impl RefUnwindSafe for Correctness
impl Send for Correctness
impl Sync for Correctness
impl Unpin for Correctness
impl UnwindSafe for Correctness
Blanket Implementations
Mutably borrows from an owned value. Read more