feat: fixed up generate and generate test

last step is checking on uplc code gen
This commit is contained in:
microproofs
2023-07-25 12:54:43 -04:00
committed by Kasey
parent 18ea44adb0
commit 518bea5be4
2 changed files with 82 additions and 13 deletions

View File

@@ -15,7 +15,7 @@ use uplc::{
use crate::{
ast::{AssignmentKind, DataType, Pattern, Span, TypedArg, TypedClause, TypedDataType},
builtins::bool,
builtins::{bool, void},
expr::TypedExpr,
tipo::{PatternConstructor, TypeVar, ValueConstructor, ValueConstructorVariant},
};
@@ -1374,3 +1374,10 @@ pub fn cast_validator_args(term: Term<Name>, arguments: &[TypedArg]) -> Term<Nam
}
term
}
pub fn wrap_validator_condition(air_tree: AirTree) -> AirTree {
let success_branch = vec![(air_tree, AirTree::void())];
let otherwise = AirTree::error(void());
AirTree::if_branches(success_branch, void(), otherwise)
}