Struct miniscript::miniscript::types::correctness::Correctness
source · 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§
source§impl Correctness
impl Correctness
sourcepub fn is_subtype(&self, other: Self) -> bool
pub fn is_subtype(&self, other: Self) -> bool
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§
source§impl Clone for Correctness
impl Clone for Correctness
source§fn clone(&self) -> Correctness
fn clone(&self) -> Correctness
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Correctness
impl Debug for Correctness
source§impl Hash for Correctness
impl Hash for Correctness
source§impl Ord for Correctness
impl Ord for Correctness
source§fn cmp(&self, other: &Correctness) -> Ordering
fn cmp(&self, other: &Correctness) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<Correctness> for Correctness
impl PartialEq<Correctness> for Correctness
source§fn eq(&self, other: &Correctness) -> bool
fn eq(&self, other: &Correctness) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Correctness> for Correctness
impl PartialOrd<Correctness> for Correctness
source§fn partial_cmp(&self, other: &Correctness) -> Option<Ordering>
fn partial_cmp(&self, other: &Correctness) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Property for Correctness
impl Property for Correctness
source§fn sanity_checks(&self)
fn sanity_checks(&self)
source§fn from_false() -> Self
fn from_false() -> Self
False
fragmentsource§fn from_pk_k<Ctx: ScriptContext>() -> Self
fn from_pk_k<Ctx: ScriptContext>() -> Self
PkK
fragmentsource§fn from_pk_h<Ctx: ScriptContext>() -> Self
fn from_pk_h<Ctx: ScriptContext>() -> Self
PkH
fragmentsource§fn from_multi(_: usize, _: usize) -> Self
fn from_multi(_: usize, _: usize) -> Self
Multi
fragmentsource§fn from_multi_a(_: usize, _: usize) -> Self
fn from_multi_a(_: usize, _: usize) -> Self
MultiA
fragmentsource§fn cast_check(self) -> Result<Self, ErrorKind>
fn cast_check(self) -> Result<Self, ErrorKind>
Check
wrappersource§fn cast_dupif(self) -> Result<Self, ErrorKind>
fn cast_dupif(self) -> Result<Self, ErrorKind>
DupIf
wrappersource§fn cast_verify(self) -> Result<Self, ErrorKind>
fn cast_verify(self) -> Result<Self, ErrorKind>
Verify
wrappersource§fn cast_nonzero(self) -> Result<Self, ErrorKind>
fn cast_nonzero(self) -> Result<Self, ErrorKind>
NonZero
wrappersource§fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
ZeroNotEqual
wrappersource§fn cast_or_i_false(self) -> Result<Self, ErrorKind>
fn cast_or_i_false(self) -> Result<Self, ErrorKind>
[X]
to or_i([X], 0)
or or_i(0, [X])
source§fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
AndB
fragmentsource§fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
AndV
fragmentsource§fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
OrB
fragmentsource§fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
OrD
fragmentsource§fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
OrC
fragmentsource§fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
OrI
fragmentsource§fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>
fn and_or(a: Self, b: Self, c: Self) -> Result<Self, ErrorKind>
AndOr
fragmentsource§fn threshold<S>(_k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind>where
S: FnMut(usize) -> Result<Self, ErrorKind>,
fn threshold<S>(_k: usize, n: usize, sub_ck: S) -> Result<Self, ErrorKind>where S: FnMut(usize) -> Result<Self, ErrorKind>,
Thresh
fragmentsource§fn from_sha256() -> Self
fn from_sha256() -> Self
Sha256
hash. Default implementation simply
passes through to from_hash
source§fn from_hash256() -> Self
fn from_hash256() -> Self
Hash256
hash. Default implementation simply
passes through to from_hash
source§fn from_ripemd160() -> Self
fn from_ripemd160() -> Self
Ripemd160
hash. Default implementation simply
passes through to from_hash
source§fn from_hash160() -> Self
fn from_hash160() -> Self
Hash160
hash. Default implementation simply
passes through to from_hash
source§fn from_after(t: LockTime) -> Self
fn from_after(t: LockTime) -> Self
from_time
source§fn from_older(t: Sequence) -> Self
fn from_older(t: Sequence) -> Self
from_time
source§fn cast_unlikely(self) -> Result<Self, ErrorKind>
fn cast_unlikely(self) -> Result<Self, ErrorKind>
[X]
to or_i([X], 0)
. Default implementation
simply passes through to cast_or_i_false
source§fn cast_likely(self) -> Result<Self, ErrorKind>
fn cast_likely(self) -> Result<Self, ErrorKind>
[X]
to or_i(0, [X])
. Default implementation
simply passes through to cast_or_i_false
source§fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>
fn and_n(left: Self, right: Self) -> Result<Self, ErrorKind>
AndN
fragment