Skip to content

Commit 711f29e

Browse files
committed
miniscript: make dissat_sat return a struct rather than a tuple
It is too easy to get the satisfactions and dissatisfactions confused. Use a struct with named fields. Curiously, outside of this module dissatisfactions are never used, so we can keep the `dissat` field private. (Well, this is a bit of a sketchy thing to say -- dissatisfactions **are** used by the Satisfaction::thresh and thresh_mall functions, but those functions take dissats and sats as independent Vecs they can manipulate, rather than taking a SatDissat struct.)
1 parent 8ab549a commit 711f29e

2 files changed

Lines changed: 129 additions & 108 deletions

File tree

src/miniscript/satisfy/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ impl<Pk: MiniscriptKey + ToPublicKey> Satisfaction<Placeholder<Pk>> {
10261026
Ctx: ScriptContext,
10271027
P: AssetProvider<Pk>,
10281028
{
1029-
Self::dissat_sat(node, provider, false, root_has_sig, leaf_hash).1
1029+
Self::dissat_sat(node, provider, false, root_has_sig, leaf_hash).sat
10301030
}
10311031

10321032
pub(crate) fn build_template_mall<P, Ctx>(
@@ -1039,7 +1039,7 @@ impl<Pk: MiniscriptKey + ToPublicKey> Satisfaction<Placeholder<Pk>> {
10391039
Ctx: ScriptContext,
10401040
P: AssetProvider<Pk>,
10411041
{
1042-
Self::dissat_sat(node, provider, true, root_has_sig, leaf_hash).1
1042+
Self::dissat_sat(node, provider, true, root_has_sig, leaf_hash).sat
10431043
}
10441044

10451045
// produce a non-malleable satisafaction for thesh frag

0 commit comments

Comments
 (0)