Create new helper functions to take care of force and delaying branch terms

This commit is contained in:
microproofs
2024-08-02 00:24:21 -04:00
committed by Kasey
parent 23a3134642
commit d7e9fef4d3
3 changed files with 147 additions and 160 deletions

View File

@@ -932,12 +932,8 @@ pub fn unknown_data_to_type(term: Term<Name>, field_type: &Type) -> Term<Name> {
)
.lambda("__list_data")
.apply(Term::unlist_data().apply(term)),
Some(UplcType::Bool) => {
Term::unwrap_bool_or(term, |result| result.delay(), &Term::Error.delay())
}
Some(UplcType::Unit) => {
Term::unwrap_void_or(term, |result| result.delay(), &Term::Error.delay())
}
Some(UplcType::Bool) => Term::unwrap_bool_or(term, |result| result, &Term::Error.delay()),
Some(UplcType::Unit) => Term::unwrap_void_or(term, |result| result, &Term::Error.delay()),
Some(UplcType::Data) | None => term,
}